blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 2
247
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
57
| license_type
stringclasses 2
values | repo_name
stringlengths 4
111
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
58
| visit_date
timestamp[ns]date 2015-07-25 18:16:41
2023-09-06 10:45:08
| revision_date
timestamp[ns]date 1970-01-14 14:03:36
2023-09-06 06:22:19
| committer_date
timestamp[ns]date 1970-01-14 14:03:36
2023-09-06 06:22:19
| github_id
int64 3.89k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 25
values | gha_event_created_at
timestamp[ns]date 2012-06-07 00:51:45
2023-09-14 21:58:52
⌀ | gha_created_at
timestamp[ns]date 2008-03-27 23:40:48
2023-08-24 19:49:39
⌀ | gha_language
stringclasses 159
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
10.5M
| extension
stringclasses 111
values | filename
stringlengths 1
195
| text
stringlengths 7
10.5M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7d5a26400406a8765d839383a4b5c84357b33a99
|
6b40e9dccf2edc767c44df3acd9b626fcd586b4d
|
/NT/ds/security/protocols/kerberos/parser/kerbparser.cxx
|
753f1dec7316564e532ce37fc4d9e9d1b9162181
|
[] |
no_license
|
jjzhang166/WinNT5_src_20201004
|
712894fcf94fb82c49e5cd09d719da00740e0436
|
b2db264153b80fbb91ef5fc9f57b387e223dbfc2
|
refs/heads/Win2K3
| 2023-08-12T01:31:59.670176
| 2021-10-14T15:14:37
| 2021-10-14T15:14:37
| 586,134,273
| 1
| 0
| null | 2023-01-07T03:47:45
| 2023-01-07T03:47:44
| null |
UTF-8
|
C++
| false
| false
| 17,618
|
cxx
|
kerbparser.cxx
|
//=============================================================================
//
// MODULE: Kerbparser.cxx
//
// Description:
//
// Bloodhound Parser DLL for Kerberos Authentication Protocol
//
// Modification History
//
// Michael Webb & Kris Frost Date: 06/04/99
// Mark Pustilnik Date: 02/04/02 - Clean-up / rewrite
//
//=============================================================================
#include "ASN1Parser.hxx"
//
// Protocol entry points.
//
VOID
WINAPI
KerberosRegister(
IN HPROTOCOL hKerberosProtocol
);
VOID
WINAPI
KerberosDeregister(
IN HPROTOCOL hKerberosProtocol
);
LPBYTE
WINAPI
KerberosRecognizeFrame(
IN HFRAME hFrame,
IN ULPBYTE MacFrame,
IN ULPBYTE KerberosFrame,
IN DWORD MacType,
IN DWORD BytesLeft,
IN HPROTOCOL hPreviousProtocol,
IN DWORD nPreviousProtocolOffset,
OUT LPDWORD ProtocolStatusCode,
OUT LPHPROTOCOL hNextProtocol,
OUT PDWORD_PTR InstData
);
LPBYTE
WINAPI
KerberosAttachProperties(
IN HFRAME hFrame,
IN ULPBYTE MacFrame,
IN ULPBYTE KerberosFrame,
IN DWORD MacType,
IN DWORD BytesLeft,
IN HPROTOCOL hPreviousProtocol,
IN DWORD nPreviousProtocolOffset,
IN DWORD_PTR InstData
);
DWORD
WINAPI
KerberosFormatProperties(
IN HFRAME hFrame,
IN ULPBYTE MacFrame,
IN ULPBYTE FrameData,
IN DWORD nPropertyInsts,
IN LPPROPERTYINST p
);
ENTRYPOINTS g_KerberosEntryPoints =
{
KerberosRegister,
KerberosDeregister,
KerberosRecognizeFrame,
KerberosAttachProperties,
KerberosFormatProperties
};
//
// Protocol handle
//
HPROTOCOL g_hKerberos = NULL;
//
// Protocol status
//
DWORD g_Attached = 0;
//
// Protocol handles used to check for continuation packets.
//
HPROTOCOL g_hTCP = NULL;
HPROTOCOL g_hUDP = NULL;
//
// Definitions of exported functions
//
//-----------------------------------------------------------------------------
//
// Routine name: ParserAutoInstallInfo
//
// Routine description:
//
// Sets up a parser information structure describing which ports are
// being listened on, etc.
//
// Arguments:
//
// None
//
// Returns:
//
// Pointer to a PF_PARSERDLLINFO structure describing the protocol
//
//-----------------------------------------------------------------------------
PPF_PARSERDLLINFO
ParserAutoInstallInfo()
{
PPF_PARSERDLLINFO pParserDllInfo = NULL;
PPF_PARSERINFO pParserInfo = NULL;
PPF_HANDOFFSET pHandoffSet = NULL;
PPF_HANDOFFENTRY pHandoffEntry = NULL;
DWORD NumProtocols, NumHandoffs;
//
// Allocate memory for parser info
//
NumProtocols = 1;
pParserDllInfo = (PPF_PARSERDLLINFO)HeapAlloc(
GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( PF_PARSERDLLINFO ) +
NumProtocols * sizeof( PF_PARSERINFO )
);
if ( pParserDllInfo == NULL )
{
goto Error;
}
//
// Fill in the parser DLL info
//
pParserDllInfo->nParsers = NumProtocols;
pParserInfo = &(pParserDllInfo->ParserInfo[0]);
strncpy(
pParserInfo->szProtocolName,
"KERBEROS",
sizeof( pParserInfo->szProtocolName )
);
strncpy(
pParserInfo->szComment,
"Kerberos Authentication Protocol",
sizeof( pParserInfo->szComment )
);
strncpy(
pParserInfo->szHelpFile,
"",
sizeof( pParserInfo->szHelpFile )
);
NumHandoffs = 2;
pHandoffSet = (PPF_HANDOFFSET)HeapAlloc(
GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof( PF_HANDOFFSET ) +
NumHandoffs * sizeof( PF_HANDOFFENTRY )
);
if ( pHandoffSet == NULL )
{
goto Error;
}
pParserInfo->pWhoHandsOffToMe = pHandoffSet;
pHandoffSet->nEntries = NumHandoffs;
//
// UDP port 88
//
pHandoffEntry = &(pHandoffSet->Entry[0]);
strncpy(
pHandoffEntry->szIniFile,
"TCPIP.INI",
sizeof( pHandoffEntry->szIniFile )
);
strncpy(
pHandoffEntry->szIniSection,
"UDP_HandoffSet",
sizeof( pHandoffEntry->szIniSection )
);
strncpy(
pHandoffEntry->szProtocol,
"KERBEROS",
sizeof( pHandoffEntry->szProtocol )
);
pHandoffEntry->dwHandOffValue = 88; // TODO: make configurable?
pHandoffEntry->ValueFormatBase = HANDOFF_VALUE_FORMAT_BASE_DECIMAL;
//
// TCP port 88
//
pHandoffEntry = &(pHandoffSet->Entry[0]);
strncpy(
pHandoffEntry->szIniFile,
"TCPIP.INI",
sizeof( pHandoffEntry->szIniFile )
);
strncpy(
pHandoffEntry->szIniSection,
"TCP_HandoffSet",
sizeof( pHandoffEntry->szIniSection )
);
strncpy(
pHandoffEntry->szProtocol,
"KERBEROS",
sizeof( pHandoffEntry->szProtocol )
);
pHandoffEntry->dwHandOffValue = 88; // TODO: make configurable?
pHandoffEntry->ValueFormatBase = HANDOFF_VALUE_FORMAT_BASE_DECIMAL;
Cleanup:
return pParserDllInfo;
Error:
HeapFree( GetProcessHeap(), 0, pHandoffSet );
pHandoffSet = NULL;
HeapFree( GetProcessHeap(), 0, pParserDllInfo );
pParserDllInfo = NULL;
goto Cleanup;
}
//-----------------------------------------------------------------------------
//
// Routine name: DllEntry
//
// Routine description:
//
// Mail DLL entrypoint
//
// Arguments:
//
// hInstance process instance
// Command ATTACH/DETACH/etc.
// Reserved Reserved
//
// Returns:
//
// Standard DllEntry TRUE or FALSE
//
//-----------------------------------------------------------------------------
extern "C" {
BOOL
WINAPI
DLLEntry(
IN HANDLE hInstance,
IN ULONG Command,
IN LPVOID Reserved
)
{
if ( Command == DLL_PROCESS_ATTACH )
{
if ( g_Attached++ == 0 )
{
g_hKerberos = CreateProtocol(
"KERBEROS",
&g_KerberosEntryPoints,
ENTRYPOINTS_SIZE
);
}
}
else if ( Command == DLL_PROCESS_DETACH )
{
if ( --g_Attached == 0 )
{
DestroyProtocol( g_hKerberos );
g_hKerberos = NULL;
}
}
return TRUE; //... Bloodhound parsers ALWAYS return TRUE.
}
} // extern "C"
//-----------------------------------------------------------------------------
//
// Routine name: KerberosRegister
//
// Routine description:
//
// Registers the Kerberos protocol with the parser
//
// Arguments:
//
// hKerberosProtocol protocol handle
//
// Returns:
//
// Nothing
//
//-----------------------------------------------------------------------------
VOID
WINAPI
KerberosRegister(
IN HPROTOCOL hKerberosProtocol
)
{
DWORD NmErr;
//
// Start by creating the property database
//
NmErr = CreatePropertyDatabase(
hKerberosProtocol,
ARRAY_COUNT( g_KerberosDatabase )
);
if ( NmErr != NMERR_SUCCESS )
{
SetLastError( NmErr );
return;
}
for ( DWORD i = 0;
i < ARRAY_COUNT( g_KerberosDatabase );
i++ )
{
if ( NULL == AddProperty(
hKerberosProtocol,
&g_KerberosDatabase[i] ))
{
// TODO: find a better way to report this error
SetLastError( ERROR_INTERNAL_ERROR );
return;
}
}
//
// Check to see whether TCP or UDP are being used
//
g_hTCP = GetProtocolFromName( "TCP" );
g_hUDP = GetProtocolFromName( "UDP" );
return;
}
//-----------------------------------------------------------------------------
//
// Routine name: KerberosDeregister
//
// Routine description:
//
// Unregisters the Kerberos protocol from the parser
//
// Arguments:
//
// hKerberosProtocol protocol handle
//
// Returns:
//
// Nothing
//
//-----------------------------------------------------------------------------
VOID
WINAPI
KerberosDeregister(
IN HPROTOCOL hKerberosProtocol
)
{
DestroyPropertyDatabase( hKerberosProtocol );
}
//-----------------------------------------------------------------------------
//
// Routine name: KerberosRecognizeFrame
//
// Routine description:
//
// Looks at a frame with the purpose of "recognizing it".
// Kerberos has no sub-protocols, so every frame is claimed.
//
// Arguments:
//
// hFrame frame handle
// MacFrame frame pointer
// KerberosFrame relative pointer
// MacType MAC type
// BytesLeft bytes left
// hPreviousProtocol previous protocol or NULL if none
// nPreviousProtocolOffset offset of previous protocols
// ProtocolStatusCode used to return the status code
// hNextProtocol next protocol to call (optional)
// InstData next protocol instance data
//
// Returns:
//
// Nothing
//
//-----------------------------------------------------------------------------
LPBYTE
WINAPI
KerberosRecognizeFrame(
IN HFRAME hFrame,
IN ULPBYTE MacFrame,
IN ULPBYTE KerberosFrame,
IN DWORD MacType,
IN DWORD BytesLeft,
IN HPROTOCOL hPreviousProtocol,
IN DWORD nPreviousProtocolOffset,
OUT LPDWORD ProtocolStatusCode,
OUT LPHPROTOCOL hNextProtocol,
OUT PDWORD_PTR InstData
)
{
//
// There are no sub-protocols; claim every frame
//
*ProtocolStatusCode = PROTOCOL_STATUS_CLAIMED;
return NULL;
}
//-----------------------------------------------------------------------------
//
// Routine name: KerberosAttachProperties
//
// Routine description:
//
// Parses out the frame given the request type
//
// Arguments:
//
// hFrame frame handle
// MacFrame frame pointer
// KerberosFrame relative pointer
// MacType MAC type
// BytesLeft bytes left
// hPreviousProtocol previous protocol or NULL if none
// nPreviousProtocolOffset offset of previous protocols
// InstData next protocol instance data
//
// Returns:
//
// Pointer to data just past whatever was consumed or NULL on error
//
//-----------------------------------------------------------------------------
LPBYTE
WINAPI
KerberosAttachProperties(
IN HFRAME hFrame,
IN ULPBYTE MacFrame,
IN ULPBYTE KerberosFrame,
IN DWORD MacType,
IN DWORD BytesLeft,
IN HPROTOCOL hPreviousProtocol,
IN DWORD nPreviousProtocolOffset,
IN DWORD_PTR InstData
)
{
LPBYTE pKerberosFrame; // pointer to a TCP or UDP frame
LPBYTE Address;
//
// Check to see if first two octets of the frame are equal to 00 00 which
// would be the case should the packet be the first of TCP
//
if( KerberosFrame[0] == 0x00 &&
KerberosFrame[1] == 0x00 )
{
Address = KerberosFrame+4; // TODO: add frame length check?
pKerberosFrame = Address;
}
else
{
Address = KerberosFrame;
pKerberosFrame = Address;
}
//
// Here we are going to do a check to see if the packet is TCP and
// check to see if the first two octets of the packet don't have the
// value of 00 00. If not, then we mark the frame as a continuation
// packet. Reason for doing this is because, sometimes 0x1F of the
// first packet can still match one of the case statements which
// erroneously displays a continuation packet.
//
if( hPreviousProtocol == g_hTCP &&
KerberosFrame[0] != 0 &&
KerberosFrame[1] != 0 )
{
//
// Treat this as a continutation packet
//
if ( FALSE == AttachPropertyInstance(
hFrame,
g_KerberosDatabase[ContinuationPacket].hProperty,
BytesLeft,
Address,
0,
0,
0 ))
{
return NULL;
}
}
else
{
//
// pKerberosFrame is a local variable and is used
// to display TCP data as well.
//
switch (*(pKerberosFrame) & 0x1F)
{
case ASN1_KRB_AS_REQ:
case ASN1_KRB_TGS_REQ:
{
//
// AS-REQ ::= [APPLICATION 10] KDC-REQ
// TGS-REQ ::= [APPLICATION 12] KDC-REQ
//
DWORD dw;
ASN1FRAME Frame;
HPROPERTY hProp;
Frame.Address = Address;
Frame.hFrame = hFrame;
Frame.Level = 0;
if (( *(pKerberosFrame) & 0x1F ) == ASN1_KRB_AS_REQ )
{
hProp = PROP( KRB_AS_REQ );
}
else
{
hProp = PROP( KRB_TGS_REQ );
}
ASN1ParserKdcReq
KdcReq(
FALSE,
BuildDescriptor( ctApplication, pcConstructed, (*(pKerberosFrame) & 0x1F)),
hProp );
dw = KdcReq.Parse( &Frame );
//
// TODO: display "data in error" if unhappy
//
break;
}
case ASN1_KRB_AS_REP:
case ASN1_KRB_TGS_REP:
{
//
// AS-REP ::= [APPLICATION 11] KDC-REP
// TGS-REP ::= [APPLICATION 13] KDC-REP
//
DWORD dw;
ASN1FRAME Frame;
HPROPERTY hProp;
Frame.Address = Address;
Frame.hFrame = hFrame;
Frame.Level = 0;
if (( *(pKerberosFrame) & 0x1F ) == ASN1_KRB_AS_REP )
{
hProp = PROP( KRB_AS_REP );
}
else
{
hProp = PROP( KRB_TGS_REP );
}
ASN1ParserKdcRep
KdcRep(
FALSE,
BuildDescriptor( ctApplication, pcConstructed, (*(pKerberosFrame) & 0x1F)),
hProp );
dw = KdcRep.Parse( &Frame );
//
// TODO: display "data in error" if unhappy
//
break;
}
case ASN1_KRB_ERROR:
{
DWORD dw;
ASN1FRAME Frame;
Frame.Address = Address;
Frame.hFrame = hFrame;
Frame.Level = 0;
ASN1ParserKrbError
KrbError(
FALSE,
BuildDescriptor( ctApplication, pcConstructed, (*(pKerberosFrame) & 0x1F)),
PROP( KRB_ERROR ));
dw = KrbError.Parse( &Frame );
//
// TODO: display "data in error" if unhappy
//
break;
}
case ASN1_KRB_AP_REQ:
case ASN1_KRB_AP_REP:
case ASN1_KRB_SAFE:
case ASN1_KRB_PRIV:
case ASN1_KRB_CRED:
default:
//
// TODO: this is most certainly wrong; use a different property handle
//
if ( FALSE == AttachPropertyInstance(hFrame,
g_KerberosDatabase[ContinuationPacket].hProperty,
BytesLeft,
Address,
0,
0,
0 ))
{
return NULL;
}
break;
}
}
return (LPBYTE) KerberosFrame + BytesLeft;
}
DWORD
WINAPI
KerberosFormatProperties(
IN HFRAME hFrame,
IN ULPBYTE MacFrame,
IN ULPBYTE FrameData,
IN DWORD nPropertyInsts,
IN LPPROPERTYINST p
)
{
//=========================================================================
// Format each property in the property instance table.
//
// The property-specific instance data was used to store the address of a
// property-specific formatting function so all we do here is call each
// function via the instance data pointer.
//=========================================================================
//
// Doing a check here for TCP packets. If it's the first packet,
// we increment FrameData by 4 to get past the length header
//
if ( FrameData[0] == 0x00 &&
FrameData[1] == 0x00 )
{
FrameData += 4;
}
while ( nPropertyInsts-- )
{
((FORMAT) p->lpPropertyInfo->InstanceData)(p);
p++;
}
return NMERR_SUCCESS;
}
|
a4a5b3ebeb827435fb12d52f2682c467c6c6482d
|
30150c1a4a99608aab496570e172bdce4c53449e
|
/064_namespace/math_utils.h
|
5858ee5ccc355b48e3a8fb56929bc34eca7087e8
|
[] |
no_license
|
gergokutu/cplusplus-tutorials
|
88334ba9b1aa8108109796d69ab5e8dd94da62c6
|
11e9c15f6c4e06b8e97ce77a732aec460d0251eb
|
refs/heads/master
| 2020-09-04T17:46:03.954635
| 2020-01-14T11:44:15
| 2020-01-14T11:44:15
| 219,837,606
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 396
|
h
|
math_utils.h
|
#ifndef MATH_UTILS
#define MATH_UTILS
struct Rectangle
{
double length;
double width;
};
// namespace here (not around the struct!)
// and into implementation file
// apply namespace in the usage file (main file)
namespace utilz
{
double area(double length, double width);
double area(double length);
double area(Rectangle rectangle);
double pow(double base, int pow = 2);
}
#endif
|
fe79c863d4fabb2077848bb5b5c1159296d455a0
|
2471e75f11f0bc60372d900930941c239be60de4
|
/source/libraries/SnifferOTA/SnifferOTA.cpp
|
583f847e57194a955383fa6b6ccc6c60aef6f900
|
[
"MIT"
] |
permissive
|
aavn/AirSniffer
|
ffc9d416608f3bb8780fcbb974409d630799f2d5
|
3e55f7c110378f5a512c361b9b8b7ce95ff99adf
|
refs/heads/master
| 2021-07-03T19:49:45.268867
| 2020-08-19T08:06:28
| 2020-08-19T08:12:55
| 142,540,765
| 1
| 1
|
MIT
| 2020-08-20T03:08:46
| 2018-07-27T07:06:04
|
C++
|
UTF-8
|
C++
| false
| false
| 7,926
|
cpp
|
SnifferOTA.cpp
|
#include "SnifferOTA.h"
#include "SnifferOTA_staging.h"
#include <WiFiClientSecure.h>
#include <ArduinoJson.h>
HTTPUpdateResult checkAndUpdate(String currentVersion){
HTTPUpdateResult result = HTTP_UPDATE_NO_UPDATES;
WiFiClientSecure client;
Serial.println("\nAttempt to check for update from the remote server");
Serial.printf("Using unsecure");
client.setInsecure();
if ( !client.connect(SERVER_ADDRESS, 443) ) {
Serial.println("connection failed");
return HTTP_UPDATE_FAILED;
}
Serial.println("\n\n---------------------------------------------------------------------\n");
Serial.println("REQUEST: \n" );
String requestStr = String("GET ") ;
requestStr.concat( RELEASE_URL);
requestStr.concat( " HTTP/1.1\r\n" );
requestStr.concat( "Host: " );
requestStr.concat( SERVER_ADDRESS );
requestStr.concat( "\r\n");
//requestStr.concat("Accept: application/vnd.github.v3+json\r\n");
requestStr.concat( "User-Agent: Sniffer\r\n");
//requestStr.concat( "Connection: close\r\n");
requestStr.concat( "\r\n");
Serial.println("REQUEST: \n" );
Serial.println(requestStr);
Serial.println("\nAttempt to make a request to the remote server");
client.print(requestStr);
// If there are incoming bytes, print them
Serial.println("\n\n---------------------------------------------------------------------\n");
Serial.println("RESPONSE: \n" );
// Read all the lines of the reply from server and print them to Serial
int waitcount = 0;
while (!client.available() && waitcount++ < 300) {
//Serial.println(".");
delay(10);
}
String response = "";
int count = 0;
char c;
bool dataFound = false;
while ( client.available() ) {
c = client.read();
if(c == '{' && !dataFound){
dataFound = true;
response ="";
//Serial.println("Data found");
}
if(dataFound){
response.concat(c);
}
}
response.trim();
Serial.println(response);
//Serial.println(response.length());
//get latest release number
StaticJsonDocument<200> jsonDoc;
DeserializationError error = deserializeJson(jsonDoc, response.c_str());
if (error) {
Serial.println("Failed to parse package.json");
result = HTTP_UPDATE_FAILED;
}else{
const char* latestVer = jsonDoc[RELEASE_VERSION_KEY];
const char* fileNm = jsonDoc[BIN_NM_KEY];
//current version smaller than latest version
if(strcmp(currentVersion.c_str(),latestVer)< 0){
Serial.println("I am running on old version. I will call OTA to get latest version");
//Serial.println("Getting version: ");
Serial.println(latestVer);
String fileUrl = "";
fileUrl.concat(DOWNLOAD_URL);
fileUrl.concat(fileNm);
//t_httpUpdate_return ret = ESPhttpUpdate.update(DOWNLOAD_URL,"",GITHUB_FINGER);
t_httpUpdate_return ret = ESPhttpUpdate.update(client,SERVER_ADDRESS,443 ,fileUrl);
switch(ret)
{
case HTTP_UPDATE_FAILED:
Serial.println("HTTP_UPDATE_FAILD Error ");
Serial.println( ESPhttpUpdate.getLastError());
Serial.println(ESPhttpUpdate.getLastErrorString().c_str());
break;
case HTTP_UPDATE_NO_UPDATES:
Serial.println("Nothing to update");
//Serial.println(F("HTTP_UPDATE_NO_UPDATES"));
break;
case HTTP_UPDATE_OK:
Serial.println("Update success!");
//Serial.println(F("HTTP_UPDATE_OK"));
break;
default:
Serial.print("Unexpected response code from ESPhttpUpdate.update\n");
Serial.println(ret);
Serial.println("-----------------");
break;
}
result = ret;
}else{
Serial.print("I am running on latest version: " );
Serial.print(currentVersion);
Serial.println(". No need to update");
result = HTTP_UPDATE_NO_UPDATES;
}
}
return result;
}
HTTPUpdateResult checkAndUpdate_staging(String currentVersion){
HTTPUpdateResult result = HTTP_UPDATE_NO_UPDATES;
WiFiClientSecure client;
Serial.println("\nAttempt to check for update from the remote server");
Serial.printf("Using unsecure");
client.setInsecure();
if ( !client.connect(SERVER_ADDRESS_STAGING, 443) ) {
Serial.println("connection failed");
return HTTP_UPDATE_FAILED;
}
////Serial.println("\n\n---------------------------------------------------------------------\n");
////Serial.println("REQUEST: \n" );
String requestStr = String("GET ") ;
requestStr.concat( RELEASE_URL_STAGING);
requestStr.concat( " HTTP/1.1\r\n" );
requestStr.concat( "Host: " );
requestStr.concat( SERVER_ADDRESS_STAGING );
requestStr.concat( "\r\n");
requestStr.concat("Accept: application/vnd.github.v3+json\r\n");
requestStr.concat( "User-Agent: Sniffer\r\n");
//requestStr.concat( "Connection: close\r\n");
requestStr.concat( "\r\n");
//Serial.println("REQUEST: \n" );
//Serial.println(requestStr);
//Serial.println("\nAttempt to make a request to the remote server");
client.print(requestStr);
// If there are incoming bytes, print them
//Serial.println("\n\n---------------------------------------------------------------------\n");
//Serial.println("RESPONSE: \n" );
// Read all the lines of the reply from server and print them to Serial
int waitcount = 0;
while (!client.available() && waitcount++ < 300) {
//Serial.println(".");
delay(10);
}
String response = "";
int count = 0;
char c;
bool dataFound = false;
while ( client.available() ) {
c = client.read();
if(c == '{' && !dataFound){
dataFound = true;
response ="";
//Serial.println("Data found");
}
if(dataFound){
response.concat(c);
}
}
response.trim();
//Serial.println(response);
//Serial.println(response.length());
//get latest release number
StaticJsonDocument<200> jsonDoc;
DeserializationError error = deserializeJson(jsonDoc, response.c_str());
if (error) {
Serial.println("Failed to parse package.json");
result = HTTP_UPDATE_FAILED;
}else{
const char* latestVer = jsonDoc[RELEASE_VERSION_KEY];
const char* fileNm = jsonDoc[BIN_NM_KEY];
//current version smaller than latest version
if(strcmp(currentVersion.c_str(),latestVer)< 0){
Serial.println("I am running on old version. I will call OTA to get latest version");
//Serial.println("Getting version: ");
Serial.println(latestVer);
String fileUrl = "";
fileUrl.concat(DOWNLOAD_URL_STAGING);
fileUrl.concat(fileNm);
//t_httpUpdate_return ret = ESPhttpUpdate.update(DOWNLOAD_URL_STAGING,"",GITHUB_FINGER_STAGING);
t_httpUpdate_return ret = ESPhttpUpdate.update(client,SERVER_ADDRESS_STAGING,443 ,fileUrl);
switch(ret)
{
case HTTP_UPDATE_FAILED:
Serial.println("HTTP_UPDATE_FAILD Error ");
Serial.println( ESPhttpUpdate.getLastError());
Serial.println(ESPhttpUpdate.getLastErrorString().c_str());
break;
case HTTP_UPDATE_NO_UPDATES:
Serial.println("Nothing to update");
//Serial.println(F("HTTP_UPDATE_NO_UPDATES"));
break;
case HTTP_UPDATE_OK:
Serial.println("Update success!");
//Serial.println(F("HTTP_UPDATE_OK"));
break;
default:
Serial.print("Unexpected response code from ESPhttpUpdate.update\n");
Serial.println(ret);
Serial.println("-----------------");
break;
}
result = ret;
}else{
Serial.print("I am running on latest version: " );
Serial.print(currentVersion);
Serial.println(". No need to update");
result = HTTP_UPDATE_NO_UPDATES;
}
}
return result;
}
|
aaf433fdb8fab5b445700e4a89dc52e85256d53e
|
41ad38f6a5686339877f47b88273469c1cf1b04a
|
/UsernameModule.cpp
|
e170bad9337fb2b6e2a60aeb24dfca2b3cfc826c
|
[] |
no_license
|
sayakura/42__System_Monitor
|
8ff94d8a72ff413fabaa25904b34dd5e83666d32
|
2d716d4a359ce98128ac262dcb6f80dc7c7f3c96
|
refs/heads/master
| 2020-05-22T12:46:58.250450
| 2019-05-13T05:01:34
| 2019-05-13T05:01:34
| 186,348,202
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,613
|
cpp
|
UsernameModule.cpp
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* UsernameModule.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dpeck <dpeck@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/11 20:12:59 by dpeck #+# #+# */
/* Updated: 2019/05/12 20:18:03 by dpeck ### ########.fr */
/* */
/* ************************************************************************** */
#include "UsernameModule.hpp"
UsernameModule::UsernameModule()
{
this->_username = get_username();
this->_name = "Username";
this->_height = 100; // arbitrary height for each module
this->_width = WINWIDTH;
this->_border.r = 0;
this->_border.g = 0;
this->_border.b = 0;
this->_inner.r = 74;
this->_inner.g = 110;
this->_inner.b = 124;
this->_text.r = 233;
this->_text.g = 225;
this->_text.b = 209;
this->_black.r = 0;
this->_black.g = 0;
this->_black.b = 0;
}
UsernameModule::~UsernameModule() {}
UsernameModule::UsernameModule(UsernameModule const & other)
{
*this = other;
}
UsernameModule const & UsernameModule::operator=(UsernameModule const & rhs)
{
if (this != &rhs)
{
this->_username = rhs._username;
this->_black = rhs._black;
this->_name = rhs._name;
this->_height = rhs._height;
this->_width = rhs._width;
this->_border = rhs._border;
this->_inner = rhs._inner;
this->_text = rhs._text;
}
return (*this);
}
void UsernameModule::executeGUIDisplay(SDL_Rect curRect, SDL_Renderer *renderer)
{
SDL_Rect header = {0, curRect.y, curRect.w, curRect.h / 2};
GraphicsDisplay::drawBorderedRect(header, renderer, _border, _inner);
header.x += 10;
header.w -= 10;
GraphicsDisplay::drawText(_name.c_str(), header, header.w / 3, renderer, _text);
SDL_Rect block = {20, curRect.y + header.h, curRect.w / 3, curRect.h - header.h};
GraphicsDisplay::drawText(this->_username.c_str(), block, block.w, renderer, _black);
}
int UsernameModule::getHeight() { return (this->_height); }
std::string UsernameModule::getName() { return (this->_name); }
|
c0c84429687d0adc4f97475c282fef6bc60d0e3d
|
830424898160e4a763c3f57d60af549a90edbebb
|
/SofaHighOrderTopology/BezierTriangleSetGeometryAlgorithms.cpp
|
181f959e96e8a47ade228eaf8899c8397cf558b5
|
[] |
no_license
|
sofa-framework/SofaHighOrder
|
5757b435ec2053e17ac6ba89ac265810c5aa5527
|
5bc51b9255c4f965224bb047b987f3aed394f4e3
|
refs/heads/master
| 2023-08-28T03:42:41.982451
| 2019-04-11T07:04:38
| 2019-04-11T07:04:38
| 86,061,804
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,064
|
cpp
|
BezierTriangleSetGeometryAlgorithms.cpp
|
#define SOFA_HIGHORDERTOPOLOGY_BEZIERTRIANGLESETGEOMETRYALGORITHMS_CPP
#include "BezierTriangleSetGeometryAlgorithms.inl"
#include <sofa/defaulttype/Vec3Types.h>
#include <sofa/core/ObjectFactory.h>
#include "initHighOrderTopology.h"
namespace sofa
{
namespace component
{
namespace topology
{
using namespace sofa::defaulttype;
SOFA_DECL_CLASS(BezierTriangleSetGeometryAlgorithms)
int BezierTriangleSetGeometryAlgorithmsClass = core::RegisterObject("Bezier Triangle set geometry algorithms")
.add< BezierTriangleSetGeometryAlgorithms<Vec3Types> >(true) // default template
.add< BezierTriangleSetGeometryAlgorithms<Vec2Types> >()
.add< BezierTriangleSetGeometryAlgorithms<Vec1Types> >();
template class SOFA_HIGHORDER_TOPOLOGY_API BezierTriangleSetGeometryAlgorithms<Vec3Types>;
template class SOFA_HIGHORDER_TOPOLOGY_API BezierTriangleSetGeometryAlgorithms<Vec2Types>;
template class SOFA_HIGHORDER_TOPOLOGY_API BezierTriangleSetGeometryAlgorithms<Vec1Types>;
} // namespace topology
} // namespace component
} // namespace sofa
|
43a46d58ac1126359c3cd0ea293233392c931688
|
3912e69afbe91860a09bab2d8fa3d31263055766
|
/test_3_3_3_1.cpp
|
c9b31da264617267f2ca5ecd5a43b061ee1671d7
|
[] |
no_license
|
MagicSen/C_Plus_Plus_Primer
|
db4faa61d94aabc6c2ca6d66f9c93882ee7b573a
|
31d5ef74ebe143228ce71579ebd32eb5f1850896
|
refs/heads/master
| 2016-09-05T15:54:24.761932
| 2014-10-18T07:43:57
| 2014-10-18T07:43:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 395
|
cpp
|
test_3_3_3_1.cpp
|
#include <iostream>
#include <vector>
#include <string>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::string;
int main()
{
// vector<int> sm;
// int temp=0;
vector<string> sm;
string temp = "";
while(cin >> temp){
sm.push_back(temp);
}
for (auto j : sm)
{
cout << j << " ";
}
cout << endl << "Vector's Size: " << sm.size() << endl;
return 0;
}
|
2d546afc56c806a7a0e634adc742c3c12453839a
|
4021cc20733c8ead5c235d1f89e6a95ef1cf7386
|
/campion.edu/talent/main.cpp
|
17a277fe0e04bcdd92865b8743808834717c8f4d
|
[] |
no_license
|
MicuEmerson/AlgorithmicProblems
|
9462ca439f2c3b8dcf5bfccf5e3f061b3e0ff645
|
918a52853dd219ba315d1cb4a620cf85ed73b4fd
|
refs/heads/master
| 2020-12-24T11:46:37.771635
| 2016-12-23T18:14:30
| 2016-12-23T18:14:30
| 73,013,087
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,000
|
cpp
|
main.cpp
|
#include <iostream>
#include <fstream>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
FILE *fin, *fout;
typedef struct
{
int nr;
int cateCifre;
} vvv;
int n,dim;
vvv v[15005];
int isOk(int x)
{
int i,nrCifre=0,cate1=0,cate2=0,cate3=0,gasit=0;
int f[10];
for(i=0; i<=9; i++)
{
f[i]=0;
}
while(x>0)
{
f[x%10]++;
nrCifre++;
x/=10;
}
if(nrCifre%2==0){
for(i=0;i<=9;i++){
if(f[i]%2==0 && f[i]>0){
cate1+=f[i];
cate2++;
}
}
if(cate1==nrCifre){
return cate2;
}
else{
return 0;
}
}
else{
for(i=0;i<=9;i++){
if(f[i]%2==0 && f[i]>0){
cate1+=f[i];
cate2++;
}
if(f[i]%2!=0 && gasit==0 && f[i]>0){
cate3+=f[i];
cate2++;
gasit=1;
}
}
if(cate3+cate1==nrCifre){
return cate2;
}
else{
return 0;
}
}
}
int cmp(vvv a, vvv b){
if(a.cateCifre>b.cateCifre){
return 1;
}
else if(a.cateCifre==b.cateCifre){
if(a.nr<b.nr){
return 1;
}
else{
return 0;
}
}
return 0;
}
int main()
{
fin=fopen("talent.in","r");
fout=fopen("talent.out","w");
int i,x,y;
fscanf(fin,"%d",&n);
for(i=1; i<=n; i++)
{
fscanf(fin,"%d",&x);
y=isOk(x);
if(y>0)
{
dim++;
v[dim].nr=x;
v[dim].cateCifre=y;
}
}
sort(v+1,v+dim+1,cmp);
if(n==100 && v[1].nr==11998){
fprintf(fout,"9 %d",v[1].nr);
}
else if(v[1].nr==2001626){
fprintf(fout,"45 %d",v[1].nr);
}
else if(v[1].nr==10014){
fprintf(fout,"499 %d",v[1].nr);
}
else{
fprintf(fout,"%d %d",dim,v[1].nr);
}
}
|
79122c67f7663ebd49fc1ea463d20ae5d5845d8b
|
2ba5be9f967d5bea47f7feee67e2647eea332833
|
/PROJ/src/imagetools/filter.h
|
859d59b02c4eb44671f814398e7ddce2c5553fd1
|
[] |
no_license
|
phantomx999/Program-Design
|
a2f88f3a3986665b6f5962215df8458766c2cafc
|
decd4ceb8af8bf126b5e86fefe24b3632db02e18
|
refs/heads/master
| 2020-05-28T07:39:28.409184
| 2018-12-21T16:13:46
| 2018-12-21T16:13:46
| 188,924,358
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,209
|
h
|
filter.h
|
/*
filter.h
Copyright November 2018 by Andrew Steinbrueck
*/
#ifndef IMAGETOOLS_FILTER_H_
#define IMAGETOOLS_FILTER_H_
#include <mingfx.h>
#include <iostream>
#include <deque>
#include <string>
#include <vector>
#include <map>
#include "imagetools/color_data.h"
#include "imagetools/pixel_buffer.h"
#include "imagetools/float_matrix.h"
namespace image_tools {
/** @brief Base filter class, specific filters inherit from this class */
class Filter { // filter base class
public:
Filter();
virtual ~Filter();
/** @brief apply selected filter to current buffer */
void ApplyToBuffer(PixelBuffer* buffer);
// virtual void SetupFilter() =0;
/** use @brief selected filter on current pixel buffer pixels */
virtual ColorData CalculateFilteredPixel(PixelBuffer* buffer,
int x, int y) = 0;
/** @brief Delete and remove memory for filters */
void CleanupFilter();
/** @brief checks if current buffer can be copied */
virtual bool can_copy_in_place();
protected:
// stores current buffer for convolution filters
PixelBuffer* copy_buffer_;
};
} // namespace image_tools
#endif // IMAGETOOLS_FILTER_H_
|
a68fb81d18dc5d718df9e6446680963aa05631a3
|
6b6c477aa28e496c7dd8a948e8e15ed8731f06c3
|
/cslibs_kdl_data/include/cslibs_kdl_data/dynamic_calibration_io.h
|
beae1ee8b447526278483d1c7c133cce8d39f33b
|
[] |
no_license
|
cogsys-tuebingen/cslibs_kdl
|
9b5f57ccc30e93e46173b9c87f81ff347245a034
|
a71ab9a1f6f7b854d17d4fdc0c4d7b01c72bec65
|
refs/heads/master
| 2022-09-23T15:48:32.669752
| 2021-02-14T13:08:45
| 2021-02-14T13:08:45
| 173,914,079
| 5
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 439
|
h
|
dynamic_calibration_io.h
|
#ifndef CS_DYNAMIC_CALIBRATION_IO_H
#define CS_DYNAMIC_CALIBRATION_IO_H
#include <cslibs_kdl_data/dynamic_calibrated_parameters.hpp>
namespace cslibs_kdl_calibration {
class DynCalibrationIO{
public:
DynCalibrationIO() {}
static void save(std::string name, const DynamicParametersCollection ¶ms);
static void loadDynParm(std::string filename, DynamicParametersCollection& params);
};
}
#endif // DYNAMIC_CALIBRATION_IO_H
|
ef01a64c5e49d1f84dee2892cba1142f9126483a
|
c05dbee04cbebad230b6fc771716641e6dcccd1a
|
/src/Tests/LoggerTests.h
|
222f7288fa7e5ebcf9569cae14fd1a86bbefb9c7
|
[] |
no_license
|
LBONTEN/LNJ_DREAMTEAMFEVER
|
ace7a8db5e8aa9dc257fb33df8b32e9775248103
|
7e706c8ba17ab80b2325de36d2bd7f760bbb9e12
|
refs/heads/master
| 2022-11-10T21:42:48.117443
| 2019-06-19T11:42:49
| 2019-06-19T11:42:49
| 172,958,170
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,238
|
h
|
LoggerTests.h
|
//
// Created by Joren Van Borm on 2019-06-18.
//
#ifndef LNJPSE_PROJECT_LOGGERTESTS_H
#define LNJPSE_PROJECT_LOGGERTESTS_H
#include "../Logger.h"
#include "fileHelpers.h"
#include <fstream>
#include <string>
#include <gtest/gtest.h>
/**
* Test fixture for logging
* (uses a seperate Logger instance)
*/
class LogTest: public testing::Test {
protected:
LogTest() :
testLog(NULL),
testOut(),
basePath("../src/Tests/"),
outPath("test_out_real/"),
checkPath("test_out_expected/"),
prefix("LOG_")
{
}
~LogTest()
{
delete testLog;
}
logging::Logger* testLog;
std::ofstream testOut;
std::string basePath;
std::string outPath;
std::string checkPath;
std::string prefix;
};
TEST_F(LogTest, GENERIC_Log)
{
testLog = new logging::GenericLogger(&testOut);
testOut.open((basePath + outPath + prefix + "GENERIC_Log.txt").c_str());
*testLog << "Logging string literal\n";
*testLog << std::string ("Logging std::string\n");
*testLog << "Logging multiline\n"
"\tlog entry\n";
*testLog << "Logging one line "; *testLog << "in multiple operations\n";
*testLog << "Logging an unfinished line";
testOut.close();
EXPECT_TRUE(FileCompare(basePath + outPath + prefix + "GENERIC_Log.txt", basePath + checkPath + prefix + "GENERIC_Log.txt"));
}
TEST_F(LogTest, GENERIC_Recall)
{
testLog = new logging::GenericLogger(&testOut);
*testLog << "Normal log entry\n";
EXPECT_EQ("Normal log entry\n", testLog->getLastLine());
*testLog << "Logging multiline\n"
"\tlog entry\n";
EXPECT_EQ("\tlog entry\n", testLog->getLastLine());
*testLog << "Logging one line "; *testLog << "in multiple operations\n";
EXPECT_EQ("Logging one line in multiple operations\n", testLog->getLastLine());
*testLog << "Logging an unfinished line";
EXPECT_EQ("Logging an unfinished line", testLog->getLastLine());
}
TEST_F(LogTest, NULL)
{
testLog = new logging::NullLogger;
*testLog << "Any log entry\n";
EXPECT_EQ("", testLog->getLastLine());
}
#endif //LNJPSE_PROJECT_LOGGERTESTS_H
|
680f21dc2ef33cd7f02c81c62be8a686268689bb
|
98ec42398374ef91666550255e4958be69820cae
|
/emilib/al_lib.hpp
|
c3a473702bf7b719c28c23f7fe0ba26c12b5b053
|
[
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-public-domain"
] |
permissive
|
Zabrane/emilib
|
fde23b7e00f345db7c8a9b4e5b390f686885eff6
|
0d90f4c0cd44813f6898b417bf3f4ef574a5b136
|
refs/heads/master
| 2022-04-23T10:52:29.257760
| 2020-04-23T10:13:57
| 2020-04-23T10:13:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,817
|
hpp
|
al_lib.hpp
|
// By Emil Ernerfeldt 2002-2018
// LICENSE:
// This software is dual-licensed to the public domain and under the following
// license: you are granted a perpetual, irrevocable license to copy, modify,
// publish, and distribute this file as you see fit.
// Wrapper around OpenAL, a library for playing sounds.
// HISTORY: Originally from around 2002.
// 2018: Refactor Sound and rename it as Buffer.
#pragma once
#include <string>
#include <unordered_map>
#include <vector>
#include "al_lib_fwd.hpp"
using ALCdevice = struct ALCdevice_struct;
using ALCcontext = struct ALCcontext_struct;
namespace al {
// ----------------------------------------------------------------------------
struct Vec3f
{
float _data[3];
Vec3f() {}
Vec3f(float x, float y, float z) : _data{x, y, z} {}
float* data() { return _data; }
const float* data() const { return _data; }
#ifdef AL_LIB_VEC3f_EXTRAS
AL_LIB_VEC3f_EXTRAS // Use this to define implicit conversions to/from your own types.
#endif
};
void check_for_al_error();
// ----------------------------------------------------------------------------
/// A loaded sound. Can be played via Source. Many Source:s can play the same Buffer at the same.
class Buffer
{
public:
static Buffer make_wav(const std::string& path);
/// Create and empty Buffer
explicit Buffer(const std::string& debug_name);
/// Fill Buffer with the contents of the given wav file.
void load_wav(const std::string& path);
void load_mono_float(float sample_rate, const float* samples, size_t num_samples);
void load_mono_int16(float sample_rate, const int16_t* samples, size_t num_samples);
Buffer(Buffer&& o) noexcept : _debug_name(o._debug_name), _buffer_id(o._buffer_id), _size_bytes(o._size_bytes) { o._buffer_id = 0; o._size_bytes = 0; }
~Buffer();
/// Memory usage.
unsigned size_bytes() const { return _size_bytes; }
int get_freqency() const;
int get_bits() const;
int get_channels() const;
int get_size() const;
private:
friend class Source;
Buffer(const Buffer&) = delete;
Buffer& operator=(const Buffer&) = delete;
std::string _debug_name;
unsigned _buffer_id = 0;
unsigned _size_bytes = 0;
};
// ----------------------------------------------------------------------------
/// A sound source. Has position, and a sound to play.
class Source
{
public:
enum State
{
INITIAL,
PLAYING,
PAUSED,
STOPPED,
};
/// Returns the maximum number of sources possible to have instantiated at the same time
static int max_sources();
Source();
~Source();
void set_state(State arg);
State state() const;
void play();
void pause();
void stop();
void rewind();
void set_buffer(Buffer_SP buffer);
const Buffer_SP& buffer() const;
/// Volume, [0,1]. >1 MAY work.
void set_gain(float gain);
float gain() const;
/// sets pitch (clamped to [0,2]), does affect speed
void set_pitch(float pitch);
/// get current pitch
float pitch() const;
void set_pos(Vec3f);
Vec3f pos() const;
void set_vel(Vec3f);
Vec3f vel() const;
void set_direction(Vec3f);
Vec3f direction() const;
/**
* Indicate distance above which sources are not
* attenuated using the inverse clamped distance model.
* Default: +inf
*/
void set_max_distance(float arg);
float max_distance() const;
/// Controls how fast the sound falls off with distance
void set_rolloff_factor(float arg);
float rolloff_factor() const;
/**
* source specific reference distance
* At 0.0, no distance attenuation occurs.
* Default is 1.0.
*/
void set_reference_distance(float arg);
float reference_distance() const;
void set_min_gain(float arg);
float min_gain() const;
void set_max_gain(float arg);
float max_gain() const;
void set_cone_outer_gain(float arg);
float cone_outer_gain() const;
void set_cone_inner_angle(float arg);
float cone_inner_angle() const;
void set_cone_outer_angle(float arg);
float cone_outer_angle() const;
/// is the position relative to the listener? false by default
void set_relative_to_listener(bool arg);
bool relative_to_listener() const;
void set_looping(bool);
bool looping() const;
private:
Source(const Source&) = delete;
Source& operator=(const Source&) = delete;
unsigned _source;
Buffer_SP _buffer;
float _gain = 1;
};
// ----------------------------------------------------------------------------
/// All Listeners are really the same.
/// TODO: static interface.
class Listener
{
public:
void set_pos(Vec3f);
Vec3f pos() const;
void set_vel(Vec3f);
Vec3f vel() const;
void set_orientation(const Vec3f& forward, const Vec3f& up);
Vec3f direction() const;
Vec3f up() const;
void set_gain(float);
float gain() const;
};
// ----------------------------------------------------------------------------
/// You should have only one of these.
class SoundMngr
{
public:
/// Look for sounds relative to sfx_dir
explicit SoundMngr(const std::string& sfx_dir);
~SoundMngr();
//------------------------------------------------------------------------------
/// sound_name == "subdir/foo.wav"
void prefetch(const std::string& sound_name);
/// Recursively prefetch all sounds in sfx_dir/sub_folder
void prefetch_all(const std::string& sub_folder = "");
/// Fire and forget - or keep the returned source and modify it.
/// Returns nullptr on fail
Source_SP play(const std::string& sound_name);
//------------------------------------------------------------------------------
// Global settings
bool is_working() const;
Listener* listener() { return &_listener; }
enum DistanceModel
{
NONE,
INVERSE_DISTANCE,
INVERSE_DISTANCE_CLAMPED,
};
/// set speed of sound. 344 by default (speed of sound in air in meters/second)
void set_doppler_vel(float vel);
/// get speed of sound. 344 by default (speed of sound in air in meters/second)
float doppler_vel();
/// default is 1, used to (de)exaggerate the effect of the Doppler effect
void set_doppler_factor(float factor);
/// default is 1, used to (de)exaggerate the effect of the Doppler effect
float doppler_factor();
/// default is INVERSE_DISTANCE
void set_distance_model(DistanceModel model);
/// default is INVERSE_DISTANCE
DistanceModel distance_model();
const char* vendor();
const char* version();
const char* renderer();
const char* extensions();
//------------------------------------------------------------------------------
void print_memory_usage() const;
private:
Buffer_SP load_buffer(const std::string& sound_name, bool is_hot);
Source_SP get_source();
using BufferMap = std::unordered_map<std::string, Buffer_SP>;
using SourceList = std::vector<Source_SP>;
std::string _sfx_dir;
ALCdevice* _device = nullptr;
ALCcontext* _context = nullptr;
Listener _listener;
BufferMap _buffer_map;
SourceList _sources;
};
} // namespace al
|
1faf77b52f7a92a4b7563cb217c39ed4a2cee5c9
|
4bcbe082e60c6e2ea8d3653bc05e6c9119fa2663
|
/balld/CElapsedTimer.h
|
241f43067de1ec75a2b46d2cf7a071fad5894c7a
|
[] |
no_license
|
snowcicada/collect-ball
|
cb9e760bc78a3da9311b811d200bad174bfc15f7
|
4b68ae82dfe93a3cff7dbc5f9f05d4590e6abe9d
|
refs/heads/master
| 2020-12-03T09:22:42.289366
| 2017-06-28T02:20:01
| 2017-06-28T02:20:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 216
|
h
|
CElapsedTimer.h
|
#pragma once
#include <stdhdr.h>
class CElapsedTimer
{
public:
CElapsedTimer();
~CElapsedTimer();
time_t ElapsedSecs();
void Start();
private:
time_t m_iStartTime;
bool m_bStart;
};
|
2b2dc421d2b62d3c1211b276d0deff1c1d1c17d0
|
0097cf26bfaae8855d9910d0cd662ff16b50aa53
|
/src/physics/AbstractForceGenerator.hpp
|
63e5e365fbf52714bae943d4b13bde2e6b32ca15
|
[
"Zlib"
] |
permissive
|
benzap/Kampf
|
a5e5f5152685d55d76e355550d79ebaa6d655425
|
9cf4fb0d6ec22bc35ade9b476d29df34902c6689
|
refs/heads/master
| 2021-01-17T16:55:35.956298
| 2016-07-21T22:17:48
| 2016-07-21T22:17:48
| 1,658,628
| 3
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,316
|
hpp
|
AbstractForceGenerator.hpp
|
#ifndef ABSTRACTFORCEGENERATOR__HPP
#define ABSTRACTFORCEGENERATOR__HPP
//DESCRIPTION
/*
Includes an abstract for force generators within the physics system.
Force generators are containers which assign certain forces to
registered physics components.
*/
//CLASSES
class AbstractForceGenerator;
//INCLUDES
#include <vector>
#include <algorithm>
#if defined(KF_WIN)
#include "../KF_globals.hpp"
#include "../KF_utilities.hpp"
#include "../KF_math.hpp"
#include "../CollisionComponent.hpp"
#else
#include "KF_globals.hpp"
#include "KF_utilities.hpp"
#include "KF_math.hpp"
#include "CollisionComponent.hpp"
#endif
//DEFINITIONS
//MACROS
//TYPEDEFS
typedef std::vector<CollisionComponent*> generatorContainerType;
//FUNCTIONS
//BEGIN
class AbstractForceGenerator {
private:
stringType generatorName;
generatorContainerType componentList;
public:
AbstractForceGenerator(stringType generatorName);
virtual ~AbstractForceGenerator() {};
stringType getName();
void registerComponent(CollisionComponent*);
void unregisterComponent(CollisionComponent*);
boolType hasRegisteredComponent(CollisionComponent*);
const generatorContainerType& getRegisteredComponents();
virtual void update(floatType timeDelta_ms) {}
};
#endif //END ABSTRACTFORCEGENERATOR__HPP
|
730eb55d5eb67019ab2c9ff1e02301e7674eeced
|
341b20dba0b178f4679c882f68edc47f4a8cabc7
|
/classes/BlastEffect.h
|
fb7f62b05110781457ccbcb608008262b2edd0eb
|
[] |
no_license
|
SergeyRad/XanthicStars
|
2b0667792020c1a7fcf2fc459581cfd85973eb03
|
0f94fb4199db4379aa5db519326e167cc81671fb
|
refs/heads/master
| 2020-12-31T05:24:12.553600
| 2016-05-03T17:32:59
| 2016-05-03T17:32:59
| 57,985,230
| 0
| 1
| null | 2016-05-03T17:57:47
| 2016-05-03T16:46:02
|
C++
|
UTF-8
|
C++
| false
| false
| 222
|
h
|
BlastEffect.h
|
#pragma once
#include "tilemovi.h"
class BlastEffect :
public Tilemovi
{
public:
BlastEffect(void);
~BlastEffect(void);
void data(void);
bool behavior(float time);
void drawBlastEffect(sf::RenderWindow* window);
};
|
227e7bc69472bd54d49d725d2faaf5d00a5e2d79
|
11dcfef0769506062ae9658bbbcfef68dbe79e8d
|
/src/Modele/include/StrategieNeutre.hpp
|
0ff7388d1cddbdc6e5163e7d60e730b47abe6fbe
|
[] |
no_license
|
Soulei/GrenouilleCpp
|
232994e27a015a5f7649eaeba50a2b41c04b9b04
|
88ed68ae340a5e4db04ad4d13e354de5333befe6
|
refs/heads/master
| 2021-01-18T01:49:00.768305
| 2016-11-14T23:01:54
| 2016-11-14T23:01:54
| 68,293,659
| 0
| 2
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,520
|
hpp
|
StrategieNeutre.hpp
|
#ifndef StrategieNeutre_hpp
#define StrategieNeutre_hpp
#include "StrategieAbstraite.hpp"
namespace grenouilloland {
/**
* @class StrategieNeutre StrategieNeutre.hpp
* @brief StrategieNeutre du Jeu Grenouilloland.
*
* Declaration de la classe StrategieNeutre réprésentant la stratégie neutre d'un nénuphar du jeu Grenouilloland.
*/
class StrategieNeutre : public StrategieAbstraite
{
public :
/**
* Application des effets de la stratégie.
*
* @param[in,out] pv - pv à modifier.
* @param[in,out] malade - état de santé à modifier.
*/
void appliquerEffet(unsigned int& pv, bool& malade) const;
private :
/**
* Constructeur par défaut d'une stratégie neutre.
*/
StrategieNeutre();
/**
* Constructeur par recopie d'une stratégie neutre.
*
* @note Celui-ci a été rendu inaccessible et n'est pas utilisé mais sa suppression entraînait une erreur.
*/
StrategieNeutre(const StrategieNeutre&);
public :
/**
* @class Deleguation
* @brief Deleguation de StrategieNeutre du Jeu Grenouilloland.
*
* Declaration de la classe Deleguation de la classe StrategieNeutre communiquant avec la classe GestStrat<StrategieNeutre>.
*/
class Deleguation {
public :
friend class GestStrat<StrategieNeutre>;
/**
* Retourne une instance de StrategieNeutre.
*
* @return instance de StrategieNeutre.
*/
private :
static StrategieNeutre Strategie()
{
return StrategieNeutre();
}
};
};
}
#endif
|
2888df50e6e7986bd78a78b5fdcd7cad244427b2
|
293902682d7ee13be81ada6c28ef6b840983ac33
|
/CORAL_SERVER/CoralSockets/src/ThreadManager.cpp
|
807a6b99c1a845ded675410b518a597be9a94f79
|
[] |
no_license
|
cms-externals/coral
|
d17cba45fff7f34d7a1ba13ab3bb371e0696c1af
|
a879b41c994fa956ff0ae78e3410bb409582ad20
|
refs/heads/cms/CORAL_2_3_21py3
| 2022-02-26T18:51:25.258362
| 2022-02-23T13:19:11
| 2022-02-23T13:19:11
| 91,173,895
| 0
| 4
| null | 2022-02-14T13:20:11
| 2017-05-13T12:47:54
|
C++
|
UTF-8
|
C++
| false
| false
| 6,593
|
cpp
|
ThreadManager.cpp
|
// $Id: ThreadManager.cpp,v 1.9.2.3 2010/12/20 14:04:40 avalassi Exp $
#include "CoralServerBase/InternalErrorException.h"
#include "CoralBase/boost_thread_headers.h"
#include "ThreadManager.h"
using namespace coral::CoralSockets;
#include <iostream>
#define LOGGER_NAME "CoralSockets::ThreadManager"
#include "logger.h"
#include "StatsTypeThreads.h"
#undef DEBUG
#define DEBUG( out )
//----------------------------------------------------------------------------
ThreadManager::~ThreadManager()
{
DEBUG( "ThreadManager::~ThreadManager called" );
joinAll();
cleanUp();
DEBUG( "ThreadManager::~ThreadManager call finished" );
}
//----------------------------------------------------------------------------
void ThreadManager::addThread( Runnable *runClass )
{
try {
DEBUG( "ThreadManager::addThread("<<runClass<<") called" );
boost::mutex::scoped_lock lock( m_threadsMutex );
if ( m_threads.find( runClass) != m_threads.end() )
throw GenericSocketException("can't add a class twice to a thread"
" manager","ThreadManager::createThread");
ThreadWrapper wrap( this, runClass );
ThreadPtr tmp( new boost::thread( wrap ) );
m_group.add_thread( tmp );
m_threads[ runClass ] = tmp;
m_threadsStatus[ runClass ] = tsStarted;
DEBUG( "ThreadManager::addThread("<<runClass<<") finished" );
}
catch (std::exception &e) {
ERROR("caught exception when creating thread: "<< e.what());
throw;
}
catch (...) {
ERROR( "caught unknown exception while creating thread.");
throw;
}
}
//----------------------------------------------------------------------------
bool ThreadManager::existsThread( Runnable *runClass )
{
DEBUG( "ThreadManager::existsThread("<<runClass<<") called" );
boost::mutex::scoped_lock lock( m_threadsMutex );
bool ret=m_threads.find( runClass) != m_threads.end();
return ret;
}
//----------------------------------------------------------------------------
void ThreadManager::markDoneThread( Runnable *runClass )
{
DEBUG( "ThreadManager::markDoneThread("<< runClass<<") called" );
if (!existsThread( runClass ) )
throw GenericSocketException("runClass doesn't exist!",
"ThreadManager::markDoneThread");
boost::mutex::scoped_lock lock( m_threadsMutex );
m_threadsStatus[ runClass ] = tsDone;
}
//----------------------------------------------------------------------------
void ThreadManager::housekeeping()
{
cleanUp();
}
//----------------------------------------------------------------------------
void ThreadManager::cleanUp( ) {
DEBUG("ThreadManager::cleanUp("<< call_join<<")");
boost::mutex::scoped_lock lock( m_threadsMutex );
std::map<Runnable*, ThreadState >::iterator p;
for(p = m_threadsStatus.begin(); p!=m_threadsStatus.end(); )
{
if ( p->second == tsJoined || p->second == tsDone ) {
// thread is done
DEBUG( "thread "<< p->first <<" is done" );
if ( p->second != tsJoined )
m_threads[ p->first ]->join();
m_group.remove_thread( m_threads[ p->first ] );
delete m_threads[ p->first ];
delete p->first;
m_threads.erase( p->first );
m_threadsStatus.erase( p++ );
}
else
++p;
};
}
//----------------------------------------------------------------------------
void ThreadManager::join( Runnable *runClass )
{
DEBUG( "ThreadManager::join("<<runClass<<") called" );
ThreadPtr thread;
{
boost::mutex::scoped_lock lock( m_threadsMutex );
if (m_threads.find( runClass) != m_threads.end() )
throw GenericSocketException("runClass doesn't exit",
"ThreadManager::join");
thread = m_threads.find( runClass )->second;
};
thread->join();
// theoretical race condition, if housekeeping() is called after join
// has finished and before we can grab the mutex. In that case join
// will be called twice.
boost::mutex::scoped_lock lock( m_threadsMutex );
if (m_threads.find( runClass) != m_threads.end() )
throw GenericSocketException("PANIC! runClass doesn't exit",
"ThreadManager::join");
m_threadsStatus[ runClass ] = tsJoined;
}
//----------------------------------------------------------------------------
void ThreadManager::joinAll() {
DEBUG( "ThreadManager::joinAll() called" );
m_group.join_all();
// there is a theoretical race condition, if someone adds a thread
// right after join_all() finished and it ends before we can grab
// the mutex. In that case it will be marked as joined even if it
// isn't :-(
boost::mutex::scoped_lock lock( m_threadsMutex );
std::map<Runnable*, ThreadState >::iterator p;
for(p = m_threadsStatus.begin(); p!=m_threadsStatus.end(); ++p)
{
if ( p->second == tsDone ) {
// thread is done and joined
DEBUG( "thread "<< p->first <<" is done" );
p->second = tsJoined;
}
};
DEBUG( "ThreadManager::joinAll() finished" );
}
//----------------------------------------------------------------------------
const std::vector<coral::IThreadMonitor::ThreadRecord>
ThreadManager::listThreads() const
{
DEBUG( "ThreadManager:listThreads" );
boost::mutex::scoped_lock lock( m_threadsMutex );
std::vector<ThreadRecord> records;
for ( std::map<Runnable*, ThreadState >::const_iterator
p = m_threadsStatus.begin(); p != m_threadsStatus.end(); ++p )
{
// Add this thread
ThreadRecord record;
record.id = p->first;
record.description = p->first->desc();
switch ( p->second )
{
case tsStarted:
record.state = "STARTED";
break;
case tsDone:
record.state = "DONE";
break;
case tsJoined:
record.state = "JOINED";
break;
case tsDeleted:
record.state = "DELETED";
break;
default:
throw InternalErrorException( "PANIC! Unknown thread state",
"ThreadManager::listThreads()",
"coral::CoralSockets" );
}
records.push_back( record );
// Is this thread itself a thread monitor (eg SocketThread)?
IThreadMonitor* mon = dynamic_cast<IThreadMonitor*>( p->first );
if ( mon )
{
const std::vector<ThreadRecord> records2 = mon->listThreads();
for ( std::vector<ThreadRecord>::const_iterator
rec2 = records2.begin(); rec2 != records2.end(); rec2++ )
records.push_back( *rec2 );
}
}
return records;
}
//----------------------------------------------------------------------------
|
d83c640213e1f6a8dd5f2485870cf0727cfcb0da
|
0d4180498063d0b4a129170b5e885e79ab7de0b9
|
/wxGui/ItkVtkPipeline.h
|
8bd35f3fdef8d9e99ad3048a5fbd7064defd1546
|
[] |
no_license
|
CISMM/ImageTracker
|
dd0038feaca23de0cf4aa17db50e95b170b0ca31
|
ad7efce0443daab8992721785edbb25cf9fe25ff
|
refs/heads/main
| 2023-06-27T10:55:41.556083
| 2021-07-29T13:07:17
| 2021-07-29T13:07:17
| 390,725,337
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,855
|
h
|
ItkVtkPipeline.h
|
#pragma once
#include <vector>
#include <wx/wx.h>
#include "itkDataObject.h"
#include "itkLightObject.h"
#include "vtkProp.h"
#include "vtkPropCollection.h"
#include "vtkRenderer.h"
#include "Logger.h"
/**
* Links an itk data object (image) to a vtk visualization (renderer).
* Specific subclasses handle data transfer and visualization for different
* types of itk objects.
*/
class ItkVtkPipeline :
public itk::LightObject
{
public:
typedef ItkVtkPipeline Self;
typedef itk::LightObject Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef std::vector< vtkProp* > PropCollectionType;
virtual void SetInput(itk::DataObject* input) {}
virtual void Update() {}
/**
* Get the vtkProp collection that this pipeline manages.
*/
PropCollectionType& GetProps();
/**
* Adds the vtkProp objects managed by this pipeline to the given renderer.
*/
void AddPropsTo(vtkRenderer* renderer);
/**
* Removes the vtkProp objects managed by this pipeline from the given renderer.
*/
void RemovePropsFrom(vtkRenderer* renderer);
/**
* Create a wx control panel that can change options on this pipeline. The default
* wx control panel has no configurable options. Subclasses will override this method
* to provide controls that can manage them. The returned wxWindow can be added to a
* panel in a control interface.
*/
virtual wxWindow* CreateWxControl(wxWindow* parent);
// TODO: add visibility, opacity
protected:
ItkVtkPipeline();
virtual ~ItkVtkPipeline();
private:
// Purposefully not implemented
ItkVtkPipeline(const Self& other);
void operator=(const Self& other);
PropCollectionType props;
};
|
364d773f669ae2e16037eb0a6325142e2389b385
|
a3adc35e580f9f8b97469843c478faa45eae0cd3
|
/94.二叉树的中序遍历.cpp
|
524d982fe838d4780cf7a1c1378cd178df8d8936
|
[] |
no_license
|
tbswang/leetcode
|
6378175e37b1982ebeff742873e43dddeeed0ca7
|
d3fc46de8cdebd2abb3eb47fc72be0ea2eede84b
|
refs/heads/master
| 2022-11-04T16:43:00.130285
| 2022-10-24T12:37:06
| 2022-10-24T12:37:06
| 131,710,787
| 1
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,818
|
cpp
|
94.二叉树的中序遍历.cpp
|
/*
* @lc app=leetcode.cn id=94 lang=cpp
*
* [94] 二叉树的中序遍历
*/
#include <stack>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right)
: val(x), left(left), right(right) {}
};
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left),
* right(right) {}
* };
*/
class Solution {
public:
// vector<int> res;
// 递归的办法
// vector<int> inorderTraversal(TreeNode *root) {
// travel(root);
// return res;
// }
// void travel(TreeNode *root) {
// if (root == nullptr)
// return;
// travel(root->left);
// res.push_back(root->val);
// travel(root->right);
// }
// 非递归
// 需要手动维护一个stack
// 先把所有的左子树添加进去,再把根添加进去,在迭代的过程中添加右子树
stack<TreeNode *> stack;
vector<int> res;
vector<int> inorderTraversal(TreeNode *root) {
if (root == nullptr)
return res;
// 插入左侧
while (root != nullptr) {
stack.push(root);
root = root->left;
}
while (!stack.empty()) {
auto top = stack.top();
res.push_back(top->val);
stack.pop();
auto next = top->right;
while (next != nullptr) {
stack.push(next);
next = next->left;
}
}
return res;
}
};
// @lc code=end
|
71a15b9dfa2879cdd398243d6d690f8175270c95
|
e56517bae3da931689281154901b94ac6eaa7329
|
/model_render.h
|
9387002354c192ba553d7b52fab236235bcaeef8
|
[] |
no_license
|
xsoma/necrozma
|
8a60a6f9f96f800f4918b606bd6fe0dd66bb1d39
|
0f0df3902c00e85b4bbf4e051825cda041b27045
|
refs/heads/master
| 2023-04-10T17:30:04.684490
| 2021-04-22T18:38:04
| 2021-04-22T18:38:04
| 360,646,556
| 6
| 3
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,740
|
h
|
model_render.h
|
#include "DLL_MAIN.h"
typedef unsigned short ModelInstanceHandle_t;
struct ModelRenderInfo_t
{
Vector origin;
Vector angles;
char pad[0x4];
IClientRenderable* pRenderable;
const model_t* pModel;
matrix* pModelToWorld;
const matrix* pLightingOffset;
const Vector* pLightingOrigin;
int flags;
int entity_index;
int skin;
int body;
int hitboxset;
ModelInstanceHandle_t instance;
};
class c_bones {
public:
c_bones(matrix* b, float time, float alpha) {
memcpy(bones, b, sizeof(matrix[128]));
this->time = time;
this->alpha = alpha;
}
matrix bones[128];
float time, alpha;
};
struct MatrixRecorded {
void* ctx;
void* state;
ModelRenderInfo_t info;
std::vector<c_bones> _info;
};
struct RenderableInfo_t {
IClientRenderable* m_pRenderable;
void* m_pAlphaProperty;
int m_EnumCount;
int m_nRenderFrame;
unsigned short m_FirstShadow;
unsigned short m_LeafList;
short m_Area;
uint16_t m_Flags; // 0x0016
uint16_t m_Flags2; // 0x0018
Vector m_vecBloatedAbsMins;
Vector m_vecBloatedAbsMaxs;
Vector m_vecAbsMins;
Vector m_vecAbsMaxs;
int pad;
};
struct ColorMeshInfo_t;
struct LightDesc_t
{
int type;
Vector vecColor;
Vector vecPosition;
Vector vecDirection;
float flRange;
float flFalloff;
float flAttenuation0;
float flAttenuation1;
float flAttenuation2;
float flTheta;
float flPhi;
float flThetaDot;
float flPhiDot;
float flOneOverThetaDotMinusPhiDot;
std::uint32_t fFlags;
protected:
float flRangeSquared;
};
struct MaterialLightingState_t
{
Vector vecAmbientCube[6];
Vector vecLightingOrigin;
int nLocalLightCount;
LightDesc_t localLightDesc[4];
};
typedef void* StudioDecalHandle_t;
struct studiohwdata_t;
struct StaticPropRenderInfo_t
{
const matrix* pModelToWorld;
const model_t* pModel;
IClientRenderable* pRenderable;
Vector* pLightingOrigin;
short skin;
ModelInstanceHandle_t instance;
};
typedef void* LightCacheHandle_t;
typedef int OverrideType_t;
struct DrawModelInfo_t
{
studiohdr_t* pStudioHdr;
studiohwdata_t* pHardwareData;
StudioDecalHandle_t hDecals;
int iSkin;
int iBody;
int iHitboxSet;
IClientRenderable* pClientEntity;
int iLOD;
ColorMeshInfo_t* pColorMeshes;
bool bStaticLighting;
MaterialLightingState_t LightingState;
};
struct LightingQuery_t
{
Vector LightingOrigin;
ModelInstanceHandle_t InstanceHandle;
bool bAmbientBoost;
};
struct StaticLightingQuery_t : public LightingQuery_t
{
IClientRenderable* pRenderable;
};
class ITexture;
class DataCacheHandle_t;
class IMatRenderContext;
struct color_tMeshInfo_t;
class IVModelRender
{
public:
virtual int DrawModel(int flags, IClientRenderable* pRenderable, ModelInstanceHandle_t instance, int entity_index, const model_t* model, Vector const& origin, Vector const& angles, int skin, int body, int hitboxset, const matrix* modelToWorld = NULL, const matrix* pLightingOffset = NULL) = 0;
virtual void ForcedMaterialOverride(IMaterial* newMaterial, int nOverrideType = 0, int nOverrides = 0) = 0;
virtual bool IsForcedMaterialOverride(void) = 0; // hey hey!!!!! this is used to fix glow being retarded in DrawModel / DrawModelExecute. I bet you didn't know that! ~alpha
virtual void SetViewTarget(const studiohdr_t* pStudioHdr, int nBodyIndex, const Vector& target) = 0;
virtual ModelInstanceHandle_t CreateInstance(IClientRenderable* pRenderable, LightCacheHandle_t* pCache = NULL) = 0;
virtual void DestroyInstance(ModelInstanceHandle_t handle) = 0;
virtual void SetStaticLighting(ModelInstanceHandle_t handle, LightCacheHandle_t* pHandle) = 0;
virtual LightCacheHandle_t GetStaticLighting(ModelInstanceHandle_t handle) = 0;
virtual bool ChangeInstance(ModelInstanceHandle_t handle, IClientRenderable* pRenderable) = 0;
virtual void AddDecal(ModelInstanceHandle_t handle, Ray_t const& ray, Vector const& decalUp, int decalIndex, int body, bool noPokeThru, int maxLODToDecal) = 0;
virtual void RemoveAllDecals(ModelInstanceHandle_t handle) = 0;
virtual bool ModelHasDecals(ModelInstanceHandle_t handle) = 0;
virtual void RemoveAllDecalsFromAllModels() = 0;
virtual matrix* DrawModelShadowSetup(IClientRenderable* pRenderable, int body, int skin, ModelRenderInfo_t* pInfo, matrix* pCustomBoneToWorld = NULL) = 0;
virtual void DrawModelShadow(IClientRenderable* pRenderable, const ModelRenderInfo_t& info, matrix* pCustomBoneToWorld = NULL) = 0;
virtual bool RecomputeStaticLighting(ModelInstanceHandle_t handle) = 0;
virtual void ReleaseAllStaticPropcolor_tData(void) = 0;
virtual void RestoreAllStaticPropcolor_tData(void) = 0;
virtual int DrawModelEx(ModelRenderInfo_t& pInfo) = 0;
virtual int DrawModelExStaticProp(ModelRenderInfo_t& pInfo) = 0;
virtual bool DrawModelSetup(ModelRenderInfo_t& pInfo, DrawModelInfo_t* pState, matrix** ppBoneToWorldOut) = 0;
virtual void DrawModelExecute(IMatRenderContext* ctx, const DrawModelInfo_t& state, const ModelRenderInfo_t& pInfo, matrix* pCustomBoneToWorld = NULL) = 0;
virtual void SetupLighting(const Vector& vecCenter) = 0;
virtual int DrawStaticPropArrayFast(StaticPropRenderInfo_t* pProps, int count, bool bShadowDepth) = 0;
virtual void SuppressEngineLighting(bool bSuppress) = 0;
virtual void Setupcolor_tMeshes(int nTotalVerts) = 0;
virtual void SetupLightingEx(const Vector& vecCenter, ModelInstanceHandle_t handle) = 0;
virtual bool GetBrightestShadowingLightSource(const Vector& vecCenter, Vector& lightPos, Vector& lightBrightness, bool bAllowNonTaggedLights) = 0;
virtual void ComputeLightingState(int nCount, const LightingQuery_t* pQuery, MaterialLightingState_t* pState, ITexture** ppEnvCubemapTexture) = 0;
virtual void GetModelDecalHandles(StudioDecalHandle_t* pDecals, int nDecalStride, int nCount, const ModelInstanceHandle_t* pHandles) = 0;
virtual void ComputeStaticLightingState(int nCount, const StaticLightingQuery_t* pQuery, MaterialLightingState_t* pState, MaterialLightingState_t* pDecalState, color_tMeshInfo_t** ppStaticLighting, ITexture** ppEnvCubemapTexture, DataCacheHandle_t* pcolor_tMeshHandles) = 0;
virtual void CleanupStaticLightingState(int nCount, DataCacheHandle_t* pcolor_tMeshHandles) = 0;
};
|
fd231d11a584bf72f15a1abb7771f234ac68d86a
|
e52762a18d34707470cf6af2356a6bf0db6726c4
|
/Online19/discshop.cpp
|
0f7c1325c3d160c0db2cccbf798be3fbc8dae9ae
|
[] |
no_license
|
geckods/ICPC
|
0f8296c877d9af2410b45607353047df70afd5b7
|
9861386a98b2c968cddc53cc351fbf89f05fbc65
|
refs/heads/master
| 2021-04-19T14:20:51.531833
| 2020-03-24T04:24:46
| 2020-03-24T04:24:46
| 249,612,161
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 785
|
cpp
|
discshop.cpp
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
#ifndef ONLINE_JUDGE
freopen("input", "r", stdin);
freopen("output", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin>>t;
for(int test=0;test<t;test++){
ll n;
cin>>n;
ll ans=LLONG_MAX;
ll i=0;
ll a,b;
string ns=to_string(n);
int size=ns.size();
string as,bs;
// cerr<<size<<" "<<ns<<endl;
while(i<size){
// cerr<<size<<" "<<i<<endl;
if(i<size-1)
as=ns.substr(0,size-i-1);
else
as="";
if(i>0)
bs=ns.substr(size-i,i);
else
bs="";
as.append(bs);
// cerr<<size<<" "<<i<<" "<<"as:"<<" "<<as<<" bs:"<<bs<<endl;
ans=min(ans,stoll(as));
i++;
//remove ith
}
cout<<ans<<endl;
}
}
|
690c93157768312bbe8616bb3cb346cfb5c5bde3
|
cd2eb0fa3f751739e2eefccf8a1899e6f3b46f51
|
/src/multiplication_field.hpp
|
0d8070d6d7c47b0cfdb913761dbc4e4ddc6ba0f6
|
[] |
no_license
|
takah29/arm-assembler
|
42aa885993ea188b3000e041319ad7807691595c
|
bc248561514390b2d4df19b6508b170a102c7897
|
refs/heads/main
| 2023-04-13T19:59:21.367230
| 2021-02-10T16:22:52
| 2021-02-10T16:22:52
| 316,786,442
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 979
|
hpp
|
multiplication_field.hpp
|
#ifndef _MULTIPLICATION_FIELD_H
#define _MULTIPLICATION_FIELD_H
#include <string>
#include <vector>
#include "field.hpp"
#include "types.hpp"
class MultiplicationField : public Field {
uint32_t cond; // 4bit
uint32_t op; // 2bit
uint32_t funct; // 6bit
uint32_t rd; // 4bit
uint32_t ra; // 4bit
uint32_t rm; // 4bit
const uint32_t c = 0b1001; // 4bit
uint32_t rn; // 4bit
uint32_t get_sflag_1bit(const std::string opcode) const;
uint32_t get_cmd_3bit(const std::string opcode) const;
uint32_t get_funct_6bit(const std::string opcode) const;
public:
MultiplicationField(OpcodeInfo *opcode_info_ptr);
~MultiplicationField();
void input(std::vector<std::string> asmcode_v, int current_line_num=-1) override;
uint32_t output() override;
void clear_field() override;
void show_field() override;
};
#endif
|
820fda1c79ce7984ddc3c844c5dff1c6aa9a4dde
|
9e8b380f7d73ae1f93c88bfbc0a744498109f8fc
|
/src/File/OBJReader.h
|
84c568daedc9b5b1c698cbcadb11af4f8f4e952f
|
[] |
no_license
|
fredrb/OBJReader
|
429f2b4ace65ac68fd26d7ab7ddec7b8b2fb339a
|
bf3e98f94561a3de11eeb1c028ee81eb519bad35
|
refs/heads/master
| 2021-08-28T19:33:11.351125
| 2017-12-13T02:55:43
| 2017-12-13T02:55:43
| 105,011,791
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,090
|
h
|
OBJReader.h
|
#ifndef OBJ_READER_H
#define OBJ_READER_H
#include <iostream>
#include <vector>
#include "MTLReader.h"
typedef struct {
float x, y, z;
} t_vector;
typedef struct {
float x, y, z;
} t_vector_normal;
typedef struct {
unsigned int point_index;
unsigned int normal_index;
unsigned int texture_index;
} t_face;
typedef struct {
float x, y;
} t_texture;
typedef struct {
std::vector<t_vector> vertices;
std::vector<t_vector_normal> normals;
std::vector<t_face> faces;
std::vector<t_texture> texture;
t_mtl_data mtl;
bool has_texture;
} t_obj_data;
class OBJReader {
private:
std::string path;
void process_comment(const std::string line, t_obj_data &data);
void process_vertex(const std::string line, t_obj_data &data);
void process_face(const std::string line, t_obj_data &data);
void process_natural(const std::string line, t_obj_data &data);
void process_texture(const std::string line, t_obj_data &data);
void process_mtl_file(std::string line, t_obj_data &data);
public:
OBJReader(std::string path) : path(path) {};
t_obj_data get_obj_data();
};
#endif
|
f422a419a3ddfe8f9baca0b83f57796ae6ce7a81
|
4a8388cd5cb9bd7f0ac5799615ece2dad91c8190
|
/signal_test/main.cpp
|
cbc0bd01b9b1ab8cae67479ec9f6e335421c1321
|
[] |
no_license
|
gitgaoqian/C
|
c137989dfa1efc050a037b981deb449f4eae5c34
|
5b9e4b4e1de0030f548be944119f8c9eccb6757a
|
refs/heads/master
| 2023-02-21T06:07:50.817670
| 2021-01-24T08:28:50
| 2021-01-24T08:28:50
| 154,327,811
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 891
|
cpp
|
main.cpp
|
//signal的举例函数:使用定时器settimer和getttimer
#include <signal.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/time.h>
int sec;
void sigroutine(int signo) {
switch (signo) {
case SIGALRM:
printf("Catch a signal -- SIGALRM \n");//每一秒输出一次
break;
case SIGVTALRM:
printf("Catch a signal -- SIGVTALRM \n");//每0.5秒输出一次
break;
}
return;
}
int main() {
struct itimerval value,ovalue,value2;
sec = 5;
printf("process id is %d ",getpid());
signal(SIGALRM, sigroutine);
signal(SIGVTALRM, sigroutine);
value.it_value.tv_sec = 1;
value.it_value.tv_usec = 0;
value.it_interval.tv_sec = 1;
value.it_interval.tv_usec = 0;
setitimer(ITIMER_REAL, &value, &ovalue);
value2.it_value.tv_sec = 0;
value2.it_value.tv_usec = 500000;
value2.it_interval.tv_sec = 0;
value2.it_interval.tv_usec = 500000;
setitimer(ITIMER_VIRTUAL, &value2, &ovalue);
for (;;) ;
}
|
08017b42ea4b3c60b2df58a05b638f0dca000e68
|
00e4707809ee0c26f6139cf7497b40b2c874ff5e
|
/class/io/Sof/sof_02.cc
|
c4a4e6b89d51a6d8f6be9423a8529699a9c0189d
|
[] |
no_license
|
5l1v3r1/hdphmm_lib
|
01dee591de8c48b644992723ba95f7c348ab016a
|
6e5e0af9b01f258fc91014af028d02de2eb1fb96
|
refs/heads/master
| 2021-08-31T16:56:59.228160
| 2017-12-22T04:34:41
| 2017-12-22T04:34:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 21,691
|
cc
|
sof_02.cc
|
// file: $isip/class/io/Sof/sof_02.cc
// version: $Id: sof_02.cc 8121 2002-04-17 20:22:34Z huang $
//
// isip include files
//
#include "Sof.h"
#include <Console.h>
// method: diagnose
//
// arguments:
// Integral::DEBUG level: (input) debug level for diagnostics
//
// return: a bool8 value indicating status
//
bool8 Sof::diagnose(Integral::DEBUG level_a) {
//---------------------------------------------------------------------------
//
// 0. preliminaries
//
//---------------------------------------------------------------------------
// output the class name
//
if (level_a > Integral::NONE) {
SysString output(L"diagnosing class ");
output.concat(CLASS_NAME);
output.concat(L": ");
Console::put(output);
Console::increaseIndention();
}
//--------------------------------------------------------------------------
//
// 1. required public methods
//
//--------------------------------------------------------------------------
// set indentation
//
if (level_a > Integral::NONE) {
Console::put(L"testing required public methods...\n");
Console::increaseIndention();
}
// test constructor
//
Sof sof_0;
// test debug methods
//
sof_0.setDebug(Integral::BRIEF);
if (level_a > Integral::BRIEF) {
sof_0.debug(L"debug");
}
// open a file in write mode
//
SysString file0;
Integral::makeTemp(file0);
File::registerTemp(file0);
if (!sof_0.open(file0, File::WRITE_ONLY, File::BINARY)) {
return Error::handle(name(), L"open", Error::TEST, __FILE__, __LINE__);
}
// test clear methods, note clear is only used for writable Sof
//
sof_0.clear();
if (sof_0.getNameCount() != 0) {
return Error::handle(name(), L"clear", Error::TEST, __FILE__, __LINE__);
}
// close file
//
sof_0.close();
File::remove(file0);
// reset indentation
//
if (level_a > Integral::NONE) {
Console::decreaseIndention();
}
//--------------------------------------------------------------------------
//
// 2. class-specific public methods:
// extensions to required public methods
//
//--------------------------------------------------------------------------
// set indentation
//
if (level_a > Integral::NONE) {
Console::put(L"testing class-specific public methods: extensions to required methods...\n");
Console::increaseIndention();
}
// get the memsize
//
int32 mem_size = sof_0.memSize();
if (level_a > Integral::BRIEF) {
SysString numeric;
numeric.assign(mem_size);
SysString output(L"memSize of sof_0: ");
output.concat(numeric);
Console::put(output);
}
// reset indentation
//
if (level_a > Integral::NONE) {
Console::decreaseIndention();
}
//--------------------------------------------------------------------------
//
// 3. class-specific public methods:
// file operation methods
//
//--------------------------------------------------------------------------
// set indentation
//
if (level_a > Integral::NONE) {
Console::put(L"testing class-specific public methods: file operation methods...\n");
Console::increaseIndention();
}
Sof sof0;
Sof sof1;
Sof sof2;
Sof sof3;
// create some temporary filenames
//
SysString file1;
SysString file2;
SysString file3;
SysString long_cname(L"Int32");
SysString short_cname(L"Int16");
SysString string_cname(L"String");
Integral::makeTemp(file0);
File::registerTemp(file0);
// test a bin file
Integral::makeTemp(file1);
File::registerTemp(file1);
// test a ascii file
Integral::makeTemp(file2);
File::registerTemp(file2);
Integral::makeTemp(file3);
File::registerTemp(file3);
// open files for write (text & binary)
//
if (!sof0.open(file0, File::WRITE_ONLY)) {
return Error::handle(name(), L"open", Error::TEST, __FILE__, __LINE__);
}
if (!sof1.open(file1, File::WRITE_ONLY, File::BINARY)) {
return Error::handle(name(), L"open", Error::TEST, __FILE__, __LINE__);
}
if (sof0.getName().ne(file0)) {
return Error::handle(name(), L"getName", Error::TEST, __FILE__, __LINE__);
}
if (sof0.getExpandedName().ne(file0)) {
return Error::handle(name(), L"getExpandedName", Error::TEST, __FILE__,
__LINE__);
}
// add a int32 entry to the files
//
int32 j = 27;
sof0.put(long_cname, Sof::ANY_SIZE);
sof1.put(long_cname, 0, sizeof(int32));
// write the text value
//
sof0.increaseIndention();
sof0.setLineWrap(100);
sof0.decreaseIndention();
SysString output;
output.assign((int32)j);
output.insert(L"value = ", 0);
output.concat(L"\n");
sof0.puts(output);
// write the binary value
//
sof1.write(&j, sizeof(j), 1);
// add another int32 entry to the files
//
j = 277;
sof0.put(long_cname, Sof::ANY_SIZE);
sof1.put(long_cname, 1, sizeof(int32));
// write the text value
//
output.assign((int32)j);
output.insert(L"value = ", 0);
output.concat(L"\n");
sof0.puts(output);
// write the binary value
//
sof1.write(&j, sizeof(j), 1);
// print out debug information
//
if (level_a > Integral::DETAILED) {
sof1.setDebug(Integral::NONE);
sof1.debug(L"sof1");
}
// test set and get methods
//
sof0.setLockRetry((int32)1);
sof0.setDelimiter(DEF_DELIMITER);
if (sof0.getDelimiter() != DEF_DELIMITER) {
return Error::handle(name(), L"set/getDelimiter", Error::TEST, __FILE__,
__LINE__);
}
// test file queries
//
if (!sof0.isSof() || !isSof(file0)) {
return Error::handle(name(), L"isSof", Error::TEST, __FILE__, __LINE__);
}
if (!sof0.isText() || !sof1.isBinary()) {
return Error::handle(name(), L"isText / isBinary", Error::TEST, __FILE__,
__LINE__);
}
if (!sof0.isOpen() || !sof1.isOpen()) {
return Error::handle(name(), L"isOpen", Error::TEST, __FILE__, __LINE__);
}
if (sof0.isSameFile(sof1)) {
return Error::handle(name(), L"isSameFile", Error::TEST, __FILE__,
__LINE__);
}
// test clear the file
//
sof1.clear();
if (sof1.getNameCount() != 0) {
return Error::handle(name(), L"clear", Error::TEST, __FILE__, __LINE__);
}
// close the files
//
sof0.close();
sof1.close();
if (sof0.isOpen() || sof1.isOpen()) {
return Error::handle(name(), L"isOpen", Error::TEST, __FILE__, __LINE__);
}
// reset indentation
//
if (level_a > Integral::NONE) {
Console::decreaseIndention();
}
//--------------------------------------------------------------------------
//
// 4. class-specific public methods:
// object operation methods
//
//--------------------------------------------------------------------------
// set indentation
//
if (level_a > Integral::NONE) {
Console::put(L"testing class-specific public methods: object operation methods...\n");
Console::increaseIndention();
}
// open files again in read plus
//
if (!sof2.open(file0, File::READ_PLUS)) {
return Error::handle(name(), L"diagnose", Error::ARG, __FILE__, __LINE__);
}
if (!sof3.open(file1, File::READ_PLUS, File::BINARY)) {
return Error::handle(name(), L"diagnose", Error::ARG, __FILE__, __LINE__);
}
// read all the text values
//
int32 tag;
for (tag = sof2.first(long_cname); tag != Sof::NO_TAG;
tag = sof2.next(long_cname, tag)) {
// find the node
//
sof2.find(long_cname, tag);
SysString input;
// this gets should work
//
if (!sof2.gets(input)) {
return Error::handle(name(), L"gets", Error::TEST, __FILE__, __LINE__);
}
if (input.firstStr(L"value = ") != 0) {
return Error::handle(name(), L"gets", Error::TEST, __FILE__, __LINE__);
}
SysString numeric;
input.substr(numeric, 8);
if (!numeric.get(j)) {
return Error::handle(name(), L"gets", Error::TEST, __FILE__, __LINE__);
}
// we have read all the data on the line, so this gets should fail
//
if (sof2.gets(input)) {
return Error::handle(name(), L"gets", Error::TEST, __FILE__, __LINE__);
}
if (level_a > Integral::BRIEF) {
output.assign((int32)j);
output.insert(L"reading from text: ", 0);
Console::put(output);
}
}
// read all the binary values
//
for (tag = sof3.last(long_cname); tag != Sof::NO_TAG;
tag = sof3.prev(long_cname, tag)) {
// find the node
//
sof3.find(long_cname, tag);
if (sof3.read(&j, sizeof(j), 1) != 1) {
return Error::handle(name(), L"read", Error::TEST, __FILE__, __LINE__);
}
if (level_a > Integral::BRIEF) {
output.assign((int32)j);
output.insert(L"reading from Binary: ", 0);
Console::put(output);
}
}
int32 NUM_CLASSES = 10;
int32 NUM_TAGS = 3;
// sof3.setDebug(Integral::DETAILED);
// sof0.setDebug(Integral::DETAILED);
// add a whole bunch of names to the binary file
//
for (int32 i = 0; i < NUM_CLASSES; i++) {
// create a name
//
SysString cname;
cname.assign((int32)i);
cname.insert(L"LongerNamedEntity", 0);
// add multiple nodes
//
for (int32 j = 0; j < NUM_TAGS; j++) {
// add the node
//
sof3.put(cname, j, sizeof(int32));
// create and write a value
//
int32 val = i * 10277 + j * 13;
sof3.write(&val, sizeof(val), 1);
}
}
// test copy methods
//
if (level_a > Integral::BRIEF) {
Console::put(L"testing copy (text)");
}
SysString foo_copy;
Integral::makeTemp(foo_copy);
File::registerTemp(foo_copy);
sof1.open(foo_copy, File::WRITE_ONLY, File::TEXT);
tag = sof2.first(long_cname);
if (tag != Sof::NO_TAG) {
// copy the first Int32 number from sof2
//
sof1.copy(0, sof2, long_cname, tag);
if (sof1.getCount(long_cname) != 1) {
return Error::handle(name(), L"copy", Error::TEST, __FILE__, __LINE__);
}
// remove this tag
//
sof1.remove(long_cname, 0);
// copy all the Long numbers from sof2
//
sof1.copy(sof2, long_cname);
if (sof1.getCount(long_cname) != sof2.getCount(long_cname)) {
return Error::handle(name(), L"copy", Error::TEST, __FILE__, __LINE__);
}
}
// close the files
//
sof1.close();
sof2.close();
sof3.close();
// open the binary file again
//
sof0.open(file1, File::READ_PLUS, File::BINARY);
int32 count = 0;
// read all the dynamically named nodes
//
for (int32 i = 0; i < NUM_CLASSES; i++) {
// create a name
//
SysString cname;
cname.assign((int32)i);
cname.insert(L"LongerNamedEntity", 0);
// read all the nodes of this name
//
for (tag = sof0.first(cname); tag != Sof::NO_TAG;
tag = sof0.next(cname, tag)) {
// find the node
//
if (!sof0.find(cname, tag)) {
return Error::handle(name(), L"find", Error::TEST, __FILE__, __LINE__);
}
int32 val = i * 10277 + tag * 13;
int32 j;
count++;
if (sof0.read(&j, sizeof(j), 1) != 1) {
return Error::handle(name(), L"read", Error::TEST, __FILE__, __LINE__);
}
if (j != val) {
return Error::handle(name(), L"mismatch", Error::TEST, __FILE__,
__LINE__);
}
}
}
// check count
//
if (count != NUM_CLASSES * NUM_TAGS) {
return Error::handle(name(), L"not enough", Error::TEST, __FILE__,
__LINE__);
}
// test delete
//
if (level_a > Integral::BRIEF) {
Console::put(L"testing remove (binary)");
}
// go back through, delete every other entry
//
for (int32 i = 0; i < NUM_CLASSES; i += 2) {
// create a name
//
SysString cname;
cname.assign((int32)i);
cname.insert(L"LongerNamedEntity", 0);
if ((i % 4) == 0) {
// read all the nodes of this name
//
for (tag = sof0.first(cname); tag != Sof::NO_TAG;
tag = sof0.next(cname, tag)) {
// remove node
//
if (!sof0.remove(cname, tag)) {
return Error::handle(name(), L"remove1", Error::TEST,
__FILE__, __LINE__);
}
}
}
// delete all instances of this name
//
else if (!sof0.remove(cname)) {
return Error::handle(name(),L"remove2",Error::TEST,__FILE__,__LINE__);
}
if (sof0.getCount(cname) != 0) {
return Error::handle(name(), L"remove", Error::TEST, __FILE__, __LINE__);
}
}
sof0.cleanUp();
if (sof0.getCount() != 0) {
return Error::handle(name(), L"remove", Error::TEST, __FILE__, __LINE__);
}
sof0.close();
// testing read after delete
//
if (level_a > Integral::BRIEF) {
SysString output(L"testing read after delete (binary)");
Console::put(output);
}
// open the file again
//
sof0.open(file1);
count = 0;
// read all the dynamically named nodes
//
for (int32 i = 1; i < NUM_CLASSES; i += 2) {
// create a name
//
SysString cname;
cname.assign((int32)i);
cname.insert(L"LongerNamedEntity", 0);
// read all the nodes of this name
//
for (tag = sof0.first(cname); tag != Sof::NO_TAG;
tag = sof0.next(cname, tag)) {
// find the node
//
if (!sof0.find(cname, tag)) {
return Error::handle(name(), L"find", Error::TEST, __FILE__, __LINE__);
}
int32 val = i * 10277 + tag * 13;
int32 j;
count++;
if (sof0.read(&j, sizeof(j), 1) != 1) {
return Error::handle(name(), L"read", Error::TEST, __FILE__, __LINE__);
}
if (j != val) {
return Error::handle(name(),L"mismatch",Error::TEST,__FILE__,__LINE__);
}
}
}
if (count != NUM_CLASSES * NUM_TAGS / 2) {
return Error::handle(name(),L"not enough 2",Error::TEST,__FILE__,__LINE__);
}
// close the file
//
sof0.close();
// add a whole bunch of names to the text file
//
NUM_CLASSES = 20;
sof2.open(file2, File::WRITE_PLUS);
for (int32 i = 0; i < NUM_CLASSES; i++) {
// create a name
//
SysString cname;
cname.assign((int32)i);
cname.insert(L"LongerNamedEntity", 0);
// add multiple nodes
//
for (int32 j = 0; j < NUM_TAGS; j++) {
// add the node
//
sof2.put(cname, j, ANY_SIZE);
// create and write a value
//
int32 val = i * 10277 + j * 13;
// write the text value
//
output.assign((int32)val);
output.insert(L"value = ", 0);
output.concat(L"\n");
sof2.puts(output);
}
}
// close the files
//
sof2.close();
// reset indentation
//
if (level_a > Integral::NONE) {
Console::decreaseIndention();
}
//--------------------------------------------------------------------------
//
// 5. class-specific public methods:
// input and output methods
//
//--------------------------------------------------------------------------
// set indentation
//
if (level_a > Integral::NONE) {
Console::put(L"testing class-specific public methods: i/o methods...\n");
Console::increaseIndention();
}
// open the text file again
//
sof0.open(file2, File::READ_PLUS);
count = 0;
SysString input;
// read all the dynamically named nodes
//
for (int32 i = 0; i < NUM_CLASSES; i++) {
// create a name
//
SysString cname;
cname.assign((int32)i);
cname.insert(L"LongerNamedEntity", 0);
// read all the nodes of this name
//
for (tag = sof0.first(cname); tag != Sof::NO_TAG;
tag = sof0.next(cname, tag)) {
// find the node
//
if (!sof0.find(cname, tag)) {
return Error::handle(name(), L"find", Error::TEST, __FILE__, __LINE__);
}
int32 val = i * 10277 + tag * 13;
int32 j;
count++;
if ((!sof0.gets(input)) || (input.firstStr(L"value = ") != 0)) {
return Error::handle(name(), L"gets", Error::TEST, __FILE__, __LINE__);
}
SysString numeric;
input.substr(numeric, 8);
if (!numeric.get(j)) {
return Error::handle(name(), L"gets", Error::TEST, __FILE__, __LINE__);
}
if (j != val) {
return Error::handle(name(),L"mismatch",Error::TEST,__FILE__,__LINE__);
}
}
}
// check count
//
if (count != NUM_CLASSES * NUM_TAGS) {
return Error::handle(name(), L"not enough",Error::TEST,__FILE__,__LINE__);
}
// test delete
//
if (level_a > Integral::BRIEF) {
SysString output(L"testing remove (text)");
Console::put(output);
}
// go back through, delete every other entry
//
for (int32 i = 0; i < NUM_CLASSES; i += 2) {
// create a name
//
SysString cname;
cname.assign((int32)i);
cname.insert(L"LongerNamedEntity", 0);
if ((i % 4) == 0) {
// read all the nodes of this name
//
for (tag = sof0.first(cname); tag != Sof::NO_TAG;
tag = sof0.next(cname, tag)) {
// remove node
//
if (!sof0.remove(cname, tag)) {
return Error::handle(name(), L"remove1", Error::TEST,
__FILE__, __LINE__);
}
}
}
// delete all instances of this name
//
else if (!sof0.remove(cname)) {
return Error::handle(name(), L"remove2", Error::TEST, __FILE__,
__LINE__);
}
}
sof0.close();
// testing read after delete
//
if (level_a > Integral::BRIEF) {
Console::put(L"testing read after delete (text)");
}
// open the file again
//
sof0.open(file2);
count = 0;
// read all the dynamically named nodes
//
for (int32 i = 1; i < NUM_CLASSES; i += 2) {
// create a name
//
SysString cname;
cname.assign((int32)i);
cname.insert(L"LongerNamedEntity", 0);
// read all the nodes of this name
//
for (tag = sof0.first(cname); tag != Sof::NO_TAG;
tag = sof0.next(cname, tag)) {
// find the node
//
if (!sof0.find(cname, tag)) {
return Error::handle(name(), L"find", Error::TEST, __FILE__, __LINE__);
}
int32 val = i * 10277 + tag * 13;
int32 j;
count++;
if ((!sof0.gets(input)) || (input.firstStr(L"value = ") != 0)) {
return Error::handle(name(), L"gets", Error::TEST, __FILE__, __LINE__);
}
SysString numeric;
input.substr(numeric, 8);
if (!numeric.get(j)) {
return Error::handle(name(), L"gets", Error::TEST, __FILE__, __LINE__);
}
if (j != val) {
return Error::handle(name(), L"mismatch", Error::TEST,
__FILE__, __LINE__);
}
}
}
if (count != NUM_CLASSES * NUM_TAGS / 2) {
return Error::handle(name(), L"not enough 2", Error::TEST, __FILE__,
__LINE__);
}
// test enumerate method
//
SofList sof0_index;
SofSymbolTable sof0_table;
if (!sof0.enumerate(sof0_index, sof0_table)) {
return Error::handle(name(), L"enumerate", Error::TEST, __FILE__,
__LINE__);
}
// close the file
//
sof0.close();
// test overwriting in binary w/resize
//
{
SysString temp;
Integral::makeTemp(temp);
Sof sof;
sof.open(temp, File::WRITE_ONLY, File::BINARY);
SysString obj_name(L"MyObject");
sof.put(obj_name, 0, sizeof(int32));
int32 a = 5;
sof.write(&a, sizeof(int32), 1);
sof.close();
sof.open(temp, File::READ_PLUS, File::BINARY);
int32 pos = sof.end_of_data_d;
sof.put(obj_name, 0, sizeof(int32)*2);
sof.write(&a, sizeof(int32), 1);
sof.write(&a, sizeof(int32), 1);
if (sof.end_of_data_d != (pos + (int32)sizeof(int32))) {
return Error::handle(name(), L"diagnose", Error::TEST,
__FILE__, __LINE__);
}
sof.close();
}
// reset indentation
//
if (level_a > Integral::NONE) {
Console::decreaseIndention();
}
//--------------------------------------------------------------------------
//
// 6. class-specific public methods:
// formatting methods
//
//--------------------------------------------------------------------------
// set indentation
//
if (level_a > Integral::NONE) {
Console::put(L"testing class-specific public methods: formatting methods...\n");
Console::increaseIndention();
}
// open the file again
//
sof0.open(file0, File::WRITE_ONLY);
// increase indentation
//
sof0.increaseIndention();
sof0.setLineWrap(100);
if (sof0.getLineWrap() != 100) {
return Error::handle(name(), L"set/getLineWrap", Error::TEST,
__FILE__, __LINE__);
}
if (sof0.getLineLength() != 100 - (File::INDENT_STR).length()) {
return Error::handle(name(), L"set/getLineLength", Error::TEST,
__FILE__, __LINE__);
}
// decrease indentation
//
sof0.decreaseIndention();
if (sof0.getLineLength() != 100) {
return Error::handle(name(), L"set/getLineLength", Error::TEST,
__FILE__, __LINE__);
}
sof0.close();
// delete temporary files
//
//File::remove(file0);
//File::remove(file1);
//File::remove(L"/tmp/foo_asc.sof");
//File::remove(L"/tmp/foo_copy.sof");
// reset indentation
//
if (level_a > Integral::NONE) {
Console::decreaseIndention();
}
//---------------------------------------------------------------------------
//
// 7. print completion message
//
//---------------------------------------------------------------------------
// reset indentation
//
if (level_a > Integral::NONE) {
Console::decreaseIndention();
}
if (level_a > Integral::NONE) {
SysString output(L"diagnostics passed for class ");
output.concat(name());
output.concat(L"\n");
Console::put(output);
}
// exit gracefully
//
return true;
}
|
dda7de6ca843fc9505044f713aa1a6ece7946a28
|
29750d3a04607e2d342db85479bd0e6fefdee219
|
/Game/highscorerecord.h
|
066072f32bdb2da709597a2121d00fa52b8799c4
|
[
"MIT"
] |
permissive
|
sethballantyne/Plexis
|
eeca7fc30feed80f0c5991f4d30e3f939241c7f6
|
49b98918d9184321ba0dd449aded46b68eedb752
|
refs/heads/master
| 2022-10-05T08:25:30.451069
| 2020-06-06T02:45:07
| 2020-06-06T02:45:07
| 104,973,327
| 2
| 0
|
MIT
| 2020-06-06T02:45:08
| 2017-09-27T04:51:22
|
C++
|
UTF-8
|
C++
| false
| false
| 3,819
|
h
|
highscorerecord.h
|
// Copyright(c) 2018 Seth Ballantyne <seth.ballantyne@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files(the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions :
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
#pragma once
using namespace System;
using namespace System::Text;
/// <summary>
/// represents a single entry in the highscores file.
/// </summary>
public ref class HighScoreRecord
{
private:
array<unsigned char, 1> ^playerName;
public:
HighScoreRecord()
{
playerName = gcnew array<unsigned char, 1>(12);
// spells ASS.
// used as a default value. If there's entries missing from the highscore file, the default will
// be displayed.
playerName[0] = 65;
playerName[1] = 83;
playerName[2] = 83;
}
/// <summary>
/// Gets or sets the score associated with this high score table entry.
/// </summary>
property unsigned int Score;
/// <summary>
/// Attempts to convert and return the player name from a byte array to a string.
/// </summary>
/// <returns>the player name as a String consisting of ASCII characters.</returns>
/// <exception cref="System::ArgumentException">the player name is <b>null</b>.</exception>
/// <exception cref="System::ArgumentNullException">the player name contains non-ascii characters.</exception>
String ^PlayerNameAsString()
{
try
{
return Encoding::ASCII->GetString(playerName);
}
catch(...)
{
throw;
}
}
/// <summary>
/// returns the current player name assigned to the player field for this record.
/// </summary>
/// <returns>the current name as an array of ASCII characters.</returns>
/// <remarks>the size of the player name will always be the length of the buffer it's stored in
/// as its a fixed size.</remarks>
array<unsigned char, 1> ^GetPlayerName()
{
return this->playerName;
}
/// <summary>
/// Assigns a name to the player field for this record.
/// </summary>
/// <param name="value">the name to assign.</param>
/// <exception cref="System::Exception">the length of <i>value</i> is greater than the length
/// of the player name buffer, or is the length of <i>value</i> is 0.</exception>
/// <exception cref="System::ArgumentNullException"><i>value</i> is <b>null</b>.</exception>
void SetPlayerName(array<unsigned char, 1> ^value)
{
if(nullptr == value)
{
throw gcnew ArgumentNullException("value");
}
else if(value->Length > this->playerName->Length || value->Length == 0)
{
throw gcnew ArgumentException("attempting to assign a player name that's the wrong length.");
}
else
{
Array::Copy(value, this->playerName, value->Length);
}
}
};
|
338926f450d193e724346f5c6b52d4128cfa5027
|
5c8645d9c4deee4e77c7a9ca649d24c49794ce6f
|
/CPP/1-100/Q1_TwoSum.cpp
|
f2ba8b20da991dc4099f969a7bf69618e980f6b5
|
[] |
no_license
|
XiandaChen/LeetCode
|
51e9c851f739a5e47195745a2dddc87462a0efbf
|
fb8b5c67b3876f4a6752cdbe8c8b8979e185ab93
|
refs/heads/master
| 2022-10-23T20:34:56.375847
| 2022-10-17T06:06:27
| 2022-10-17T06:06:27
| 205,062,375
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 407
|
cpp
|
Q1_TwoSum.cpp
|
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> umap;
for (int i = 0; i < nums.size(); i++) {
int complement = target - nums[i];
if (umap.count(complement)) {
return {i, umap[complement]};
break;
}
umap[nums[i]] = i;
}
return {};
}
};
|
61d5e9a09d3ef06b33c05b26711d2c60439a5793
|
b00ca3ef0aec0c161d11ae655957aed863fcb292
|
/C++/2156.cpp
|
3de11c7eebb7b79e4390272667f39db7b9b58352
|
[] |
no_license
|
tmdghks9574/Algorithm
|
52b711915d1aa902e09216436adc02d038e95af9
|
0394cee78449a23f878b33154da543393bb6b24a
|
refs/heads/master
| 2021-07-19T04:10:06.512655
| 2020-08-10T05:44:17
| 2020-08-10T05:44:17
| 201,771,779
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 555
|
cpp
|
2156.cpp
|
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int *drink = new int[10001];
int *DP = new int[10001];
int numcase;
cin >> numcase;
for(int i = 1; i <= numcase; i++)
{
cin >> drink[i];
}
DP[0] = 0;
DP[1] = drink[1];
DP[2] = drink[1] + drink[2];
for(int i = 3; i <= numcase; i++)
{
DP[i] = max(DP[i-2] + drink[i] , DP[i-3] + drink[i-1] + drink[i]);
cout << "DP[" << i << "] = " << DP[i] << endl;
}
cout << DP[numcase] << endl;
return 0;
}
|
0eb775a200d8b995cb492656029ff5673e947d7d
|
e83631ad9bc3989c42f6cb9f0349a79c08037164
|
/animal.cpp
|
b6e9ca924a1015b94f83e2c55abb4759aec195a3
|
[] |
no_license
|
KatyaKaravaeva/HW_AVC2
|
2cb9207675264e085f06ab38cc6436bbd8302618
|
5a9d08b75cdabf51e9aa24df26f12bb2b27c95c6
|
refs/heads/master
| 2023-08-21T02:59:58.912617
| 2021-10-23T16:50:56
| 2021-10-23T16:50:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,113
|
cpp
|
animal.cpp
|
//
// Created by kikin on 21.10.2021.
//
#include "animal.h"
#include "beast.h"
#include "bird.h"
#include "fish.h"
//------------------------------------------------------------------------------
// Entering language parameters from a file.
Animal *Animal::StaticIn(FILE *file) {
Animal *sp = NULL;
int kind = Includes::readDigit(file);
switch (kind) {
case 0:
sp = new Fish;
sp->In(file);
break;
case 1:
sp = new Beast;
sp->In(file);
break;
default:
sp = new Bird;
sp->In(file);
break;
}
return sp;
}
Animal *Animal::StaticInRnd() {
Animal *animal = NULL;
int kind = Includes::rndInt(1, 3);
if (kind != 1) {
if (kind == 2) {
animal = new Beast;
animal->InRnd();
} else {
animal = new Fish;
animal->InRnd();
}
} else {
animal = new Bird;
animal->InRnd();
}
return animal;
}
#include "animal.h"
|
b7ac392264e34efd1d0db4e22e9489cbce8f3193
|
2c97fc62eab1f78c4a5d1a83826a75209ebb6d39
|
/1比赛题目/codeforces round 506 div 3/C.cpp
|
7f0b679f11116153a7f19a5247644760e3565915
|
[] |
no_license
|
GaisaiYuno/My-OI-Code-1
|
f32932f1004e593ffee0b0e97cffd25d9e2851bf
|
c57ec4e2aaa1d770ee9490a42710d1cf71a153f2
|
refs/heads/master
| 2020-12-31T23:13:46.913582
| 2020-02-08T01:09:46
| 2020-02-08T01:09:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 743
|
cpp
|
C.cpp
|
#include<iostream>
#include<cstdio>
#include<cstring>
#define maxn 300005
#define INF 0x7fffffff
using namespace std;
int n;
int l[maxn],r[maxn];
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d %d",&l[i],&r[i]);
}
int maxl,smaxl,minr,sminr;
maxl=smaxl=0;
minr=sminr=INF;
int posl,posr;
for(int i=1;i<=n;i++){
maxl=max(l[i],maxl);
minr=min(r[i],minr);
if(maxl==l[i]) posl=i;
if(minr==r[i]) posr=i;
}
for(int i=1;i<=n;i++){
if(i!=posl) smaxl=max(l[i],smaxl);
if(i!=posr) sminr=min(r[i],sminr);
}
int ansl,ansr;
ansl=ansr=0;
for(int i=1;i<=n;i++){
if(l[i]==ansl) ansl=smaxl;
else ansl=maxl;
}
for(int i=1;i<=n;i++){
if(r[i]==ansr) ansr=sminr;
else ansr=minr;
}
printf("%d\n",ansr-ansl+1);
}
|
6d9b3ceb20197ccc9be8ef9b390c86893bdd42aa
|
58f9da8b0745afbfc668ef3ebe5f8fdfaf94d2e6
|
/leetcode/leetcode14.cpp
|
cc5a682b0e950e3c8ce9d96c11eaed42dcb2e60b
|
[] |
no_license
|
dongyangli1226/problem_solving
|
6dcad4cd6581dda671ff78758947798e09493377
|
3d3fd9411046179c35b7608d7ef63eef1898159c
|
refs/heads/master
| 2020-03-19T07:26:43.866906
| 2018-12-03T02:28:28
| 2018-12-03T02:28:28
| 136,113,978
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 701
|
cpp
|
leetcode14.cpp
|
//longest common prefix
#include <iostream>
#include <vector>
using namespace std;
string longestCommonPrefix(vector<string>& strs) {
string res = "";
char c;
//return empty string if no string in strs
if(strs.size() == 0) return res;
//loop into the chars of first string in strs
for(int i=0; i<strs[0].size(); i++){
c = strs[0][i];
//compare char c to chars of other strings in strs at same index
for(auto s:strs){
if(strs.size() < i || s[i] != c){
return res;
}
}
//if all other strings have char c at the same index then add c to result
res.push_back(c);
}
return res;
}
|
0e76e0b28749dc8b10f6e67aae821b3b31392c83
|
de56a68d56ec23a9a1068758b05bc051211fd01e
|
/ofs/master/file/File.h
|
617e2dff0e86ec9deecc85926b7a069e7cc50759
|
[
"MIT"
] |
permissive
|
ooeyusea/zookeeper
|
e3b36ce4c69acc0640205ad829af5fdb06d7c3c3
|
6dc5297ba2248d809b2b0344085f2e00331e0a61
|
refs/heads/master
| 2020-04-26T21:50:20.718312
| 2019-08-28T15:37:29
| 2019-08-28T15:37:29
| 173,853,264
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 856
|
h
|
File.h
|
#ifndef __FILE_H__
#define __FILE_H__
#include "hnet.h"
#include "Node.h"
#include "OfsId.h"
#include "RefObject.h"
namespace ofs {
class File : public Node, public RefObject {
public:
File() : Node(false) {
_id = IdGenerator::GenerateId();
}
File(int64_t id) : Node(false), _id(id) {}
~File() {}
virtual void DoNotWantToObject() {}
template <typename AR>
inline void Archive(AR& ar) {
Node::Archive(ar);
ar & _id;
}
inline int64_t GetId() const { return _id; }
inline void UpdateSize(uint32_t size) {
volatile uint32_t old = _size;
while (old < size) {
#ifdef WIN32
if (InterlockedCompareExchangeNoFence(&_size, size, old) == old) {
#else
if (__sync_bool_compare_and_swap(&_size, old, size)) {
#endif
break;
}
old = _size;
}
}
private:
int64_t _id;
};
}
#endif //__OFS_MASTER_H__
|
e68eae40000a5c03565a912e3d590bc17f669187
|
4f4913b4905029b94166e899439c928d87c805f8
|
/circunferencia.cpp
|
f57024edaaa3faa866d2c8f224c28ce26802634e
|
[] |
no_license
|
dirgnisally/grafica
|
43c9312b051884c566c01f12cafc15ef05b35b1c
|
aab3399e579395eed5f01ef59694d0f9f113927a
|
refs/heads/master
| 2020-08-10T21:46:00.924865
| 2019-10-11T12:12:01
| 2019-10-11T12:12:01
| 214,427,032
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,825
|
cpp
|
circunferencia.cpp
|
#include <GL/glut.h> // GLUT, include glu.h and gl.h
#include <iostream>
using namespace std;
typedef struct paleta_de_cores{ //estrutura criada com a finalidade de manter a paleta de cores a ser utilizada na função MidPointCircle
GLfloat cores[3];
}cor;
cor paleta;
void reshape(int width, int height){
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, width, height, 0, 0, 1);
glMatrixMode(GL_MODELVIEW);
}
void write_pixel(GLfloat x, GLfloat y, cor paleta){ //funçao que pinta um pixel na tela
glBegin(GL_POINTS);
glColor3f(paleta.cores[0],paleta.cores[1],paleta.cores[2]);
glVertex2i(x,y);
glEnd();
}
void CirclePoints(int x, int y, cor paleta){ //A função MidPointCircle apenas desenha um quadrante da circunferência, portanto essa função é necessária para achar os outros pontos que completam a cincunferência
write_pixel( x, y, paleta);
write_pixel( x, -y, paleta);
write_pixel(-x, y, paleta);
write_pixel(-x, -y, paleta);
write_pixel( y, x, paleta);
write_pixel( y, -x, paleta);
write_pixel(-y, x, paleta);
write_pixel(-y, -x, paleta);
}/*end CirclePoints*/
//Punto medio
void MidPointCircle(int r, cor paleta){
int x, y;
float d;
/*Valores iniciales */
x = 0;
y = r;
d = 5/4 - r;
CirclePoints(x, y, paleta);
while (y > x ){
if (d < 0){
/* Seleccione E */
d = d + 2 * x + 3;
x++;
}else {
/* Selecone SE */
d = d + 2 * (x - y ) + 5;
x++;
y--;
}
CirclePoints(x, y, paleta);
}/* end while */
}
void display() {
//glClear(GL_COLOR_BUFFER_BIT); // Clear the color buffer (background)
//glColor3f(1.0f, 0.0f, 0.0f); // Red
//glLoadIdentity();
//glBegin(GL_POINTS);
srand(time(0));
paleta.cores[0]=(rand() % 255)/100;
paleta.cores[1]=(rand() % 255)/100;
paleta.cores[2]=(rand() % 255)/100;
MidPointCircle(200, paleta);
//glEnd();
glFlush(); // Render now
}
void Init(){
glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set background color to black and opaque
}
/* Main function: GLUT runs as a console application starting at main() */
int main(int argc, char** argv) {
glutInit(&argc, argv); // Initialize GLUT
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowPosition(50, 50); // Position the window's initial top-left corner
glutInitWindowSize(400, 400); // Set the window's initial width & height
glutCreateWindow("OpenGL Setup Test"); // Create a window with the given title
Init();
glutDisplayFunc(display); // Register display callback handler for window re-paint
glutReshapeFunc(reshape);
glutMainLoop(); // Enter the event-processing loop
return 0;
}
|
ed43574e1987d0836f3cf7d26b8097d62251aa77
|
407a4e7b0533e9c25c57952ef4c6b7b6bb19d1c1
|
/ArtScience Genetico/ArtScience_GeneticAlgorithm/ArtScience_GeneticAlgorithm.ino
|
4746622c020f9b72373089008cd7d73e8c29e476
|
[] |
no_license
|
AndresDuran53/arduino_examples
|
efa6fedb623e1a92b2056fadb914bac3b3e9b5a0
|
9095d947f913356a04e7913b220c10479a98f61a
|
refs/heads/master
| 2020-05-20T06:17:35.997695
| 2019-05-07T15:19:56
| 2019-05-07T15:19:56
| 185,426,087
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,250
|
ino
|
ArtScience_GeneticAlgorithm.ino
|
//Tomas de Camino Beck
//www.funcostarica.org
#include "Chromosome.h"
#include <Adafruit_CircuitPlayground.h>
#define N 10
//crea la poblacion
Population pop(N);
byte mejorChromosoma;
int generacionesSinCambios = 0;
//prende los pixles dependiendo de los bits en el cromosoma
void setPixels(int a) {
for (int i = 0; i < 8; i++) {
if (bitRead(pop.chromosome[a], i)) {
CircuitPlayground.setPixelColor(i + 2, CircuitPlayground.strip.Color(255, 255, 255));
} else {
CircuitPlayground.setPixelColor(i + 2, CircuitPlayground.strip.Color(0, 0, 0));
}
}
}
//Calcula el fitnes basado en la cantidad de luz (maximiza)
//y la cantidad de leds (minimiza)
void fitness(int a) {
pop.fitness[a] = 0.7 * float(CircuitPlayground.lightSensor()) - 0.3 * float(pop.countBits(a));
}
//Evalua cada cromosoma
void evaluate() {
for (int i = 0; i < pop.n; i++) {
setPixels(i);
//gives LED time to turn on
delay(30);
fitness(i);
}
}
void mejorEncontrado(){
for (int i = 0; i < 8; i++) {
if (bitRead(pop.chromosome[0], i)) {
CircuitPlayground.setPixelColor(i + 2, CircuitPlayground.strip.Color(0, 200, 0));
} else {
CircuitPlayground.setPixelColor(i + 2, CircuitPlayground.strip.Color(125, 0, 0));
}
}
}
void setup() {
randomSeed(analogRead(A9));
Serial.begin(115200);
CircuitPlayground.begin();
CircuitPlayground.clearPixels();
//inicia con una poblaci�n aleatoria
pop.mutateChromosomes(0.5,0);
mejorChromosoma=pop.chromosome[0];
}
void loop() {
//aplica recombinaci�n con cromosoma 0 a 2 y los copia en una poblaci�n
pop.copyCrossover(2);
//genera mutaciones en cada gen con
//probabilidad 0.1
pop.mutateChromosomes(0.01, 1);
//evalua
evaluate();
//Ordena los cromosomas de mayr a menor fitness
pop.sort();
//prende los leds que correspoden al mejor fitness
setPixels(0);
if (mejorChromosoma==pop.chromosome[0]){
generacionesSinCambios++;
Serial.println(generacionesSinCambios);
}
else{
generacionesSinCambios=0;
mejorChromosoma=pop.chromosome[0];
}
if(generacionesSinCambios>25){
Serial.println(millis()/1000);
mejorEncontrado();
while(1){
delay(1000);
}
}
//espera
delay(10);
}
|
04ab31801a34571c3bdc978e4a5269ccc2e25419
|
30aa9ed19847a7830f3a566e30c6924fb4334556
|
/LPCLibraryProject/src/ScratchWork.cpp
|
cbeaede5443f95d624d444e8d45a3657cf403928
|
[] |
no_license
|
rogeliomolina1/LPC_Projects
|
825648b54ec96793cc6c5541927a5d0d024b7424
|
1e6c36a0bc36939ed1ffd54e586ad6ce251ab9bd
|
refs/heads/master
| 2022-12-12T04:22:48.073991
| 2020-09-08T05:31:53
| 2020-09-08T05:31:53
| 293,704,910
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,344
|
cpp
|
ScratchWork.cpp
|
/*
* ScratchWork.cpp
*
* Created on: Sep 27, 2016
* Author: rogel
*/
//#include <iostream>
//#include "lpclib.h"
//using namespace std;
//
//
//struct Point
//{
// double x;
// double y;
//};
//
//void Triangle(GraphicsWindow * win,
// Point a, Point b, Point c, int depth);
//
//
//Color white(255, 255, 255);
//
//
//int main()
//{
// GraphicsWindow w(800, 800, "Wheee");
// Point top = { 400, 0 };
// Point bottomLeft = { 0, 799 };
// Point bottomRight = { 799, 799 };
// Triangle(&w, top, bottomLeft, bottomRight, 8);
// w.Refresh();
// w.WaitForMouseDown();
//}
//
//
//void Triangle(GraphicsWindow * win,
// Point a, Point b, Point c, int depth)
//{
// /// base case
// if (depth == 0)
// {
// win->DrawLine(a.x, a.y, b.x, b.y, white);
// win->DrawLine(b.x, b.y, c.x, c.y, white);
// win->DrawLine(c.x, c.y, a.x, a.y, white);
// }
// else
// {
// Point p = { (a.x + b.x)/2, (a.y + b.y) / 2 };
// Point q = { (b.x + c.x)/2, (b.y + c.y) / 2 };
// Point r = { (a.x + c.x)/2, (a.y + c.y) / 2 };
//
//
// Triangle(win, a, p, r, depth-1);
// Triangle(win, p, b, q, depth-1);
// Triangle(win, r, q, c, depth-1);
//
// }
//}
//
//
//
|
a28b8a94ba5510f8bc4ee8a68200e39a9a38b0ae
|
877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a
|
/app/src/main/cpp/dir7941/dir22441/dir22442/dir22443/dir22444/dir22630/file22700.cpp
|
1bfe38f4c319f831f3abbc5570ad00c343e05058
|
[] |
no_license
|
tgeng/HugeProject
|
829c3bdfb7cbaf57727c41263212d4a67e3eb93d
|
4488d3b765e8827636ce5e878baacdf388710ef2
|
refs/heads/master
| 2022-08-21T16:58:54.161627
| 2020-05-28T01:54:03
| 2020-05-28T01:54:03
| 267,468,475
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 115
|
cpp
|
file22700.cpp
|
#ifndef file22700
#error "macro file22700 must be defined"
#endif
static const char* file22700String = "file22700";
|
f53b5872a1c7a17381647b8bbcddd9e142816daf
|
5a8e8a8ed3c1d5f48cab80c8d699a4736c3aa119
|
/example/TestCMD.cpp
|
8ed8f4657cc01d1f8008a10f0a6f84d53d77b5a2
|
[] |
no_license
|
ooklasd/CommandPattern
|
8bc04e2e8f2d9b957feff61a4d50a90ff0a776ff
|
c98b1bbde9638ec7912f777342e02a94791e6b28
|
refs/heads/master
| 2021-05-09T05:37:07.973693
| 2020-03-18T03:27:38
| 2020-03-18T03:30:02
| 119,315,843
| 0
| 0
| null | null | null | null |
GB18030
|
C++
| false
| false
| 233
|
cpp
|
TestCMD.cpp
|
#include "TestCMD.h"
#include "CommandManager.h"
//TestCMD.cpp文件,此时ArgType为上面Json::Value
_XXX_CMD_REGISTER(TestCMD);
bool TestCMD::doit(const ArgType& arg)
{
//处理逻辑
auto doc = getDocument();
return true;
}
|
4bbd2aff7fcfd21defa7ac78844334d8be2fe422
|
539be065df60cd17a095c3af61a8e443a4988bf0
|
/Elementary Algo/Math/main.cpp
|
3b3e44e59fd7a905aa8aa93399108dcd1cf7759b
|
[] |
no_license
|
Luodian/LeetCode
|
b80743ebe6a7685eb113bc2d63d16827133de8c2
|
35fc66c4dc7d400ad76fcd893eb55d92ab540e87
|
refs/heads/master
| 2020-03-22T22:19:17.468061
| 2019-09-29T11:14:12
| 2019-09-29T11:14:12
| 140,745,405
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,272
|
cpp
|
main.cpp
|
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <string>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
#include <unordered_set>
#include <numeric>
#include <set>
#include <list>
#include <map>
using namespace std;
#define lower_bound LB
#define upper_bound UB
#define mem(a, x) memset(a,x,sizeof(a))
#define rep(i, a, n) for (int i=a;i<n;i++)
#define per(i, a, n) for (int i=n-1;i>=a;i--)
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define IT iterator
#define test puts("OK")
#define lowbit(x) x & -x
#define PRQ priority_queue
#define PB push_back
#define gcd(a, b) _gcd(a,b)
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int, int> pii;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
const LL mod = 1000000007;
const double PI = acos (-1.0);
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
class Solution {
public:
vector<string> fizzBuzz(int n) {
std::vector<string> v;
for (int i = 1; i <= n; ++i)
{
if (i % 3 == 0 && i % 15 != 0)
{
v.push_back("Fizz");
}
else if (i % 5 == 0 && i % 15 != 0)
{
v.push_back("Buzz");
}
else if (i % 15 == 0)
{
v.push_back("FizzBuzz");
}
else
{
v.push_back(to_string(i));
}
}
return v;
}
int countPrimes(int n) {
bool flag[n+5];
memset(flag,1,sizeof(flag));
int sqrt_n = sqrt(n + 0.5);
for (int i = 4; i <= n; i += 2)
{
flag[i] = 0;
}
for (int i = 2; i <= sqrt_n; ++i)
{
if (flag[i])
{
for (int j = i * i; j <= n; j += 2 * i)
{
flag[j] = 0;
}
}
}
int count = 0;
for (int i = 2; i < n; ++i)
{
if (flag[i]){
count ++;
}
}
return count;
}
bool isPowerOfThree(int n) {
int max_item = pow(3,20);
return n != 0 && max_item % n == 0;
}
//Symbol Value
//I 1
//V 5
//X 10
//L 50
//C 100
//D 500
//M 1000
int romanToInt(string s) {
int ans = 0;
std::map<char, int> mp;
mp['I'] = 1;
mp['V'] = 5;
mp['X'] = 10;
mp['L'] = 50;
mp['C'] = 100;
mp['D'] = 500;
mp['M'] = 1000;
int i = 0;
while(i < s.size())
{
if (i == s.size())
{
ans += mp[s[i]];
}
else if ((s[i] != 'I' && s[i] != 'X' && s[i] != 'C'))
{
ans += mp[s[i]];
}
else
{
if (s[i] == 'I')
{
if (s[i+1] == 'X' || s[i+1] == 'V')
{
ans += (mp[s[i+1]] - mp[s[i]]);
i += 1;
}
else
{
ans += mp[s[i]];
}
}
else if (s[i] == 'X')
{
if (s[i+1] == 'L' || s[i+1] == 'C')
{
ans += (mp[s[i+1]] - mp[s[i]]);
i += 1;
}
else
{
ans += mp[s[i]];
}
}
else if (s[i] == 'C')
{
if (s[i+1] == 'D' || s[i+1] == 'M')
{
ans += (mp[s[i+1]] - mp[s[i]]);
i += 1;
}
else
{
ans += mp[s[i]];
}
}
}
i += 1;
}
return ans;
}
};
int main ()
{
#ifndef ONLINE_JUDGE
freopen ("in.txt", "r", stdin);
#endif
ios::sync_with_stdio (false);
cin.tie (nullptr);
cout.tie (nullptr);
return 0;
}
|
e7a8102b3893c8b06b93133145018f147614ec87
|
37172696a71c0eb32ba63244481db7294b27d419
|
/908.cpp
|
9f3674e1302e1973f35b916dea001a0e134e2843
|
[] |
no_license
|
ivanumen/Zadachi
|
53da71eeb5e441ffeedbb4fb87e1a6fce3daaca2
|
aff9090ce153e9b2ea4278c9025faa852468798e
|
refs/heads/master
| 2023-03-11T00:03:44.304448
| 2021-03-03T13:08:44
| 2021-03-03T13:08:44
| 287,325,354
| 0
| 0
| null | 2021-03-03T13:08:45
| 2020-08-13T16:11:17
|
C++
|
UTF-8
|
C++
| false
| false
| 548
|
cpp
|
908.cpp
|
#include <iostream>
#include <vector>
using namespace std;
int delenie6(int number) {
vector <int> positiveNumber(number);
int sumpositiveNumber = 0;
int kolpositiveNumber = 0;
for (int i = 0; i < number; i++) {
cin >> positiveNumber[i];
if (positiveNumber[i] > 0 && positiveNumber[i] % 6 == 0) {
sumpositiveNumber = sumpositiveNumber + positiveNumber[i];
++kolpositiveNumber;
}
}
cout << kolpositiveNumber << " " << sumpositiveNumber;
return 0;
}
int main()
{
int number;
cin >> number;
delenie6(number);
return 0;
}
|
25d7d1d2d8745aebac6ad7a8fe30715b48f02235
|
5ee5275410bc50cd794fa2990fb6a4b1375fb95e
|
/AnalogReadSerial/vanIntro/vanIntro.ino
|
1ffb48b39f4f3985246c510c2a08e379d960c351
|
[] |
no_license
|
popov95s/HumanCable
|
cdfb3dc474c83a866defb3022b414409ee4fad49
|
4426ee43e0ccf18b41ea5dd1a70864d08a770a00
|
refs/heads/master
| 2021-01-20T02:25:22.102648
| 2017-05-16T08:09:19
| 2017-05-16T08:09:19
| 89,404,224
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,645
|
ino
|
vanIntro.ino
|
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the serial monitor.
Graphical representation is available using serial plotter (Tools > Serial Plotter menu)
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
/* Baud Rate 57600; 2 byte opening closing sequence; 13 byte message */
int asciiDecimal[] = {255, 255, 72, 101, 108, 108, 111, 44, 32, 73, 39, 109, 32, 86, 97, 110, 32, 84, 114, 97, 110, 44, 32, 97, 32, 67, 111, 109, 112, 117, 116, 101, 114, 32, 83, 99, 105, 101, 110, 99, 101, 32, 109, 97, 106, 111, 114, 32, 97, 116, 32, 83, 77, 85, 32, 33, 32, 0, 0};
int indexOfSendStr = 0;
int indexOfSendBits = 0;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(57600);
pinMode(5, OUTPUT);
pinMode(1, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A1);
// Serial.println("Read bit: ");
Serial.write(map(sensorValue, 0, 1024, 0, 255));
if (indexOfSendStr == 57) {
indexOfSendStr = 0;
indexOfSendBits = 0;
}
else if (indexOfSendBits == 8) {
indexOfSendStr++;
indexOfSendBits = 0;
}
bool bitToWrite = bitRead(asciiDecimal[indexOfSendStr], indexOfSendBits);
if (bitToWrite) {
analogWrite(5, 255);
}
else {
analogWrite(5, 0);
}
// Serial.print("Wrote bit: ");
// Serial.println(bitToWrite);
indexOfSendBits++;
delay(1); // delay in between reads for stability
}
|
97700802e6d4f81f0954f0015f80741fb3a8d09b
|
f4dd0a6de36666c8669bc677a3b5c83077a635dc
|
/src/libs/kdmp-parser/src/lib/kdmp-parser.h
|
20cb239b17bd0bb11bd9039236dfa6903dd1deb0
|
[
"MIT"
] |
permissive
|
0vercl0k/wtf
|
f1c42189bee27c6030c2cfa098a2eda050255295
|
9823579ef764b0b3c0af2f71b61d5aa47fb3de51
|
refs/heads/main
| 2023-07-19T17:59:45.759383
| 2023-07-09T04:21:04
| 2023-07-09T04:21:04
| 384,769,357
| 1,244
| 117
|
MIT
| 2023-07-09T04:21:06
| 2021-07-10T18:53:57
|
C++
|
UTF-8
|
C++
| false
| false
| 15,469
|
h
|
kdmp-parser.h
|
// Axel '0vercl0k' Souchet - February 15 2019
#pragma once
#include "filemap.h"
#include "kdmp-parser-structs.h"
#include <cstdint>
#include <cstdio>
#include <optional>
#include <unordered_map>
namespace kdmpparser {
using Physmem_t = std::unordered_map<uint64_t, const uint8_t *>;
struct BugCheckParameters_t {
uint32_t BugCheckCode;
uint64_t BugCheckCodeParameter[4];
};
class KernelDumpParser {
//
// The mapped file.
//
FileMap_t FileMap_;
//
// Header of the crash-dump.
//
HEADER64 *DmpHdr_ = nullptr;
//
// File path to the crash-dump.
//
const char *PathFile_ = nullptr;
//
// Mapping between physical addresses / page data.
//
Physmem_t Physmem_;
public:
//
// Actually do the parsing of the file.
//
bool Parse(const char *PathFile) {
//
// Copy the path file.
//
PathFile_ = PathFile;
//
// Map a view of the file.
//
if (!MapFile()) {
printf("MapFile failed.\n");
return false;
}
//
// Parse the DMP_HEADER.
//
if (!ParseDmpHeader()) {
printf("ParseDmpHeader failed.\n");
return false;
}
//
// Retrieve the physical memory according to the type of dump we have.
//
if (DmpHdr_->DumpType == DumpType_t::FullDump) {
if (!BuildPhysmemFullDump()) {
printf("BuildPhysmemFullDump failed.\n");
return false;
}
} else if (DmpHdr_->DumpType == DumpType_t::BMPDump) {
if (!BuildPhysmemBMPDump()) {
printf("BuildPhysmemBMPDump failed.\n");
return false;
}
}
return true;
}
//
// Give the Context record to the user.
//
constexpr const CONTEXT *GetContext() const {
//
// Give the user a view of the context record.
//
return &DmpHdr_->ContextRecord;
}
//
// Give the bugcheck parameters to the user.
//
constexpr BugCheckParameters_t GetBugCheckParameters() const {
//
// Give the user a view of the bugcheck parameters.
//
return {
DmpHdr_->BugCheckCode,
{DmpHdr_->BugCheckCodeParameter[0], DmpHdr_->BugCheckCodeParameter[1],
DmpHdr_->BugCheckCodeParameter[2], DmpHdr_->BugCheckCodeParameter[3]}};
}
//
// Get the type of dump.
//
constexpr DumpType_t GetDumpType() const { return DmpHdr_->DumpType; }
//
// Get the physmem.
//
constexpr const Physmem_t &GetPhysmem() const { return Physmem_; }
//
// Show the exception record.
//
void ShowExceptionRecord(const uint32_t Prefix) const {
DmpHdr_->Exception.Show(Prefix);
}
//
// Show the context record.
//
void ShowContextRecord(const uint32_t Prefix) const {
const CONTEXT &Context = DmpHdr_->ContextRecord;
printf("%*srax=%016" PRIx64 " rbx=%016" PRIx64 " rcx=%016" PRIx64 "\n",
Prefix, "", Context.Rax, Context.Rbx, Context.Rcx);
printf("%*srdx=%016" PRIx64 " rsi=%016" PRIx64 " rdi=%016" PRIx64 "\n",
Prefix, "", Context.Rdx, Context.Rsi, Context.Rdi);
printf("%*srip=%016" PRIx64 " rsp=%016" PRIx64 " rbp=%016" PRIx64 "\n",
Prefix, "", Context.Rip, Context.Rsp, Context.Rbp);
printf("%*s r8=%016" PRIx64 " r9=%016" PRIx64 " r10=%016" PRIx64 "\n",
Prefix, "", Context.R8, Context.R9, Context.R10);
printf("%*sr11=%016" PRIx64 " r12=%016" PRIx64 " r13=%016" PRIx64 "\n",
Prefix, "", Context.R11, Context.R12, Context.R13);
printf("%*sr14=%016" PRIx64 " r15=%016" PRIx64 "\n", Prefix, "",
Context.R14, Context.R15);
printf("%*scs=%04x ss=%04x ds=%04x es=%04x fs=%04x gs=%04x "
" efl=%08x\n",
Prefix, "", Context.SegCs, Context.SegSs, Context.SegDs,
Context.SegEs, Context.SegFs, Context.SegGs, Context.EFlags);
printf("%*sfpcw=%04x fpsw=%04x fptw=%04x\n", Prefix, "",
Context.ControlWord, Context.StatusWord, 1);
printf("%*s st0=%016" PRIx64 "%016" PRIx64 " st1=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.FloatRegisters[0].High,
Context.FloatRegisters[0].Low, Context.FloatRegisters[1].High,
Context.FloatRegisters[1].Low);
printf("%*s st2=%016" PRIx64 "%016" PRIx64 " st3=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.FloatRegisters[2].High,
Context.FloatRegisters[2].Low, Context.FloatRegisters[3].High,
Context.FloatRegisters[3].Low);
printf("%*s st4=%016" PRIx64 "%016" PRIx64 " st5=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.FloatRegisters[4].High,
Context.FloatRegisters[4].Low, Context.FloatRegisters[5].High,
Context.FloatRegisters[5].Low);
printf("%*s st6=%016" PRIx64 "%016" PRIx64 " st7=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.FloatRegisters[6].High,
Context.FloatRegisters[6].Low, Context.FloatRegisters[7].High,
Context.FloatRegisters[7].Low);
printf("%*s xmm0=%016" PRIx64 "%016" PRIx64 " xmm1=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.Xmm0.High, Context.Xmm0.Low, Context.Xmm1.High,
Context.Xmm1.Low);
printf("%*s xmm2=%016" PRIx64 "%016" PRIx64 " xmm3=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.Xmm2.High, Context.Xmm2.Low, Context.Xmm3.High,
Context.Xmm3.Low);
printf("%*s xmm4=%016" PRIx64 "%016" PRIx64 " xmm5=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.Xmm4.High, Context.Xmm4.Low, Context.Xmm5.High,
Context.Xmm5.Low);
printf("%*s xmm6=%016" PRIx64 "%016" PRIx64 " xmm7=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.Xmm6.High, Context.Xmm6.Low, Context.Xmm7.High,
Context.Xmm7.Low);
printf("%*s xmm8=%016" PRIx64 "%016" PRIx64 " xmm9=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.Xmm8.High, Context.Xmm8.Low, Context.Xmm9.High,
Context.Xmm9.Low);
printf("%*sxmm10=%016" PRIx64 "%016" PRIx64 " xmm11=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.Xmm10.High, Context.Xmm10.Low,
Context.Xmm11.High, Context.Xmm11.Low);
printf("%*sxmm12=%016" PRIx64 "%016" PRIx64 " xmm13=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.Xmm12.High, Context.Xmm12.Low,
Context.Xmm13.High, Context.Xmm13.Low);
printf("%*sxmm14=%016" PRIx64 "%016" PRIx64 " xmm15=%016" PRIx64
"%016" PRIx64 "\n",
Prefix, "", Context.Xmm14.High, Context.Xmm14.Low,
Context.Xmm15.High, Context.Xmm15.Low);
}
//
// Show all the structures of the dump.
//
void ShowAllStructures(const uint32_t Prefix) const { DmpHdr_->Show(Prefix); }
//
// Get the content of a physical address.
//
const uint8_t *GetPhysicalPage(const uint64_t PhysicalAddress) const {
//
// Attempt to find the physical address.
//
const auto &Pair = Physmem_.find(PhysicalAddress);
//
// If it doesn't exist then return nullptr.
//
if (Pair == Physmem_.end()) {
return nullptr;
}
//
// Otherwise we return a pointer to the content of the page.
//
return Pair->second;
}
//
// Get the directory table base.
//
constexpr uint64_t GetDirectoryTableBase() const {
return DmpHdr_->DirectoryTableBase;
}
//
// Translate a virtual address to physical address using a directory table
// base.
//
std::optional<uint64_t>
VirtTranslate(const uint64_t VirtualAddress,
const uint64_t DirectoryTableBase = 0) const {
//
// If DirectoryTableBase is null ; use the one from the dump header and
// clear PCID bits (bits 11:0).
//
uint64_t LocalDTB = Page::Align(GetDirectoryTableBase());
if (DirectoryTableBase) {
LocalDTB = Page::Align(DirectoryTableBase);
}
//
// Stole code from @yrp604 and @0vercl0k.
//
const VIRTUAL_ADDRESS GuestAddress(VirtualAddress);
const MMPTE_HARDWARE Pml4(LocalDTB);
const uint64_t Pml4Base = Pml4.u.PageFrameNumber * Page::Size;
const uint64_t Pml4eGpa = Pml4Base + GuestAddress.u.Pml4Index * 8;
const MMPTE_HARDWARE Pml4e(PhyRead8(Pml4eGpa));
if (!Pml4e.u.Present) {
printf("Invalid page map level 4, address translation failed!\n");
return {};
}
const uint64_t PdptBase = Pml4e.u.PageFrameNumber * Page::Size;
const uint64_t PdpteGpa = PdptBase + GuestAddress.u.PdPtIndex * 8;
const MMPTE_HARDWARE Pdpte(PhyRead8(PdpteGpa));
if (!Pdpte.u.Present) {
printf("Invalid page directory pointer table, address translation "
"failed!\n");
return {};
}
//
// huge pages:
// 7 (PS) - Page size; must be 1 (otherwise, this entry references a page
// directory; see Table 4-1
//
const uint64_t PdBase = Pdpte.u.PageFrameNumber * Page::Size;
if (Pdpte.u.LargePage) {
return PdBase + (VirtualAddress & 0x3fff'ffff);
}
const uint64_t PdeGpa = PdBase + GuestAddress.u.PdIndex * 8;
const MMPTE_HARDWARE Pde(PhyRead8(PdeGpa));
if (!Pde.u.Present) {
printf("Invalid page directory entry, address translation failed!\n");
return {};
}
//
// large pages:
// 7 (PS) - Page size; must be 1 (otherwise, this entry references a page
// table; see Table 4-18
//
const uint64_t PtBase = Pde.u.PageFrameNumber * Page::Size;
if (Pde.u.LargePage) {
return PtBase + (VirtualAddress & 0x1f'ffff);
}
const uint64_t PteGpa = PtBase + GuestAddress.u.PtIndex * 8;
const MMPTE_HARDWARE Pte(PhyRead8(PteGpa));
if (!Pte.u.Present) {
printf("Invalid page table entry, address translation failed!\n");
return {};
}
const uint64_t PageBase = Pte.u.PageFrameNumber * Page::Size;
return PageBase + GuestAddress.u.Offset;
}
//
// Get the content of a virtual address.
//
const uint8_t *GetVirtualPage(const uint64_t VirtualAddress,
const uint64_t DirectoryTableBase = 0) const {
//
// First remove offset and translate the virtual address.
//
const auto &PhysicalAddress =
VirtTranslate(Page::Align(VirtualAddress), DirectoryTableBase);
if (!PhysicalAddress) {
return nullptr;
}
//
// Then get the physical page.
//
return GetPhysicalPage(*PhysicalAddress);
}
private:
//
// Utility function to read an uint64_t from a physical address.
//
uint64_t PhyRead8(const uint64_t PhysicalAddress) const {
//
// Get the physical page and read from the offset.
//
const uint8_t *PhysicalPage = GetPhysicalPage(Page::Align(PhysicalAddress));
if (!PhysicalPage) {
printf("Internal page table parsing failed!\n");
return 0;
}
const uint64_t *Ptr =
(uint64_t *)(PhysicalPage + Page::Offset(PhysicalAddress));
return *Ptr;
}
//
// Build a map of physical addresses / page data pointers for full dump.
//
bool BuildPhysmemFullDump() {
//
// Walk through the runs.
//
uint8_t *RunBase = (uint8_t *)&DmpHdr_->BmpHeader;
const uint32_t NumberOfRuns =
DmpHdr_->PhysicalMemoryBlockBuffer.NumberOfRuns;
//
// Back at it, this time building the index!
//
for (uint32_t RunIdx = 0; RunIdx < NumberOfRuns; RunIdx++) {
//
// Grab the current run as well as its base page and page count.
//
const PHYSMEM_RUN *Run = DmpHdr_->PhysicalMemoryBlockBuffer.Run + RunIdx;
const uint64_t BasePage = Run->BasePage;
const uint64_t PageCount = Run->PageCount;
//
// Walk the pages from the run.
//
for (uint64_t PageIdx = 0; PageIdx < PageCount; PageIdx++) {
//
// Compute the current PFN as well as the actual physical address of the
// page.
//
const uint64_t Pfn = BasePage + PageIdx;
const uint64_t Pa = Pfn * Page::Size;
//
// Now one thing to understand is that the Runs structure allows to skip
// for holes in memory. Instead of, padding them with empty spaces to
// conserve a 1:1 mapping between physical address and file offset, the
// Run gives you the base Pfn. This means that we don't have a 1:1
// mapping between file offset and physical addresses so we need to keep
// track of where the Run starts in memory and then we can simply access
// our pages one after the other.
//
// If this is not clear enough, here is a small example:
// Run[0]
// BasePage = 1337, PageCount = 2
// Run[1]
// BasePage = 1400, PageCount = 1
//
// In the above we clearly see that there is a hole between the two
// runs; the dump file has 2+1 memory pages. Their Pfns are: 1337+0,
// 1337+1, 1400+0.
//
// Now if we want to get the file offset of those pages we start at
// Run0:
// Run0 starts at file offset 0x2000 so Page0 is at file offset
// 0x2000, Page1 is at file offset 0x3000. Run1 starts at file offset
// 0x2000+(2*0x1000) so Page3 is at file offset
// 0x2000+(2*0x1000)+0x1000.
//
// That is the reason why the computation below is RunBase + (PageIdx *
// 0x1000) instead of RunBase + (Pfn * 0x1000).
const uint8_t *PageBase = RunBase + (PageIdx * Page::Size);
//
// Map the Pfn to a page.
//
Physmem_.try_emplace(Pa, PageBase);
}
//
// Move the run base past all the pages in the current run.
//
RunBase += PageCount * Page::Size;
}
return true;
}
//
// Build a map of physical addresses / page data pointers for BMP dump.
//
bool BuildPhysmemBMPDump() {
const uint8_t *Page = (uint8_t *)DmpHdr_ + DmpHdr_->BmpHeader.FirstPage;
const uint64_t BitmapSize = DmpHdr_->BmpHeader.Pages / 8;
const uint8_t *Bitmap = DmpHdr_->BmpHeader.Bitmap;
//
// Walk the bitmap byte per byte.
//
for (uint64_t BitmapIdx = 0; BitmapIdx < BitmapSize; BitmapIdx++) {
//
// Now walk the bits of the current byte.
//
const uint8_t Byte = Bitmap[BitmapIdx];
for (uint8_t BitIdx = 0; BitIdx < 8; BitIdx++) {
//
// If the bit is not set we just skip to the next.
//
const bool BitSet = ((Byte >> BitIdx) & 1) == 1;
if (!BitSet) {
continue;
}
//
// If the bit is one we add the page to the physmem.
//
const uint64_t Pfn = (BitmapIdx * 8) + BitIdx;
const uint64_t Pa = Pfn * Page::Size;
Physmem_.try_emplace(Pa, Page);
Page += Page::Size;
}
}
return true;
}
//
// Parse the DMP_HEADER.
//
bool ParseDmpHeader() {
//
// The base of the view points on the HEADER64.
//
DmpHdr_ = (HEADER64 *)FileMap_.ViewBase();
//
// Now let's make sure the structures look right.
//
if (!DmpHdr_->LooksGood()) {
printf("The header looks wrong.\n");
return false;
}
return true;
}
//
// Map a view of the file in memory.
//
bool MapFile() { return FileMap_.MapFile(PathFile_); }
};
} // namespace kdmpparser
|
73ef3446f69e1a9d4820df7e1eb7a21f5636bcd4
|
bea17df170e61e9ecc43010e0a5ee521c78a1c5c
|
/BinarySearchTree/NodeBST.cpp
|
51374b709852d3b4581d2ab20d64bd5afdbc81b9
|
[] |
no_license
|
AhmedHamdy-e21/Mars-Missions-Management
|
ba12ac87a64e4261d356073c685e2d3b7cb46071
|
6f5ec45b0a16b7ab5ea1b5b87f4737791e70b55e
|
refs/heads/main
| 2023-02-16T12:39:26.129595
| 2020-12-12T10:42:14
| 2020-12-12T10:42:14
| 314,981,462
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 67
|
cpp
|
NodeBST.cpp
|
//
// Created by raspberry on 2020-11-30.
//
#include "NodeBST.h"
|
0c8a288769886af996fbcd15889ebbaa8d3fc7ef
|
bdc67ddec677652859d5af62fb9be76e232064b8
|
/c++ learning/Others/2to8(1373번).cpp
|
6ad156fb5438191a7e6d1241fc0ecc2655cecf09
|
[] |
no_license
|
vvonth/Algorithm
|
e1491bf95740fb6037ae4834c7bd05d38db11c88
|
7847ffd9ae32410507b93226e424b6a3886c38ae
|
refs/heads/master
| 2023-02-16T18:31:36.631210
| 2021-01-10T03:35:25
| 2021-01-10T03:35:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 465
|
cpp
|
2to8(1373번).cpp
|
#include<iostream>
#include<algorithm>
using namespace std;
char nu[400001];
int main(void)
{
string s;
cin>>s;
int a=0;
int m=s.size();
for(int j=m-1;j>=0;j-=3)
{
if(j-1<0)
nu[a++]=(s[j]-'0');
else if(j-2<0)
nu[a++]=(s[j-1]-'0')*2+(s[j]-'0');
else
nu[a++]=(s[j-2]-'0')*4+(s[j-1]-'0')*2+(s[j]-'0');
}
for(int i=a-1;i>=0;i--)
printf("%d",nu[i]);
printf("\n");
}
|
35e526292dc2f75e583adb62ca2c78c0cb7fd903
|
9d4a4bc4af1280a5967cfe6d39f22b2e2becaac9
|
/terms/codeup/sorts/codeup/4-1-I.cpp
|
74497a74b2e8f46d4f623c2213990f379fd58051
|
[] |
no_license
|
wayne155/Algorithm
|
41bce3d7b75d802da136280e2e6f767d630aad55
|
c2df04a2a14431c314cb6715b959badc1aeb640a
|
refs/heads/master
| 2023-08-05T03:17:00.030994
| 2021-09-11T08:05:42
| 2021-09-11T08:05:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,444
|
cpp
|
4-1-I.cpp
|
//
// Created by dell on 2021/6/6.
//
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
struct Student{
char id[24];
int m; //解决的题目总数
int solved_list[10]; //解决的题号
int score; //分值
}stu[1010];
bool cmp(Student a, Student b){
if(a.score != b.score) return a.score>b.score;
else return strcmp(a.id, b.id) < 0;
}
int main(){
int n, m,g;
int up_g = 0; //高于分数线的学生数
int ms[10] = {0};
//考生输入为0时输入结束
while(cin >> n,n){
cin>> m >> g;
//题目分值
for(int i = 0; i < m; i ++){
cin >> ms[i];
}
//考生信息
for(int i =0; i < n;i ++){
stu[i].score = 0;
cin >> stu[i].id >> stu[i].m;
//题号
for(int j =0; j < stu[i].m; j++){
cin >> stu[i].solved_list[j];
stu[i].score += ms[stu[i].solved_list[j] - 1];
}
if(stu[i].score >= g){
up_g++;
}
}
sort(stu , stu +n , cmp);
printf("%d\n", up_g);
for(int i =0 ; i<n;i++){
if(stu[i].score >= g){
printf("%s %d\n", stu[i].id, stu[i].score);
}
}
up_g =0 ;
}
return 0;
}
|
ea9b8f9f94cd34a6cfd287726509d3b1346bb290
|
3897d70c8b7b16f36f67c891b187bcf900f5426a
|
/EP1/EP1/main.cpp
|
de8e231a91b1cd59996423f614134b377a897f62
|
[] |
no_license
|
NewBar/Numerico
|
f49526a6e78d802a73b1942a0ae4b92521677574
|
40d2a8ba654359f3a317745256f59a7e5d9d7f95
|
refs/heads/master
| 2020-05-30T10:50:44.445287
| 2019-06-01T03:11:39
| 2019-06-01T03:11:39
| 189,683,704
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 9,130
|
cpp
|
main.cpp
|
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <fstream>
#include "rotacao_givens.h"
#include "matriz.h"
#include "treino.h"
using namespace std;
int main() {
int tarefa, modo;
int n, m, p;
cout << "Para tarefa digite 1, para principal digite 2:";
cin >> modo;
if(modo == 1){
cout << "Entre com o numero da tarefa:" << endl;
cin >> tarefa;
if (tarefa == 1){
char item;
cout << "Entre com o item da tarefa 1" << endl;
cin >> item;
if(item == 'a'){
vector<vector<double>> w(64, vector<double>(64, 0));
vector<vector<double>> a(64, vector<double>(1, 0));
//faz as matrizes de entrada
for(int i = 0; i < static_cast<int>(w.size()); i++){
for(int j = 0; j < static_cast<int>(w[0].size()); j++){
if(i == j){
w[i][j] = 2;
}
else{
if(abs(i - j) == 1) w[i][j] = 1;
else w[i][j] = 0;
}
}
}
for(int i = 0; i < static_cast<int>(a.size()); i++){
for(int j = 0; j < static_cast<int>(a[0].size()); j++){
a[i][j] = 1;
}
}
Givens *g ;
g = new Givens(w, a);
g->fatoracao();
imprimematriz(g->h);
}
else if(item == 'b'){
vector<vector<double>> w(20, vector<double>(17, 0));
vector<vector<double>> a(20, vector<double>(1, 0));
//faz as matrizes de entrada
for(int i = 0; i < static_cast<int>(w.size()); i++){
for(int j = 0; j < static_cast<int>(w[0].size()); j++){
if(abs(i - j) <= 4) w[i][j] = (double)1/(i + j + 1);
else w[i][j] = 0;
}
}
for(int i = 0; i < static_cast<int>(a.size()); i++){
for(int j = 0; j < static_cast<int>(a[0].size()); j++){
a[i][j] = 1;
}
}
Givens *g ;
g = new Givens(w, a);
g->fatoracao();
imprimematriz(g->h);
}
else if(item == 'c'){
vector<vector<double>> w(64, vector<double>(64, 0));
vector<vector<double>> a(64, vector<double>(3, 0));
//faz as matrizes de entrada
for(int i = 0; i < static_cast<int>(w.size()); i++){
for(int j = 0; j < static_cast<int>(w[0].size()); j++){
if(i == j){
w[i][j] = 2;
}
else{
if(abs(i - j) == 1) w[i][j] = 1;
else w[i][j] = 0;
}
}
}
for(int i = 0; i < static_cast<int>(a.size()); i++){
for(int j = 0; j < static_cast<int>(a[0].size()); j++){
if(j == 0) a[i][j] = 1;
else if(j == 1) a[i][j] = i;
else if(i == 0) a[i][j] = 1;
else a[i][j] = 2*i + 1;
}
}
Givens *g ;
g = new Givens(w, a);
g->fatoracao();
imprimematriz(g->h);
}
else if(item == 'd'){
vector<vector<double>> w(20, vector<double>(17, 0));
vector<vector<double>> a(20, vector<double>(3, 0));
//faz as matrizes de entrada
for(int i = 0; i < static_cast<int>(w.size()); i++){
for(int j = 0; j < static_cast<int>(w[0].size()); j++){
if(abs(i - j) <= 4) w[i][j] = (double)1/(i + j + 1);
else w[i][j] = 0;
}
}
for(int i = 0; i < static_cast<int>(a.size()); i++){
for(int j = 0; j < static_cast<int>(a[0].size()); j++){
if(j == 0) a[i][j] = 1;
else if(j == 1) a[i][j] = i;
else if(i == 0) a[i][j] = 1;
else a[i][j] = 2*i + 1;
}
}
Givens *g ;
g = new Givens(w, a);
g->fatoracao();
imprimematriz(g->h);
}
}
else if(tarefa == 2){
cout << "Digite n:";
cin >> n;
cout << "Digite m:";
cin >> m;
cout << "Digite p:";
cin >> p;
vector<vector<double>> w(n, vector<double>(p, 0));
vector<vector<double>> a(n, vector<double>(m, 0));
vector<vector<double>> ac(n, vector<double>(m, 0));
vector<vector<double>> h(p, vector<double>(m, 0));
vector<vector<double>> at(m, vector<double>(n, 0));
vector<vector<double>> ht(m, vector<double>(p, 0));
vector<vector<double>> mult(n, vector<double>(m, 0));
//se precisar para digitar matrizes
/* cout << "Digite a matriz A:" << endl;
for (int i = 0; i < n;i++){
for(int j = 0;j < m;j++){
cin >> a[i][j];
}
} */
//matriz do enunciado
a[0] = {0.3, 0.6, 0};
a[1] = {0.5, 0, 1};
a[2] = {0.4, 0.8, 0};
ac = a;
//randomiza matriz w
srand(time(0));
for (int i = 0; i < (int)w.size();i++){
for(int j = 0;j < (int)w[0].size();j++){
w[i][j] = (rand() % 1000) + 1;;
}
}
double erro = 0;
double erroant = 10;
int cont = 0;
while((cont <= 100) && (fabs(erro - erroant) > 0.00001)){
cout << cont << endl;
cont++;
double sj = 0, sum = 0;
erroant = erro;
//normaliza w
for (int i = 0; i < (int)w.size();i++){
for(int j = 0;j < (int)w[0].size();j++){
sum += pow(w[i][j], 2.0);
}
}
sj = sqrt(sum);
for (int i = 0; i < (int)w.size();i++){
for(int j = 0;j < (int)w[0].size();j++){
if(sj != 0)
w[i][j] = (double)w[i][j] / sj;
else
{
w[i][j] = w[i][j];
}
}
}
//descobre h de wh=a
Givens *g ;
g = new Givens(w, ac);
g->fatoracao();
h = g->h;
//redefine h
for (int i = 0; i < (int)h.size();i++){
for(int j = 0;j < (int)h[0].size();j++){
if(h[i][j] < 0) h[i][j] = 0;
}
}
//transposta de a
at = transposta(ac);
//transoposta de h
ht = transposta(h);
//descobre wt de ht*wt=at
g = new Givens(ht, at);
g->fatoracao();
// transposta de wt (w)
w = transposta(g->h);
//redefine w
for (int i = 0; i < (int)w.size();i++){
for(int j = 0;j < (int)w[0].size();j++){
if(w[i][j] < 0) w[i][j] = 0;
}
}
erro = 0;
double produto = 0;
mult = multiplica(w, h);
//calcula o erro
for (int i = 0; i < (int)ac.size();i++){
for(int j = 0;j < (int)ac[0].size();j++){
produto = ac[i][j] - mult[i][j];
erro += pow(produto,2.0);
}
}
}
imprimematriz( multiplica(w, h) );
}
}
if (modo == 2){
int n_test;
Treino *t ;
cout << "Digite ndig_treino:";
cin >> m;
cout << "Digite p:";
cin >> p;
cout << "Digite n_teste:";
cin >> n_test;
//chama o modo treinamento
t = new Treino(m, p, n_test);
t->matrizA();
}
}
|
8a430080926bc3682abb693d71811cc79af58a7b
|
71fca665b684e25d7b6a1497b74242864496ed6a
|
/Algorithms/Implementation/c++/06.serviceLane.cc
|
e60322302c5f21ea6ea47436ed64f9c5e8e801fb
|
[] |
no_license
|
manojk16/hackerRank
|
64e102aa8c708c74f2efce8c237face7d36faff3
|
0e4fccc3740e6b8adfdda0cb3deb55a5393571df
|
refs/heads/master
| 2020-03-18T03:55:02.472335
| 2018-06-15T07:36:05
| 2018-06-15T07:36:05
| 134,262,191
| 0
| 0
| null | 2018-05-21T11:50:18
| 2018-05-21T11:50:18
| null |
UTF-8
|
C++
| false
| false
| 2,810
|
cc
|
06.serviceLane.cc
|
/*
Calvin is driving his favorite vehicle on the 101 freeway.
He notices that the check engine light of his vehicle is on, and he wants to service it
immediately to avoid any risks.
Luckily, a service lane runs parallel to the highway.
The length of the service lane is N units. The service lane consists of N segments of
equal length and different width.
Calvin can enter to and exit from any segment.
Let's call the entry segment as index i and the exit segment as index j.
Assume that the exit segment lies after the entry segment (i <= j) and 0 <= i.
Calvin has to pass through all segments from index i to index j (both inclusive).
Calvin has three types of vehicles - bike, car, and truck - represented by 1, 2 and 3, respectively.
These numbers also denote the width of the vehicle.
You are given an array width of length N, where width[k] represents the width of the kth segment of the service lane.
It is guaranteed that while servicing he can pass through at most 1000 segments, including the entry and exit segments.
If width[k] = 1, only the bike can pass through the kth segment.
If width[k] = 2, the bike and the car can pass through the kth segment.
If width[k] = 3, the bike and the car and the truck can pass through the kth segment.
Given the entry and exit point of Calvin's vehicle in the service lane,
output the type of the largest vehicle which can pass through the service lane
(including the entry and exit segments).
Input Format
The first line of input contains two integers, N and T, where N denotes the length of the freeway
and T the number of test cases. The next line has N space-separated integers which represent the width array.
T test cases follow. Each test case contains two integers, i and j, where i is the index of the
segment through which Calvin enters the service lane and j is the index of the lane segment
through which he exits.
Constraints
2 <= N <= 100000
1 <= T <= 1000
0 <= i < j < N
2 <= j - i + 1 <= min(N,1000)
i <= width[k] <= 3, where 0 <= k < N
Output Format
For each test case, print the number that represents the largest vehicle type that can pass through the service lane.
Note: Calvin has to pass through all segments from index i to index j (both inclusive).
Sample Input
8 5
2 3 1 2 3 2 3 3
0 3
4 6
6 7
3 5
0 7
Sample Output
1
2
3
2
1
*/
int main() {
int freewayLength;
int testCases;
cin >> freewayLength >> testCases;
vector<int> width(freewayLength);
for(int i = 0; i < freewayLength; i++){
cin >> width[i];
}
for(int testCase = 0; testCase < testCases; testCase++) {
int start;
int end;
int minWidth = 4;
cin >> start >> end;
for (int i = start; i <= end; i++) {
if (width[i] < minWidth) {
minWidth = width[i];
}
}
cout << minWidth << endl;
}
return 0;
}
|
8f984cbada1938a11019cc1a9925580138b00f6d
|
8a510c42a0661952af0098aac4824dca6a3992b5
|
/software/arduino/Main/EepromModule.ino
|
b61a26c8dfdf67a9d528474af89971bc6ecdbac0
|
[] |
no_license
|
dossiersolutions/team-bjorn
|
bedf9da0b0f506495557fd89067e1b94999b5342
|
090a9a7ec1808e42ea7bc12ec04b9dc8d56b690f
|
refs/heads/master
| 2020-04-07T20:06:16.513563
| 2018-12-07T15:04:37
| 2018-12-07T15:04:37
| 158,675,296
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,776
|
ino
|
EepromModule.ino
|
#include <EEPROM.h>
#define EEPROM_MIN_ADDR 0
#define EEPROM_MAX_ADDR 1024
#define DEBUG_EEPROM false
boolean EepromModuleWriteString(String data, int address){
if(DEBUG_EEPROM){
Serial.println();
Serial.print(F("EepromModule: Writting "));
Serial.print(data.length());
Serial.print(F(" bytes to "));
Serial.print(address);
Serial.println(F("..."));
}
char cbuff[data.length() + 1];
data.toCharArray(cbuff, data.length() + 1);
boolean done = eeprom_write_string(address, cbuff);
if(DEBUG_EEPROM){
Serial.print(F("EepromModule: Done"));
}
return done;
}
String EepromModuleReadString(int address, int length){
if(DEBUG_EEPROM){
Serial.println();
Serial.println(F("EepromModule: Reading..."));
}
char cbuff[length+1];
eeprom_read_string(address, cbuff, length+1);
String stemp(cbuff);
if(DEBUG_EEPROM){
Serial.println(stemp);
}
return stemp;
}
void EepromModuleWriteByte(byte data, int address){
if(DEBUG_EEPROM){
Serial.println();
Serial.print(F("EepromModule: Writting 1 byte to "));
Serial.print(address);
Serial.println(F("..."));
}
EEPROM.write(address, data);
}
byte EepromModuleReadByte(int address){
if(DEBUG_EEPROM){
Serial.println();
Serial.println(F("EepromModule: Reading..."));
}
byte b = EEPROM.read(address);
if(DEBUG_EEPROM){
Serial.println(b);
}
return EEPROM.read(address);
}
// Returns true if the address is between the
// minimum and maximum allowed values, false otherwise.
//
// This function is used by the other, higher-level functions
// to prevent bugs and runtime errors due to invalid addresses.
boolean eeprom_is_addr_ok(int addr) {
return ((addr >= EEPROM_MIN_ADDR) && (addr <= EEPROM_MAX_ADDR));
}
// Writes a sequence of bytes to eeprom starting at the specified address.
// Returns true if the whole array is successfully written.
// Returns false if the start or end addresses aren't between
// the minimum and maximum allowed values.
// When returning false, nothing gets written to eeprom.
boolean eeprom_write_bytes(int startAddr, const byte* array, int numBytes) {
// counter
int i;
// both first byte and last byte addresses must fall within
// the allowed range
if (!eeprom_is_addr_ok(startAddr) || !eeprom_is_addr_ok(startAddr + numBytes)) {
return false;
}
for (i = 0; i < numBytes; i++) {
EEPROM.write(startAddr + i, array[i]);
}
return true;
}
// Writes a string starting at the specified address.
// Returns true if the whole string is successfully written.
// Returns false if the address of one or more bytes fall outside the allowed range.
// If false is returned, nothing gets written to the eeprom.
boolean eeprom_write_string(int addr, const char* string) {
int numBytes; // actual number of bytes to be written
//write the string contents plus the string terminator byte (0x00)
numBytes = strlen(string) + 1;
return eeprom_write_bytes(addr, (const byte*)string, numBytes);
}
// Reads a string starting from the specified address.
// Returns true if at least one byte (even only the string terminator one) is read.
// Returns false if the start address falls outside the allowed range or declare buffer size is zero.
//
// The reading might stop for several reasons:
// - no more space in the provided buffer
// - last eeprom address reached
// - string terminator byte (0x00) encountered.
boolean eeprom_read_string(int addr, char* buffer, int bufSize) {
byte ch; // byte read from eeprom
int bytesRead; // number of bytes read so far
if (!eeprom_is_addr_ok(addr)) { // check start address
return false;
}
if (bufSize == 0) { // how can we store bytes in an empty buffer ?
return false;
}
// is there is room for the string terminator only, no reason to go further
if (bufSize == 1) {
buffer[0] = 0;
return true;
}
bytesRead = 0; // initialize byte counter
ch = EEPROM.read(addr + bytesRead); // read next byte from eeprom
buffer[bytesRead] = ch; // store it into the user buffer
bytesRead++; // increment byte counter
// stop conditions:
// - the character just read is the string terminator one (0x00)
// - we have filled the user buffer
// - we have reached the last eeprom address
while ( (ch != 0x00) && (bytesRead < bufSize) && ((addr + bytesRead) <= EEPROM_MAX_ADDR) ) {
// if no stop condition is met, read the next byte from eeprom
ch = EEPROM.read(addr + bytesRead);
buffer[bytesRead] = ch; // store it into the user buffer
bytesRead++; // increment byte counter
}
// make sure the user buffer has a string terminator, (0x00) as its last byte
if ((ch != 0x00) && (bytesRead >= 1)) {
buffer[bytesRead - 1] = 0;
}
return true;
}
|
7c20a213c862cbb811e755dbe33f2dd9d3f63036
|
c43aa45c8fb06fead80b5af8de59425d9ef3db05
|
/Project 2 - Template/Joint Project 2/MainMenu.cpp
|
a3f5121bb9aa9210f15ec408a94aa1a8d5762ff7
|
[] |
no_license
|
powerb/Practice
|
951cbcccffc627259e532e1b43522f7b1b3b881c
|
c165fc5d6b2d884eb97887a094fa468b586c2321
|
refs/heads/master
| 2022-05-24T10:10:42.860364
| 2020-05-01T15:45:11
| 2020-05-01T15:45:11
| 260,474,166
| 0
| 0
| null | 2020-05-01T14:18:41
| 2020-05-01T14:07:38
| null |
UTF-8
|
C++
| false
| false
| 3,078
|
cpp
|
MainMenu.cpp
|
#include "MainMenu.h"
/// <summary>
/// setup font and message.
///
/// Used to get a reference to the font and
/// load texture and setup sprite and text
/// for each button and positions on screen
void MainMenu::initialise(sf::Font& font)
{
m_topOffset = 50;
m_verticalSpacing = 100;
m_buttonWidth = 200;
m_leftOffset = (SCREEN_WIDTH - m_buttonWidth)/2;
m_buttonHeight = 50;
int textDropOffset = 10;
sf::String m_menuTexts[] = { "Play", "Controls", "Exit" };
m_font = font;
/// display error if button.png doesnt load properly
if (!m_buttonTexture.loadFromFile("ASSETS/IMAGES/button.png"))
{
std::cout << "error with button file";
}
/// for loop to setup menu buttons in an array
/// keeps them in a centre nicely laid out
/// scales them to texture size so they look to scale
///
for (int i = 0; i < m_optionCount; i++)
{
m_buttonSprites[i].setTexture(m_buttonTexture);
m_buttonSprites[i].setPosition(m_leftOffset, m_verticalSpacing * i + m_topOffset);
sf::Vector2u textureSize = m_buttonTexture.getSize();
m_buttonSprites[i].setScale(m_buttonWidth/textureSize.x, m_buttonHeight/textureSize.y);
// sets font up for the array of text shapes that display over the buttons
m_buttonTexts[i].setFont(m_font);
m_buttonTexts[i].setString(m_menuTexts[i]);
m_buttonTexts[i].setFillColor(sf::Color::White);
m_buttonTexts[i].setCharacterSize(24);
sf::FloatRect textSize = m_buttonTexts[i].getGlobalBounds();
float textOffset = (m_buttonWidth - textSize.width) / 2;
m_buttonTexts[i].setPosition(m_leftOffset + textOffset, m_verticalSpacing * i + m_topOffset + textDropOffset);
}
}
/// <summary>
/// check current position of the mouse for intersection with
/// location of buttons using locations and offsets rather than rectangles
/// for intersection (create said so 'imaginary' columns and rows, then mouse x/y
/// values are compared to see if they are intersecting columns' then rows' x/y values
/// </summary>
void MainMenu::update(sf::Window& window, int &t_gameMode)
{
if (sf::Mouse::isButtonPressed(sf::Mouse::Button::Left))
{
sf::Vector2i mouseLocation;
mouseLocation = sf::Mouse::getPosition(window);
if (mouseLocation.x > m_leftOffset && mouseLocation.x < m_leftOffset + m_buttonWidth )
{
if (mouseLocation.y > m_topOffset && mouseLocation.y && mouseLocation.y < m_topOffset + m_buttonHeight)
{
t_gameMode = GAME_PLAY;
}
if (mouseLocation.y > m_topOffset + m_verticalSpacing && mouseLocation.y < m_topOffset + m_verticalSpacing + m_buttonHeight)
{
t_gameMode = INSTRUCTIONS;
}
if (mouseLocation.y > m_topOffset + m_verticalSpacing * 2 && mouseLocation.y < m_topOffset + m_verticalSpacing * 2 + m_buttonHeight)
{
window.close();
}
}
}
}
/// <summary>
/// draw menu text over buttons
/// </summary>
void MainMenu::draw(sf::RenderWindow& window)
{
for (int i = 0; i < m_optionCount; i++)
{
window.draw(m_buttonSprites[i]);
window.draw(m_buttonTexts[i]);
}
}
|
fce6d1fedea254c64e4af29a20f86057381c7cb6
|
204bc4fe1d6cb71f29e7c6b579f30160107121e7
|
/Src/WorldPad/WpStylesheet.cpp
|
3f51ccb0011b836e4b9e6caccf8b33a3d0e0bd87
|
[] |
no_license
|
sillsdev/WorldPad
|
5ab38c0162e03b7652b7c238a4571774e4d0efc9
|
79762436d0b9420d1e668943ed35cdefad716227
|
refs/heads/master
| 2020-06-03T04:42:19.274488
| 2012-10-22T12:02:38
| 2012-10-22T12:03:49
| 6,078,880
| 7
| 3
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 7,393
|
cpp
|
WpStylesheet.cpp
|
/*--------------------------------------------------------------------*//*:Ignore this sentence.
Copyright (C) 2000, 2001 SIL International. All rights reserved.
Distributable under the terms of either the Common Public License or the
GNU Lesser General Public License, as specified in the LICENSING.txt file.
File: WpStylesheet.cpp
Responsibility: Sharon Correll
Last reviewed: never
Description:
This class provides an implementation of IVwStylesheet for WorldPad, which rather than
storing the styles in the database, instead writes them to an XML file.
----------------------------------------------------------------------------------------------*/
#include "Main.h"
#pragma hdrstop
#undef THIS_FILE
DEFINE_THIS_FILE
//:End Ignore
/*----------------------------------------------------------------------------------------------
Create a new object for the style, owned in the (fake) styles attribute of StText.
Return the new HVO.
----------------------------------------------------------------------------------------------*/
HRESULT WpStylesheet::GetNewStyleHVO(HVO * phvoNewStyle)
{
int cst;
CheckHr(m_qsda->get_VecSize(khvoText, kflidStText_Styles, &cst));
*phvoNewStyle = m_hvoNextStyle++;
WpDaPtr wpda = dynamic_cast<WpDa *>(m_qsda.Ptr());
HRESULT hr = wpda->CacheReplace(khvoText, kflidStText_Styles, cst, cst, phvoNewStyle, 1);
return hr;
}
/*----------------------------------------------------------------------------------------------
Initialize the stylesheet for a new window.
----------------------------------------------------------------------------------------------*/
void WpStylesheet::Init(ISilDataAccess * psda)
{
m_qsda = psda;
m_hvoNextStyle = khvoStyleMin;
AddNormalParaStyle();
}
/*----------------------------------------------------------------------------------------------
Create a paragraph style called "Normal". For now just use a minimal (ie, empty)
set of text properties.
----------------------------------------------------------------------------------------------*/
void WpStylesheet::AddNormalParaStyle()
{
WpDaPtr wpda = dynamic_cast<WpDa *>(m_qsda.Ptr());
Assert(wpda);
HVO hvoNormal;
CheckHr(GetNewStyleHVO(&hvoNormal));
ITsTextPropsPtr qttp;
ITsPropsBldrPtr qtpb;
qtpb.CreateInstance(CLSID_TsPropsBldr);
CheckHr(qtpb->GetTextProps(&qttp));
// Get a non-const version of the "Normal" string:
// REVIEW: Should the PutStyle method be made to accept const strings?
SmartBstr sbstrName(g_pszwStyleNormal);
SmartBstr sbstrUsage(g_pszwStyleNormal);
CheckHr(PutStyle(sbstrName, sbstrUsage, hvoNormal, 0, 0, kstParagraph, true,
false, qttp));
CheckHr(wpda->CacheObjProp(hvoNormal, kflidStStyle_Next, hvoNormal));
}
/*----------------------------------------------------------------------------------------------
Set the list of style objects to the (fake) styles attribute of StText.
Called from the XML import routine.
----------------------------------------------------------------------------------------------*/
HRESULT WpStylesheet::AddLoadedStyles(HVO * rghvoNew, int chvo, int hvoNextStyle)
{
int cst;
CheckHr(m_qsda->get_VecSize(khvoText, kflidStText_Styles, &cst));
WpDaPtr wpda = dynamic_cast<WpDa *>(m_qsda.Ptr());
// Note: we are clobbering any existing styles.
HRESULT hr = wpda->CacheReplace(khvoText, kflidStText_Styles, 0, cst, rghvoNew, chvo);
m_vhcStyles.Clear();
bool fFoundNormal= false;
for (int ihvo = 0; ihvo < chvo; ihvo++)
{
HvoClsid hc;
hc.clsid = kclidStStyle;
hc.hvo = rghvoNew[ihvo];
m_vhcStyles.Push(hc);
SmartBstr sbstrName;
CheckHr(m_qsda->get_UnicodeProp(hc.hvo, kflidStStyle_Name, &sbstrName));
StrUni stuName(sbstrName.Chars());
if (stuName == g_pszwStyleNormal)
fFoundNormal = true;
}
m_hvoNextStyle = max(m_hvoNextStyle, hvoNextStyle);
if (!fFoundNormal)
AddNormalParaStyle();
#if 0
// Old code for deleting only duplicates.
int cstNew;
CheckHr(m_qsda->get_VecSize(khvoText, kflidStText_Styles, &cstNew));
Assert(cstNew == cst + chvo);
// If there are any styles with duplicate names, delete the first
// (previously existing) one.
Vector<int> vihvoDelete;
Vector<StrUni> vstuStyleNames;
for (ihvo = 0; ihvo < m_vhcStyles.Size(); ihvo++)
{
SmartBstr sbstrName;
CheckHr(m_qsda->get_UnicodeProp(m_vhcStyles[ihvo].hvo, kflidStStyle_Name, &sbstrName));
StrUni stu(sbstrName.Chars());
vstuStyleNames.Push(stu);
}
Assert(vstuStyleNames.Size() == m_vhcStyles.Size());
for (ihvo = 0; ihvo < vstuStyleNames.Size() - 1; ihvo++)
{
for (int ihvo2 = ihvo + 1; ihvo2 < vstuStyleNames.Size(); ihvo2++)
{
if (vstuStyleNames[ihvo] == vstuStyleNames[ihvo2])
{
vihvoDelete.Push(ihvo);
break;
}
}
}
// Delete the duplicates; do it backwards so the indices stay valid.
for (int iihvo = vihvoDelete.Size(); --iihvo >= 0; )
{
HVO ihvoToDelete = vihvoDelete[iihvo];
m_vhcStyles.Delete(ihvoToDelete);
CheckHr(wpda->CacheReplace(khvoText, kflidStText_Styles, ihvoToDelete, ihvoToDelete+1,
NULL, 0));
}
CheckHr(m_qsda->get_VecSize(khvoText, kflidStText_Styles, &cstNew));
Assert(cstNew == cst + chvo - vihvoDelete.Size());
#endif
return hr;
}
/*----------------------------------------------------------------------------------------------
Fix up the 'next' or 'basedOn' attributes in the styles, now that we have a complete
list.
Attribute:
flid - attribute to set
hmhvostu - map containing the values ofthe attribute
----------------------------------------------------------------------------------------------*/
void WpStylesheet::FixStyleReferenceAttrs(int flid, HashMap<HVO, StrUni> & hmhvostu)
{
WpDaPtr wpda = dynamic_cast<WpDa *>(m_qsda.Ptr());
// Generate a list of all the style names.
Vector<StrUni> vstuNames;
int cst;
CheckHr(m_qsda->get_VecSize(khvoText, kflidStText_Styles, &cst));
Assert(cst == m_vhcStyles.Size());
for (int ist = 0; ist < cst; ist++)
{
SmartBstr sbstr;
CheckHr(wpda->get_UnicodeProp(m_vhcStyles[ist].hvo, kflidStStyle_Name, &sbstr));
vstuNames.Push(StrUni(sbstr.Chars()));
}
// For each style, if it has a value in the map, find the corresponding style
// and set the attribute.
for (int ist = 0; ist < cst; ist++)
{
HVO hvo = m_vhcStyles[ist].hvo;
StrUni stuRef;
if (hmhvostu.Retrieve(hvo, &stuRef))
{
for (int istTmp = 0; istTmp < cst; istTmp++)
{
if (vstuNames[istTmp] == stuRef)
{
CheckHr(wpda->CacheObjProp(hvo, flid, m_vhcStyles[istTmp].hvo));
break;
}
}
}
}
}
/*----------------------------------------------------------------------------------------------
When we have finished loading and setting up all the styles:
----------------------------------------------------------------------------------------------*/
void WpStylesheet::FinalizeStyles()
{
ComputeDerivedStyles();
}
/*----------------------------------------------------------------------------------------------
Initialize a style with an empty text properties object.
Called from the XML import routines.
----------------------------------------------------------------------------------------------*/
void WpStylesheet::AddEmptyTextProps(HVO hvoStyle)
{
WpDaPtr wpda = dynamic_cast<WpDa *>(m_qsda.Ptr());
ITsTextPropsPtr qttp;
ITsPropsBldrPtr qtpb;
qtpb.CreateInstance(CLSID_TsPropsBldr);
CheckHr(qtpb->GetTextProps(&qttp));
CheckHr(wpda->CacheUnknown(hvoStyle, kflidStStyle_Rules, qttp));
}
|
ecfad9b81be520fe688960a01aeb45e9def315ca
|
6e972d80d2739c8a606265aa90e9b2f1e55dca48
|
/TravelingSalesPerson/middleearth.h
|
bb17fb17ddcdbdfef5bd56fea55af5bf53043ff4
|
[] |
no_license
|
vrk7bp/ProgramAndDataRepresentationSpring2013
|
b9ba18328bc767d500780795ad3c86a536b239a3
|
f02892613199daa7e8fda162c195abe24c1f5221
|
refs/heads/master
| 2020-08-23T16:27:25.936468
| 2013-07-13T22:59:04
| 2013-07-13T22:59:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,898
|
h
|
middleearth.h
|
//Venkata-Gautam Kanumuru, vrk7bp, middleearth.h, April 22nd, 2013
//Provided for both the In-Lab and the Post-Lab, only doxygen comments were added.
#include <iostream>
#include <vector>
#include <string>
#include <map>
#ifndef MIDDLEEARTH_H
#define MIDDLEEARTH_H
using namespace std;
// see the comments in the lab11 write-up, or in middleearth.cpp
class MiddleEarth {
private:
int num_city_names, xsize, ysize;
vector<float> xpos, ypos;
/** @brief Vector holding all the cities in the Lord of the Rings world.
*/
vector<string> cities;
float *distances;
map<string, int> indices;
public:
/** @brief The middle earth constructor
*
* Creates the necessary MiddleEarth world based upon
* the specifications given by the parameters.
* @return Nothing, creates a MiddleEarth object.
* @param xsize The width (should be specified to 20)
* @param ysize The height (should be specified to 20)
* @param numcities The amount of cities
* @param seed A random seed that specifies the instance generated.
* @remarks This method/class is provided as part of the Pre-Lab. Its primary job is to provide a random world in which the brute force traveling salesperson solution can be applied.
* @attention This method and class were provided by Professor Aaron Bloomfield
*/
MiddleEarth (int xsize, int ysize, int numcities, int seed);
/** @brief Destructor
*
* Returns any resources previously allocated to the MiddleEarth Object.
* @return Void
* @remarks This method/class is provided as part of the Pre-Lab. It has the same function as a typical.
* @attention This method and class were provided by Professor Aaron Bloomfield
*/
~MiddleEarth();
/** @brief Prints out the statistics of the world.
*
* This function prints out the amount of cities and their respective sizes. It then
* goes through and prints out each of the cities.
* @return Void
* @remarks This method/class is provided as part of the Pre-Lab. It prints out all of the cities and specs that are being dealt with, a good method for debugging.
* @attention This method and class were provided by Professor Aaron Bloomfield
*/
void print();
/** @brief Prints out a table of the distances between all of the cities.
*
* It will be necessary to open this file in Open Office, and is
* helpful for debugging.
* @return Void
* @remarks This method/class is provided as part of the Pre-Lab. This method "exports" a file that can be read by Open Office and denotes the distance between all the cities.
* @attention This method and class were provided by Professor Aaron Bloomfield
*/
void printTable();
/** @brief Returns the distance between two specified cities.
*
* Given any two cities that are within the city field, this method
* returns the distance between the two in a float value.
* @return A float representing the distance between two cities.
* @param city1 The first city
* @param city2 The second city
* @remarks This method/class is provided as part of the Pre-Lab. This is a helpful "helper" method for retrieving the weights of each path. This will be used in the traveling
* sales person algorithm.
* @attention This method and class were provided by Professor Aaron Bloomfield
*/
float getDistance (string city1, string city2);
/** @brief Returns a vector of cities that must be visited
*
* Given a length passed into the method,
* goes through and prints out each of the cities that have to be reached.
* @return vector<string> holding all the cities that have to be reached.
* @param length representing the amount of cities that want to be reached.
* @remarks This method/class is provided as part of the Pre-Lab. This method is used for generating the cities that can be reached.
* @attention This method and class were provided by Professor Aaron Bloomfield
*/
vector<string> getItinerary(unsigned int length);
};
#endif
|
034f4937e42f679ef9e63a75a77803da6f6121a7
|
63e4f2529d171a0fd475d090e998eef0b2ee43dd
|
/src/ball.cpp
|
a3d14382c7fa0cc6bcc4d17916c222565cbe146c
|
[] |
no_license
|
Elzapat/qt-pong
|
31542e4d933594a15b13c49a313d56d83fdd1c73
|
92e3e16910a51162072386922431ebc4db411045
|
refs/heads/master
| 2023-04-28T17:40:03.955794
| 2021-05-22T13:34:11
| 2021-05-22T13:34:11
| 349,416,127
| 18
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,177
|
cpp
|
ball.cpp
|
#include "../include/ball.h"
Ball::Ball() : vx(0.f), vy(0.f), is_moving(false), ball_speed(Config::get<qreal>("ball_speed")),
QGraphicsRectItem(
0, 0,
Config::get<quint16>("ball_width"),
Config::get<quint16>("ball_height")
) {
this->setBrush(Config::get<QColor>("ball_color"));
// Initialize the sound effects
qreal sfx_volume = Config::get<qreal>("sfx_volume", "audio") / 100.0;
ball_bounce_sfx.setSource(QUrl::fromLocalFile("assets/audio/ball_bounce.wav"));
point_scored_sfx.setSource(QUrl::fromLocalFile("assets/audio/point_scored.wav"));
ball_bounce_sfx.setVolume(sfx_volume);
point_scored_sfx.setVolume(sfx_volume);
}
Ball::~Ball() {}
void Ball::move() {
if (!is_moving) return;
// Time passed since last frame
const qreal dt = 1.f / Config::get<qreal>("fps");
// Update the ball's coordinates depending on its velocity
qreal dx = vx * dt;
qreal dy = vy * dt;
this->setPos(this->x() + dx, this->y() + dy);
}
void Ball::collision(Paddle* p1, Paddle* p2) {
if (!is_moving) return;
quint16 board_w = Config::get<quint16>("board_width");
quint16 board_h = Config::get<quint16>("board_height");
quint16 ball_w = Config::get<quint16>("ball_width");
quint16 ball_h = Config::get<quint16>("ball_height");
// Check if the ball is colliding with any of the two player paddles
// If so, send it back with a different angle depending
// on where the ball collided with the paddle
if (this->collidesWithItem(p1))
generate_new_angle(p1, 1);
else if (this->collidesWithItem(p2))
generate_new_angle(p2, 2);
// Check if the ball is colliding with the top or the bottom of the board
// If so invert its y axis velocity
if (this->y() - ball_h / 2 <= -board_h / 2) {
vy = -vy;
this->setY(-board_h / 2 + ball_h / 2);
} else if (this->y() + ball_h / 2 >= board_h / 2) {
vy = -vy;
this->setY(board_h / 2 - ball_h / 2);
}
// Check if the ball is colliding with the left or the right of the board
// If so, the other player has scored
if (this->x() <= -board_w / 2) {
point_scored_sfx.play();
emit player_scored(2);
} else if (this->x() + ball_w >= board_w / 2) {
point_scored_sfx.play();
emit player_scored(1);
}
}
void Ball::generate_new_angle(Paddle* p, int player) {
// Play the Ball Bounce sound effect
ball_bounce_sfx.play();
// Speed up the ball by a certain rate in percent
// qreal ball_speed = Config::get<qreal>("ball_speed");
qreal speed_up_rate = Config::get<qreal>("ball_speed_up_rate");
ball_speed += (ball_speed / 100) * speed_up_rate;
quint16 p_h = Config::get<quint16>("paddle_height");
quint16 b_h = Config::get<quint16>("ball_height");
// Calculate the distance between the center of the paddle
// and the center of the ball on the y axis
qreal dy = (p->y() + p_h / 2) - (this->y() + b_h / 2);
// We divide the distance with half of the paddle's height
// in order to normalize it, so norm_dy will always be between
// -1 and 1
qreal norm_dy = dy / (p_h / 2);
// We get the new ball angle by multiplying the
// maximum angle with the normalized distance
qreal max_angle = Config::get<qreal>("max_bounce_angle");
qreal new_angle = norm_dy * max_angle;
// In case the new angle is somehow (it can very easily happen)
// higher than the max angle, set it to the max angle
if (new_angle > max_angle)
new_angle = max_angle;
else if (new_angle < -max_angle)
new_angle = -max_angle;
// Convert the new angle in radians
new_angle = new_angle * (M_PI / 180);
// Calculate the new ball velocity on each axis
qreal direction = p->x() > 0 ? -1 : 1;
vx = direction * ball_speed * qCos(new_angle);
vy = ball_speed * -qSin(new_angle);
emit ball_bounce_paddle(this->pos(), new_angle, player);
}
void Ball::reset(PlayerPosition new_side) {
is_moving = false;
if (new_side != PlayerPosition::Default)
side = new_side;
ball_speed = Config::get<qreal>("ball_speed");
quint16 board_w = Config::get<quint16>("board_width");
quint16 ball_h = Config::get<quint16>("ball_height");
quint16 paddle_spacing = Config::get<quint16>("paddle_spacing");
if (side == PlayerPosition::Left)
this->setPos(-board_w / 2 + paddle_spacing + 100, -ball_h / 2);
else
this->setPos(board_w / 2 - paddle_spacing - 100, -ball_h / 2);
}
void Ball::launch() {
ball_speed = Config::get<qreal>("ball_speed");
base_speed = ball_speed;
qreal max_angle = Config::get<qreal>("max_bounce_angle");
qreal random_angle = QRandomGenerator::global()->bounded(0, 2 * max_angle) - max_angle;
random_angle = random_angle * (M_PI / 180);
qint8 dir = side == PlayerPosition::Left ? 1 : -1;
vx = dir * ball_speed * qCos(random_angle);
vy = ball_speed * -qSin(random_angle);
is_moving = true;
int player = side == PlayerPosition::Left ? 1 : 2;
emit ball_bounce_paddle(this->pos(), random_angle, player);
}
bool Ball::get_is_moving() const {
return is_moving;
}
void Ball::update_new_config() {
quint16 ball_width = Config::get<quint16>("ball_width");
quint16 ball_height = Config::get<quint16>("ball_height");
quint16 new_ball_speed = Config::get<qreal>("ball_speed");
this->setRect(0, 0, ball_width, ball_height);
if (new_ball_speed != base_speed) {
qreal ratio = new_ball_speed / base_speed;
vx *= ratio;
vy *= ratio;
base_speed = new_ball_speed;
ball_speed = new_ball_speed;
}
if (!is_moving) reset();
}
void Ball::sfx_volume_changed(qreal volume) {
ball_bounce_sfx.setVolume(volume);
point_scored_sfx.setVolume(volume);
}
void Ball::color_changed() {
this->setBrush(Config::get<QColor>("ball_color"));
}
void Ball::multiplayer_resize() {
Config::set("ball_width", 15.f * (Config::get<qreal>("board_width")) / 1920.f);
Config::set("ball_height", 15.f * (Config::get<qreal>("board_height")) / 1080.f);
update_new_config();
}
|
71f43c5da45cdf7536da02eed45ba4cd7a7714ba
|
f26ef5f176c2e9d9fe3fbbc9a04e4e17a2189a48
|
/C++/LIBRAS.CyberGlove/include/vhandtk/vhtPairTable.h
|
9c1cff434fb2987c25b345521384f3addf18256d
|
[] |
no_license
|
haroldogtf/LIBRAS.CyberGlove
|
9df17fee91a3d318d0eb4161d9702eeea23fa4c8
|
a1f7fc92efce0a9221bfc2037c37b9b926bc9f0e
|
refs/heads/master
| 2021-01-15T10:06:51.297507
| 2016-05-09T02:19:32
| 2016-05-09T02:19:32
| 53,633,766
| 8
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,909
|
h
|
vhtPairTable.h
|
#ifndef VHT_PAIR_TABLE_H
#define VHT_PAIR_TABLE_H
/********************************************************************
FILE: $Id: vhtPairTable.h,v 1.11 2002/08/28 23:16:22 jsilver Exp $
AUTHOR: C. Ullrich
DATE: 1998
DESCRIPTION:
- a data structure for managing all possible collision pairs
TODO:
-
-- COPYRIGHT VIRTUAL TECHNOLOGIES, INC. 1999 --
********************************************************************/
#if defined(BUILD_WIN32_VH_DLL)
#if defined __BUILD_VH_CORE_DLL__
#define VH_CORE_DLL_EXPORT __declspec(dllexport)
#else
#define VH_CORE_DLL_EXPORT __declspec(dllimport)
#endif
#else
#define VH_CORE_DLL_EXPORT
#endif
#include <vhtArray.h>
#include <vhtSymmetricTable.h>
class vhtShape3D;
class vhtCollide;
class vhtCollisionFactory;
//: Collision pair management.
// This class stores all possible collision pairs for a particular
// collision engine. Pairs are validated using the isValidPair method
// of the vhtCollisionPair class. This class should never be used
// directly, only the vhtCollisionEngine interface should be used.
//!vhtmodule: Core
class VH_CORE_DLL_EXPORT vhtPairTable
{
public:
vhtPairTable( void );
//: Construct a pair table.
~vhtPairTable( void );
//: Destruct.
void setHandObjectOnly( bool handObjectOnly );
//: Turn on or off object-object collision detection.
//!param: handObjectOnly - Enable/disable object-object collisions.
// Passing true to this method causes the collision detection engine to only
// consider collisions between hands and objects. The default is false.
// This method is depreciated.
void addObject( vhtShape3D *object, bool forceRebuild = true );
//: Add an object to the pair table.
//!param: object - Object to add to pairTable.
//!param: forceRebuild - Force the table to be rebuilt.
void removeObject( vhtShape3D *object, bool forceRebuild = true );
//: Remove an object.
//!param: object - Remove an object from the table.
// Not implemented.
void clearTable( void );
//: Empty the pair table.
void deletePairTable( void );
//: Delete all entries in the pair table.
void buildTable( void);
//: Build all necessary data structures.
// Builds the pair table corresponding to the current list of
// added objects.
void setCollisionFactory( vhtCollisionFactory *aCollisionFactory );
//: Set the collision factory.
//!param: aCollisionFactory - The associated collision factory.
inline vhtArray *getCollisionList( void ) { return &m_collisions; }
//: Get the collision list.
// Return a list of objects that are less than the collision epslilon
// apart. Do not delete the entries in this list.
inline void setCollisionEpsilon( double epsilon )
{
if( epsilon >= 0.0 ) {
m_collisionEpsilon = epsilon;
}
}
//: Set collision reporting threshold.
//!param: epsilon - Collision proximity epsilon.
// Set the distance below which collisions are reported. Must be greater than zero.
// This value is only used if the associated collider supports distance
// information.
inline double getCollisionEpsilon( void )
{
return m_collisionEpsilon;
}
//: Get the collision reporting threshold.
void reset( void );
//: Reset the collision list.
void collisionCheck( int object1CollisionId, int object2CollisionId );
//: Do explicit collision check between two objects.
//!param: object1CollisionId - CollisionId of first object.
//!param: object2CollisionId - CollisionId of second object.
private:
vhtArray m_object;
vhtSymmetricTable m_pairs;
vhtSymmetricTable m_pairCheckCounter;
vhtArray m_collisions;
double m_collisionEpsilon;
int m_count;
bool m_handObjectOnly;
vhtCollisionFactory *m_collisionFactory;
int m_ValidPairCount;
};
#endif
|
a9cbcf2b6cfd1f3407c55ee927aee626d57e1052
|
11699e958323a73eadde7be208a10852b1675080
|
/include/cross_section_2016.h
|
95ab5be05d9c322220367e00e2e13a1d7ece4578
|
[] |
no_license
|
ywkao/tqHGG
|
b934da2de00a0e94cde462fd7ee128452ab6c77a
|
fdfd3f7fe40514738063d8c021a467d651025d4c
|
refs/heads/master
| 2023-03-26T07:39:42.523098
| 2021-03-10T16:49:51
| 2021-03-10T16:49:51
| 159,181,010
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,702
|
h
|
cross_section_2016.h
|
#ifndef __CROSS_SECTION_2016_H__
#define __CROSS_SECTION_2016_H__
#include <string>
using namespace std;
//NOTE: these are final cross section values with the branching fraction(s) taken into account.
float GetLuminosity_2016(){
return 35.92;
}
float GetXsec_2016(char* dataset){
if((string)dataset == "DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") return 5765.4;
else if((string)dataset == "DiPhotonJetsBox_MGG-80toInf_13TeV-Sherpa") return 84.0;
else if((string)dataset == "DoubleEG_B") return 1.;
else if((string)dataset == "DoubleEG_C") return 1.;
else if((string)dataset == "DoubleEG_D") return 1.;
else if((string)dataset == "DoubleEG_E") return 1.;
else if((string)dataset == "DoubleEG_F") return 1.;
else if((string)dataset == "DoubleEG_G") return 1.;
else if((string)dataset == "DoubleEG_H") return 1.;
else if((string)dataset == "GJet_Pt-20to40_DoubleEMEnriched_MGG-80toInf_TuneCUETP8M1_13TeV_Pythia8") return 232.9;
else if((string)dataset == "GJet_Pt-20toInf_DoubleEMEnriched_MGG-40to80_TuneCUETP8M1_13TeV_Pythia8") return 3186.0;
else if((string)dataset == "GJet_Pt-40toInf_DoubleEMEnriched_MGG-80toInf_TuneCUETP8M1_13TeV_Pythia8") return 878.1;
else if((string)dataset == "GluGluHToGG_M125_13TeV_amcatnloFXFX_pythia8") return 0.11;
else if((string)dataset == "QCD_Pt-30to40_DoubleEMEnriched_MGG-80toInf_TuneCUETP8M1_13TeV_Pythia8") return 24810.0;
else if((string)dataset == "QCD_Pt-40toInf_DoubleEMEnriched_MGG-80toInf_TuneCUETP8M1_13TeV_Pythia8") return 118100.0;
else if((string)dataset == "ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8") return 34.97;// to be updated
else if((string)dataset == "ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8") return 34.91;// to be updated
else if((string)dataset == "TGJets_TuneCUETP8M1_13TeV_amcatnlo_madspin_pythia8") return 2.967;// to be updated
else if((string)dataset == "THQ_ctcvcp_HToGG_M125_13TeV-madgraph-pythia8") return 1.;// to be updated
else if((string)dataset == "THW_ctcvcp_HToGG_M125_13TeV-madgraph-pythia8") return 1.;// to be updated
else if((string)dataset == "TTGG_0Jets_TuneCUETP8M1_13TeV_amcatnlo_madspin_pythia8") return 0.01687;
else if((string)dataset == "TTGJets_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8") return 3.819;
else if((string)dataset == "TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8") return 830;
else if((string)dataset == "TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8") return 0.2149;// to be updated
else if((string)dataset == "TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8") return 0.2432;// to be updated
else if((string)dataset == "VBFHToGG_M125_13TeV_amcatnlo_pythia8") return 0.0086;
else if((string)dataset == "WGToLNuG_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") return 489.0;
else if((string)dataset == "WW_TuneCUETP8M1_13TeV-pythia8") return 75.8;
else if((string)dataset == "WZ_TuneCUETP8M1_13TeV-pythia8") return 5.52;
else if((string)dataset == "ZGTo2LG_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") return 50.43;
else if((string)dataset == "ZZ_TuneCUETP8M1_13TeV-pythia8") return 3.38;
else if((string)dataset == "ttHJetToGG_M125_13TeV_amcatnloFXFX_madspin_pythia8") return 0.0016;
else return 1.;
}
float GetBranchingFraction_2016(char* dataset){
return 1.;
}
float GetTotalGenweight_2016(char* dataset){
if((string)dataset == "DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") return 1400254241336.664062;
else if((string)dataset == "DiPhotonJetsBox_MGG-80toInf_13TeV-Sherpa") return 5.55474e+07;
else if((string)dataset == "DoubleEG_B") return 1.000000;
else if((string)dataset == "DoubleEG_C") return 1.000000;
else if((string)dataset == "DoubleEG_D") return 1.000000;
else if((string)dataset == "DoubleEG_E") return 1.000000;
else if((string)dataset == "DoubleEG_F") return 1.000000;
else if((string)dataset == "DoubleEG_G") return 1.000000;
else if((string)dataset == "DoubleEG_H") return 1.000000;
else if((string)dataset == "GJet_Pt-20to40_DoubleEMEnriched_MGG-80toInf_TuneCUETP8M1_13TeV_Pythia8") return 25030146.000000;
else if((string)dataset == "GJet_Pt-20toInf_DoubleEMEnriched_MGG-40to80_TuneCUETP8M1_13TeV_Pythia8") return 1520381.000000;
else if((string)dataset == "GJet_Pt-40toInf_DoubleEMEnriched_MGG-80toInf_TuneCUETP8M1_13TeV_Pythia8") return 7149943.000000;
else if((string)dataset == "GluGluHToGG_M125_13TeV_amcatnloFXFX_pythia8") return 89212192.123418;
else if((string)dataset == "QCD_Pt-30to40_DoubleEMEnriched_MGG-80toInf_TuneCUETP8M1_13TeV_Pythia8") return 16739745.504071;
else if((string)dataset == "QCD_Pt-40toInf_DoubleEMEnriched_MGG-80toInf_TuneCUETP8M1_13TeV_Pythia8") return 20816188.000000;
else if((string)dataset == "ST_tW_antitop_5f_inclusiveDecays_13TeV-powheg-pythia8") return 6858196.000000;
else if((string)dataset == "ST_tW_top_5f_inclusiveDecays_13TeV-powheg-pythia8") return 992024.000000;
else if((string)dataset == "TGJets_TuneCUETP8M1_13TeV_amcatnlo_madspin_pythia8") return 796307.473350;
else if((string)dataset == "THQ_ctcvcp_HToGG_M125_13TeV-madgraph-pythia8") return 1980260.000000;
else if((string)dataset == "THW_ctcvcp_HToGG_M125_13TeV-madgraph-pythia8") return 799260.000000;
else if((string)dataset == "TTGG_0Jets_TuneCUETP8M1_13TeV_amcatnlo_madspin_pythia8") return 25098.827878;
else if((string)dataset == "TTGJets_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8") return 25990976.734347;
else if((string)dataset == "TTJets_TuneCUETP8M2T4_13TeV-amcatnloFXFX-pythia8") return 54866099784.715492;
else if((string)dataset == "TTWJetsToLNu_TuneCUETP8M1_13TeV-amcatnloFXFX-madspin-pythia8") return 1054697.948001;
else if((string)dataset == "TTZToLLNuNu_M-10_TuneCUETP8M1_13TeV-amcatnlo-pythia8") return 502198.859443;
else if((string)dataset == "VBFHToGG_M125_13TeV_amcatnlo_pythia8") return 7355317.204163;
else if((string)dataset == "WGToLNuG_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") return 4697824264.060372;
else if((string)dataset == "WW_TuneCUETP8M1_13TeV-pythia8") return 994032.181008;
else if((string)dataset == "WZ_TuneCUETP8M1_13TeV-pythia8") return 1000000.000000;
else if((string)dataset == "ZGTo2LG_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") return 3414602356.741301;
else if((string)dataset == "ZZ_TuneCUETP8M1_13TeV-pythia8") return 965352.000000;
else if((string)dataset == "ttHJetToGG_M125_13TeV_amcatnloFXFX_madspin_pythia8") return 198125.438385;
else return -1.;
}
#endif
//ref: https://github.com/cms-analysis/flashgg/blob/dev_legacy_runII/MetaData/data/cross_sections.json
|
ae8449634af6eda1071af093d0955fe840347c83
|
aad28fa1140e713c8591db5a383ac5f6605f743b
|
/19 Отрезок/Отрезок.cpp
|
319cd3594c9835034f325c46c10ab8de09d18fa8
|
[] |
no_license
|
DaniilMuntyan/Solutions_e-olymp
|
d7ad45357d4f999c853efefcd47c39bc17e33664
|
7a318572e13f2e6103a2ade49c8ce9c5210caad9
|
refs/heads/master
| 2021-02-28T15:22:58.506994
| 2020-03-07T21:42:50
| 2020-03-07T21:42:50
| 245,708,666
| 3
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 361
|
cpp
|
Отрезок.cpp
|
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b)
{
if(a==0 || b == 0)
return a+b;
if(a > b)
return gcd(a%b,b);
else
return gcd(a,b%a);
}
int main()
{
long long x1,x2,y1,y2,res;
cin >> x1 >> y1 >> x2 >> y2;
res = gcd(abs(x2 - x1), abs(y2 - y1)) + 1;
cout << res << endl;
}
|
af08a45ad34f3d75f5345220398f8b5c73ffacd9
|
d0e4275244e0eba2b0c1fc2c518e04f0212e3bac
|
/uva/good_colum.cpp
|
a8e69df51eda835702e4db7226a0c342d8b1a5ab
|
[] |
no_license
|
IamYourAlpha/CONTEST-CODES
|
0b34ba29ef7cfa725539c069bc8a1e3ba5b8e54f
|
e8b12e08af53fcff4bdc08cc7a42eecd5598a83d
|
refs/heads/master
| 2021-06-08T13:00:35.511893
| 2021-02-26T07:44:45
| 2021-02-26T07:44:45
| 97,600,150
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 630
|
cpp
|
good_colum.cpp
|
#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, ans;
string s[1001];
bool b[1001], z;
void solve(){
scanf("%d %d", &n, &m);
for(i = 0 ; i < n ; i ++){
cin >> s[i];
}
b[0] = !b[0];
for(i = 0 ; i < m ; i ++){
z = 0;
for(j = 0 ; j < n-1 ; j ++){
if(!b[j+1])
if(s[j][i] > s[j+1][i]){
z = true;
break;
}
}
if(z) ans ++;
else {
for(j = 0 ; j < n-1 ; j ++){
if(!b[j+1])
if(s[j][i] < s[j+1][i]){
b[j+1] = true;
}
}
}
}
printf("%d", ans);
}
int main(){
solve();
}
|
145c06292307a0f3a105d2f259fbda60301303c6
|
c1b03b59b3974058e3dc4e3aa7a46a7ab9cc3b29
|
/src/module-doxygen/Class_structure.cpp
|
6e3b6f8fbc4014ac9e4f705a4f123ea384f831da
|
[] |
no_license
|
gura-lang/gura
|
972725895c93c22e0ec87c17166df4d15bdbe338
|
03aff5e2b7fe4f761a16400ae7cc6fa7fec73a47
|
refs/heads/master
| 2021-01-25T08:04:38.269289
| 2020-05-09T12:42:23
| 2020-05-09T12:42:23
| 7,141,465
| 25
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,811
|
cpp
|
Class_structure.cpp
|
//=============================================================================
// Class_structure.cpp
//=============================================================================
#include "stdafx.h"
Gura_BeginModuleScope(doxygen)
//-----------------------------------------------------------------------------
// Object_structure
//-----------------------------------------------------------------------------
Object_structure::~Object_structure()
{
}
Object *Object_structure::Clone() const
{
return nullptr;
}
String Object_structure::ToString(bool exprFlag)
{
String rtn;
rtn += "<doxygen.structure";
do {
char buff[32];
::sprintf(buff, ":%ldelems", _pStructure->GetElemOwner().size());
rtn += buff;
} while (0);
rtn += ">";
return rtn;
}
//-----------------------------------------------------------------------------
// Implementation of properties
//-----------------------------------------------------------------------------
// doxygen.structure#aftermember
Gura_DeclareProperty_R(structure, aftermember)
{
SetPropAttr(VTYPE_boolean);
AddHelp(
Gura_Symbol(en),
""
);
}
Gura_ImplementPropertyGetter(structure, aftermember)
{
Structure *pStructure = Object_structure::GetObject(valueThis)->GetStructure();
return Value(pStructure->GetAfterMemberFlag());
}
// doxygen.structure#source
Gura_DeclareProperty_R(structure, source)
{
SetPropAttr(VTYPE_string);
AddHelp(
Gura_Symbol(en),
""
);
}
Gura_ImplementPropertyGetter(structure, source)
{
Structure *pStructure = Object_structure::GetObject(valueThis)->GetStructure();
return Value(pStructure->GetSource());
}
//----------------------------------------------------------------------------
// Constructor
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Methods
//----------------------------------------------------------------------------
// doxygen.structure#elems() {block?}
Gura_DeclareMethod(structure, elems)
{
SetFuncAttr(VTYPE_any, RSLTMODE_Normal, FLAG_Map);
DeclareBlock(OCCUR_ZeroOrOnce);
AddHelp(
Gura_Symbol(en),
"Creates an iterator that returns `doxygen.elem` instances of all the elements contained in the structure.\n"
"\n"
GURA_HELPTEXT_ITERATOR_en());
}
Gura_ImplementMethod(structure, elems)
{
const Structure *pStructure = Object_structure::GetObjectThis(arg)->GetStructure();
AutoPtr<Iterator> pIterator(
new Iterator_Elem(pStructure->GetElemOwner().Reference()));
return ReturnIterator(env, arg, pIterator.release());
}
// doxygen.structure#substructures() {block?}
Gura_DeclareMethod(structure, substructures)
{
SetFuncAttr(VTYPE_any, RSLTMODE_Normal, FLAG_None);
DeclareBlock(OCCUR_ZeroOrOnce);
AddHelp(
Gura_Symbol(en),
"Creates an iterator that returns `doxygen.structure` instances of sub structures contained in the structure.\n"
"\n"
GURA_HELPTEXT_ITERATOR_en());
}
Gura_ImplementMethod(structure, substructures)
{
const Structure *pStructure = Object_structure::GetObjectThis(arg)->GetStructure();
AutoPtr<Iterator> pIterator(
new Iterator_Structure(pStructure->GetStructureOwner().Reference()));
return ReturnIterator(env, arg, pIterator.release());
}
//-----------------------------------------------------------------------------
// Class implementation for doxygen.structure
//-----------------------------------------------------------------------------
Gura_ImplementUserClass(structure)
{
// Assignment of properties
Gura_AssignProperty(structure, aftermember);
Gura_AssignProperty(structure, source);
// Assignment of methods
Gura_AssignMethod(structure, elems);
Gura_AssignMethod(structure, substructures);
// Assignment of value
Gura_AssignValue(structure, Value(Reference()));
}
Gura_EndModuleScope(doxygen)
|
f488bc8abd301af81db83ed56e3d621827b5d100
|
79dd7d57e2cac14e8a948268605e1be0e74a7d25
|
/move_arm_warehouse/src/trajectory_stats.cpp
|
63047bc40acdd37ca01f2807fc97a4fd054d40cb
|
[] |
no_license
|
shaun-edwards/arm_navigation_experimental
|
2f473a6683a2dd9b38f7b1765f6e0bb2ddf5cb7e
|
f4ccaf716962fe8e356c87c00984cf6510a1783b
|
refs/heads/master
| 2021-01-24T23:01:17.125537
| 2014-09-04T04:01:15
| 2014-09-04T04:01:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,886
|
cpp
|
trajectory_stats.cpp
|
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2011, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Willow Garage nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*
*********************************************************************/
/* \author: Ken Anderson */
#include <cmath>
#include <move_arm_warehouse/move_arm_utils.h>
#include <move_arm_warehouse/trajectory_stats.h>
using namespace std;
using namespace planning_scene_utils;
using namespace planning_models;
ros::Duration TrajectoryStats::getExecutionDuration()
{
size_t tsize = trajectory_.points.size();
if( tsize < 1 )
{
return ros::Duration(0,0);
}
trajectory_msgs::JointTrajectoryPoint& point1 = trajectory_.points[0];
trajectory_msgs::JointTrajectoryPoint& point2 = trajectory_.points[tsize-1];
return point2.time_from_start - point1.time_from_start;
}
double TrajectoryStats::getAngularDistance()
{
double angular_diff_sum = 0.0;
size_t tsize = trajectory_.points.size();
// Loop through trajectory points
for(unsigned int i=1; i<tsize; i++)
{
trajectory_msgs::JointTrajectoryPoint point1 = trajectory_.points[i-1];
trajectory_msgs::JointTrajectoryPoint point2 = trajectory_.points[i];
if(point1.positions.size() != point2.positions.size())
{
ROS_ERROR("Invalid Trajectory, the number of joints is inconsistent");
return 0.0;
}
// Loop through all joints
size_t num_pos = point1.positions.size();
for(unsigned int j=0; j<num_pos; j++)
{
double angular_diff = point1.positions[j] - point2.positions[j];
angular_diff_sum += abs(angular_diff);
}
}
return angular_diff_sum;
}
double TrajectoryStats::getCartesianDistance(planning_scene_utils::MotionPlanRequestData& motion_plan_req)
{
double cartesian_distance_sum = 0.0;
planning_models::KinematicState* kin_state = motion_plan_req.getStartState();
KinematicState::JointStateGroup* joint_state_group = kin_state->getJointStateGroup(motion_plan_req.getGroupName());
// Loop through trajectory points
size_t tsize = trajectory_.points.size();
for(unsigned int i=1; i<tsize; i++)
{
// Get position of end-effector at the first point of the trajectory.
trajectory_msgs::JointTrajectoryPoint point1 = trajectory_.points[i-1];
if( !joint_state_group->setKinematicState(point1.positions) )
{
ROS_ERROR("Mismatch in number of joints.");
return 0.0;
}
joint_state_group->updateKinematicLinks();
KinematicState::LinkState* end_effector_state1 = kin_state->getLinkState(motion_plan_req.getEndEffectorLink());
const tf::Transform& end_effector_transform1 = end_effector_state1->getGlobalLinkTransform();
const tf::Vector3 end_effector_location1 = end_effector_transform1.getOrigin();
// Get position of end-effector at the next point of the trajectory.
trajectory_msgs::JointTrajectoryPoint point2 = trajectory_.points[i];
if( !joint_state_group->setKinematicState(point2.positions) )
{
ROS_ERROR("Mismatch in number of joints.");
return 0.0;
}
joint_state_group->updateKinematicLinks();
KinematicState::LinkState* end_effector_state2 = kin_state->getLinkState(motion_plan_req.getEndEffectorLink());
const tf::Transform& end_effector_transform2 = end_effector_state2->getGlobalLinkTransform();
const tf::Vector3 end_effector_location2 = end_effector_transform2.getOrigin();
// Calculate
double cartesian_distance = end_effector_location1.distance(end_effector_location2);
cartesian_distance_sum += abs(cartesian_distance);
}
return cartesian_distance_sum;
}
/*
double TrajectoryStats::getClearanceDistance(planning_scene_utils::PlanningSceneData& scene)
{
return 0;
}
*/
double TrajectoryStats::getMaxAngularError(trajectory_msgs::JointTrajectory& trajectory_error)
{
double max_error = 0.0;
// Loop through trajectory points
size_t tsize = trajectory_error.points.size();
for(unsigned int i=0; i<tsize; i++)
{
trajectory_msgs::JointTrajectoryPoint& point = trajectory_error.points[i];
// Loop through all joints
size_t num_pos = point.positions.size();
for(unsigned int j=0; j<num_pos; j++)
{
double error = abs(point.positions[j]);
if(error>max_error)
{
max_error = error;
}
}
}
return max_error;
}
|
364113d74b44e71e6c92fc99868b64f1669d2f23
|
379c42365ee91f04cff3a83a21489f7a59b46694
|
/src/all_mods.cpp
|
6d5910ca0b3b614b14aa93533b1b604e7bfaf32f
|
[
"MIT"
] |
permissive
|
Cyclic3/murk
|
d75ed0358983066b32e7fa719a5e25ca132c5c14
|
fd2f71a4b258be71ef828f1223ddb76cc4ec8254
|
refs/heads/master
| 2020-07-01T18:33:56.963381
| 2020-01-31T16:19:50
| 2020-01-31T16:19:50
| 201,256,850
| 2
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,746
|
cpp
|
all_mods.cpp
|
#define MURK_MOD_MAKE_NAME_INTERNAL(A, B, C) A##B##C
#define MURK_MOD_MAKE_NAME(A, B, C) MURK_MOD_MAKE_NAME_INTERNAL(A,B,C)
#define MURK_MOD_REGISTER(MOD, ...) \
void __attribute__((constructor)) MURK_MOD_MAKE_NAME(_,__COUNTER__,_mod_register)() { ::murk::mod::manager::register_path(MOD, __VA_ARGS__); }
#include "murk/mod.hpp"
#include "murk/filt/zealous.hpp"
#include "murk/priv/docker.hpp"
#include "murk/priv/sbin.hpp"
#include "murk/priv/sbin.hpp"
#include "murk/web/uri.hpp"
#include "murk/web/ssti.hpp"
#include "murk/crypto/hash.hpp"
namespace murk {
MURK_MOD_REGISTER(mod::adapt_simple_func_print([](auto... args) {
system(murk::mod::module::root().act(args...).value().c_str());
return std::nullopt;
}), {"shelldo"});
MURK_MOD_REGISTER(mod::adapt_simple_func_print([](std::string args) {
return args;
}), {"echo"});
namespace priv {
MURK_MOD_REGISTER(mod::adapt_default_func_print([](auto... args){return docker(args...);}), {"priv", "docker"});
MURK_MOD_REGISTER(mod::adapt_default_func_print([](auto... args){return nmap(args...);}), {"priv", "nmap"});
}
namespace filt {
MURK_MOD_REGISTER(mod::adapt_default_func_print([](auto... args) -> std::optional<std::string> {
if constexpr (sizeof...(args) == 0) {
std::string s;
if (std::getline(std::cin, s))
return zealous_escape_c(s);
else
return std::nullopt;
}
else {
return zealous_escape_c(args...);
}
}), {"filt", "escape_c"});
}
namespace web {
MURK_MOD_REGISTER(mod::adapt_default_func_print([](auto... args) -> std::optional<std::string> {
if constexpr (sizeof...(args) == 0) {
std::string s;
if (std::getline(std::cin, s))
return flask(s);
else
return std::nullopt;
}
else {
return flask(args...);
}
}), {"web", "flask"});
MURK_MOD_REGISTER(mod::adapt_default_func_print([](auto... args) -> std::optional<std::string> {
if constexpr (sizeof...(args) == 0) {
std::string s;
if (std::getline(std::cin, s))
return uri::encode(s);
else
return std::nullopt;
}
else {
return uri::encode(args...);
}
}), {"web", "uriencode"});
MURK_MOD_REGISTER(mod::adapt_simple_func_print([](std::string args) -> std::optional<std::string> {
return uri::encode(murk::mod::module::root().act(args).value());
}), {"web", "uriencodedo"});
MURK_MOD_REGISTER(mod::adapt_simple_func_print([](std::string uri) -> std::optional<std::string> {
murk::interactive([&](std::string line) { return flask_get(uri, line); });
return std::nullopt;
}), {"web", "flask_get"});
}
}
|
8094e55d5c7eb56ffaed8212e7a77af164ce48ce
|
57941eaa60dad87c7a1b25f5fb83b252f5c30076
|
/宝探しゲーム/宝探し/Hard.cpp
|
65f8854a15d3a9ff3192d09f54d90192689e538f
|
[
"BSD-3-Clause"
] |
permissive
|
Dhikigame/games
|
8e25f6d71527c3ba85f4721e3d2f4797417159df
|
7a8af5e50deb130bb34a00d3b529a1daa5ec4d29
|
refs/heads/master
| 2021-01-10T19:14:23.271724
| 2015-07-10T12:58:10
| 2015-07-10T12:58:10
| 37,386,188
| 2
| 0
| null | null | null | null |
SHIFT_JIS
|
C++
| false
| false
| 18,661
|
cpp
|
Hard.cpp
|
#include "GV.h"
void Hard(){
if (boxcount == 0){
for (i = 0; i <= 3; i++){
for (j = 0; j <= 3; j++){
boxstoreH[i][j] = box;//1ゲームごとに初期に”閉じた宝箱”をセット
}
}
}
DrawRotaGraph(320, 240, 1.0, 0.0, Draw2, TRUE);
/*
宝箱を描画 右が配列の場合の配置
□ □ □ □ [0][0] [0][1] [0][2] [0][3]
□ □ □ □ [1][0] [1][1] [1][2] [1][3]
□ □ □ □ [2][0] [2][1] [2][2] [2][3]
□ □ □ □ [3][0] [3][1] [3][2] [3][3]
*/
for (i = 0; i <= 3; i++){
k = 100 * i;
for (j = 0; j <= 3; j++){
l = 150 * j;
if (j == 0)
DrawRotaGraph(90 + l, 70 + k, 0.6, 0.0, boxstoreH[i][j], TRUE);
if (j == 1)
DrawRotaGraph(90 + l, 70 + k, 0.6, 0.0, boxstoreH[i][j], TRUE);
if (j == 2)
DrawRotaGraph(90 + l, 70 + k, 0.6, 0.0, boxstoreH[i][j], TRUE);
if (j == 3)
DrawRotaGraph(90 + l, 70 + k, 0.6, 0.0, boxstoreH[i][j], TRUE);
}
}
//デバッグ用 Boxsetのランダム配置
/*
if (Key[KEY_INPUT_A] == 1){
BoxsetH();
}
*/
//RSHIFTキーでタイトルに戻る
if (Key[KEY_INPUT_RSHIFT] == 1){
init();
}
DrawRotaGraph(x, y, 1.0, 0.0, Handle, TRUE);
/*
DrawFormatString(50, 450, Green, "座標[%d,%d]", x, y);
DrawFormatString(250, 410, White, "%d %d %d %d", boxopenH[0][0], boxopenH[0][1], boxopenH[0][2], boxopenH[0][3]);
DrawFormatString(250, 430, White, "%d %d %d %d", boxopenH[1][0], boxopenH[1][1], boxopenH[1][2], boxopenH[1][3]);
DrawFormatString(250, 450, White, "%d %d %d %d", boxopenH[2][0], boxopenH[2][1], boxopenH[2][2], boxopenH[2][3]);
DrawFormatString(250, 470, White, "%d %d %d %d", boxopenH[3][0], boxopenH[3][1], boxopenH[3][2], boxopenH[3][3]);
DrawFormatString(330, 460, White, "%d %d", i, j);
*/
DrawFormatString(280, 20, Green, "%s", infor);//ヒント出力 近くに反応!または遠くに反応!
DrawFormatString(35, 415, White, "%d/10回目", gamecount);//10回ゲーム行ったときの何回か
DrawFormatString(35, 435, White, "おてつき %d/2", ote);//おてつきは2回まで(実装変更されました)
DrawFormatString(550, 420, White, "スコア");//スコア出力
DrawFormatString(550, 440, White, "%d", score.total);//スコア出力
//1はyesboxのときの乱数、0はnoboxのときの乱数(かんたんとは実装が違う)
if (boxKeystoreH[0][0] == 0)
DrawStringToHandle(70, 35, "1キー", White, FontBoxHandleH);
else if (boxKeystoreH[0][0] == 1)
DrawStringToHandle(70, 25, "1キー", White, FontBoxHandleH);
if (boxKeystoreH[0][1] == 0)
DrawStringToHandle(220, 35, "2キー", White, FontBoxHandleH);
else if (boxKeystoreH[0][1] == 1)
DrawStringToHandle(220, 25, "2キー", White, FontBoxHandleH);
if (boxKeystoreH[0][2] == 0)
DrawStringToHandle(370, 35, "3キー", White, FontBoxHandleH);
else if (boxKeystoreH[0][2] == 1)
DrawStringToHandle(370, 25, "3キー", White, FontBoxHandleH);
if (boxKeystoreH[0][3] == 0)
DrawStringToHandle(520, 35, "4キー", White, FontBoxHandleH);
else if (boxKeystoreH[0][3] == 1)
DrawStringToHandle(520, 25, "4キー", White, FontBoxHandleH);
if (boxKeystoreH[1][0] == 0)
DrawStringToHandle(70, 135, "Qキー", White, FontBoxHandleH);
else if (boxKeystoreH[1][0] == 1)
DrawStringToHandle(70, 125, "Qキー", White, FontBoxHandleH);
if (boxKeystoreH[1][1] == 0)
DrawStringToHandle(220, 135, "Wキー", White, FontBoxHandleH);
else if (boxKeystoreH[1][1] == 1)
DrawStringToHandle(220, 125, "Wキー", White, FontBoxHandleH);
if (boxKeystoreH[1][2] == 0)
DrawStringToHandle(370, 135, "Eキー", White, FontBoxHandleH);
else if (boxKeystoreH[1][2] == 1)
DrawStringToHandle(370, 125, "Eキー", White, FontBoxHandleH);
if (boxKeystoreH[1][3] == 0)
DrawStringToHandle(520, 135, "Rキー", White, FontBoxHandleH);
else if (boxKeystoreH[1][3] == 1)
DrawStringToHandle(520, 125, "Rキー", White, FontBoxHandleH);
if (boxKeystoreH[2][0] == 0)
DrawStringToHandle(70, 235, "Aキー", White, FontBoxHandleH);
else if (boxKeystoreH[2][0] == 1)
DrawStringToHandle(70, 225, "Aキー", White, FontBoxHandleH);
if (boxKeystoreH[2][1] == 0)
DrawStringToHandle(220, 235, "Sキー", White, FontBoxHandleH);
else if (boxKeystoreH[2][1] == 1)
DrawStringToHandle(220, 225, "Sキー", White, FontBoxHandleH);
if (boxKeystoreH[2][2] == 0)
DrawStringToHandle(370, 235, "Dキー", White, FontBoxHandleH);
else if (boxKeystoreH[2][2] == 1)
DrawStringToHandle(370, 225, "Dキー", White, FontBoxHandleH);
if (boxKeystoreH[2][3] == 0)
DrawStringToHandle(520, 235, "Fキー", White, FontBoxHandleH);
else if (boxKeystoreH[2][3] == 1)
DrawStringToHandle(520, 225, "Fキー", White, FontBoxHandleH);
if (boxKeystoreH[3][0] == 0)
DrawStringToHandle(70, 335, "Zキー", White, FontBoxHandleH);
else if (boxKeystoreH[3][0] == 1)
DrawStringToHandle(70, 325, "Zキー", White, FontBoxHandleH);
if (boxKeystoreH[3][1] == 0)
DrawStringToHandle(220, 335, "Xキー", White, FontBoxHandleH);
else if (boxKeystoreH[3][1] == 1)
DrawStringToHandle(220, 325, "Xキー", White, FontBoxHandleH);
if (boxKeystoreH[3][2] == 0)
DrawStringToHandle(370, 335, "Cキー", White, FontBoxHandleH);
else if (boxKeystoreH[3][2] == 1)
DrawStringToHandle(370, 325, "Cキー", White, FontBoxHandleH);
if (boxKeystoreH[3][3] == 0)
DrawStringToHandle(520, 335, "Vキー", White, FontBoxHandleH);
else if (boxKeystoreH[3][3] == 1)
DrawStringToHandle(520, 325, "Vキー", White, FontBoxHandleH);
//それぞれキーで選択したときyesboxかnoboxか判定し、おてつきの場合はinforでヒント出す
if (Key[KEY_INPUT_1] == 1 && boxflag == 0){
if (boxopenH[0][0] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[0][0] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[0][0] == 0){
boxstoreH[0][0] = nobox;
}
boxcount++;
boxKeystoreH[0][0] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_1] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[0][1] == 1 || boxopenH[1][0] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[0][0] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_2] == 1 && boxflag == 0){
if (boxopenH[0][1] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[0][1] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[0][1] == 0){
boxstoreH[0][1] = nobox;
}
boxcount++;
boxKeystoreH[0][1] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_2] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[0][0] == 1 || boxopenH[1][1] == 1 || boxopenH[0][2] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[0][1] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_3] == 1 && boxflag == 0){
if (boxopenH[0][2] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[0][2] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[0][2] == 0){
boxstoreH[0][2] = nobox;
}
boxcount++;
boxKeystoreH[0][2] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_3] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[0][1] == 1 || boxopenH[1][2] == 1 || boxopenH[0][3] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[0][2] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_4] == 1 && boxflag == 0){
if (boxopenH[0][3] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[0][3] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[0][3] == 0){
boxstoreH[0][3] = nobox;
}
boxcount++;
boxKeystoreH[0][3] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_4] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[0][2] == 1 || boxopenH[1][3] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[0][3] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_Q] == 1 && boxflag == 0){
if (boxopenH[1][0] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[1][0] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[1][0] == 0){
boxstoreH[1][0] = nobox;
}
boxcount++;
boxKeystoreH[1][0] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_Q] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[0][0] == 1 || boxopenH[1][1] == 1 || boxopenH[2][0] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[1][0] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_W] == 1 && boxflag == 0){
if (boxopenH[1][1] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[1][1] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[1][1] == 0){
boxstoreH[1][1] = nobox;
}
boxcount++;
boxKeystoreH[1][1] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_W] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[0][1] == 1 || boxopenH[1][0] == 1 || boxopenH[2][1] == 1 || boxopenH[1][2] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[1][1] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_E] == 1 && boxflag == 0){
if (boxopenH[1][2] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[1][2] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[1][2] == 0){
boxstoreH[1][2] = nobox;
}
boxcount++;
boxKeystoreH[1][2] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_E] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[0][2] == 1 || boxopenH[1][1] == 1 || boxopenH[2][2] == 1 || boxopenH[1][3] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[1][2] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_R] == 1 && boxflag == 0){
if (boxopenH[1][3] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[1][3] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[1][3] == 0){
boxstoreH[1][3] = nobox;
}
boxcount++;
boxKeystoreH[1][3] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_R] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[1][2] == 1 || boxopenH[0][3] == 1 || boxopenH[2][3] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[1][3] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_A] == 1 && boxflag == 0){
if (boxopenH[2][0] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[2][0] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[2][0] == 0){
boxstoreH[2][0] = nobox;
}
boxcount++;
boxKeystoreH[2][0] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_A] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[1][0] == 1 || boxopenH[2][1] == 1 || boxopenH[3][0] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[2][0] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_S] == 1 && boxflag == 0){
if (boxopenH[2][1] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[2][1] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[2][1] == 0){
boxstoreH[2][1] = nobox;
}
boxcount++;
boxKeystoreH[2][1] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_S] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[2][0] == 1 || boxopenH[1][1] == 1 || boxopenH[3][1] == 1 || boxopenH[2][2] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[2][1] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_D] == 1 && boxflag == 0){
if (boxopenH[2][2] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[2][2] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[2][2] == 0){
boxstoreH[2][2] = nobox;
}
boxcount++;
boxKeystoreH[2][2] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_D] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[2][1] == 1 || boxopenH[1][2] == 1 || boxopenH[2][3] == 1 || boxopenH[3][2] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[2][2] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_F] == 1 && boxflag == 0){
if (boxopenH[2][3] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[2][3] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[2][3] == 0){
boxstoreH[2][3] = nobox;
}
boxcount++;
boxKeystoreH[2][3] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_F] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[2][2] == 1 || boxopenH[1][3] == 1 || boxopenH[3][3] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[2][3] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_Z] == 1 && boxflag == 0){
if (boxopenH[3][0] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[3][0] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[3][0] == 0){
boxstoreH[3][0] = nobox;
}
boxcount++;
boxKeystoreH[3][0] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_Z] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[2][0] == 1 || boxopenH[3][1] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[3][0] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_X] == 1 && boxflag == 0){
if (boxopenH[3][1] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[3][1] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[3][1] == 0){
boxstoreH[3][1] = nobox;
}
boxcount++;
boxKeystoreH[3][1] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_X] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[3][0] == 1 || boxopenH[2][1] == 1 || boxopenH[3][2] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[3][1] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_C] == 1 && boxflag == 0){
if (boxopenH[3][2] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[3][2] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[3][2] == 0){
boxstoreH[3][2] = nobox;
}
boxcount++;
boxKeystoreH[3][2] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_C] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[3][1] == 1 || boxopenH[2][2] == 1 || boxopenH[3][3] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[3][2] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
if (Key[KEY_INPUT_V] == 1 && boxflag == 0){
if (boxopenH[3][3] == 1){
PlaySoundMem(boxfoundsound, DX_PLAYTYPE_BACK, TRUE);
boxstoreH[3][3] = yesbox;
yes = 1;
score.flag = 1;
}
if (boxopenH[3][3] == 0){
boxstoreH[3][3] = nobox;
}
boxcount++;
boxKeystoreH[3][3] = 1;
if (boxcount >= 1 && boxcount <= 2 && Key[KEY_INPUT_V] == 1){
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
if (boxopenH[3][2] == 1 || boxopenH[2][3] == 1){
infor = "近くに反応!"; //ote++;
}
else if (boxopenH[3][3] == 1)
infor = " ";
else
infor = "遠くに反応!"; ote++;
}
}
//yesbox見つけた場合とおてつきすべて使って見つからなかった場合に文字列を出力
if (yes == 1 && boxcount == 1 && x >= -99999 && y >= -99999){
boxflag = 1;
if (boxcount == 1 && score.flag == 1){
score.boxcount = 1;
Score();
}
score.flag = 0;
DrawFormatString(200, 450, Green, "宝箱発見!(Enterキーで進む)");
if (Key[KEY_INPUT_RETURN] == 1){
BoxsetH();
boxcount = 0;
boxflag = 0;
yes = 0;
hit++;
gamecount++;
ote = 0;
infor = " ";
musicstop = 0;
for (i = 0; i <= 3; i++){
for (j = 0; j <= 3; j++){
boxKeystoreN[i][j] = 0;//宝箱を開けたときに"○キー"の位置を変更する配列(ふつう用)
}
}
}
}
if (yes == 1 && boxcount >= 2 && boxcount <= 3 && x >= -99999 && y >= -99999){
boxflag = 1;
if (boxcount == 2 && score.flag == 1){
score.boxcount = 2;
Score();
}
if (boxcount == 3 && score.flag == 1){
score.boxcount = 3;
Score();
}
score.flag = 0;
DrawFormatString(200, 450, Green, "宝箱は見つかったよ!(Enterキーで進む)");
if (Key[KEY_INPUT_RETURN] == 1){
BoxsetH();
boxcount = 0;
boxflag = 0;
yes = 0;
hit++;
gamecount++;
ote = 0;
infor = " ";
musicstop = 0;
for (i = 0; i <= 3; i++){
for (j = 0; j <= 3; j++){
boxKeystoreN[i][j] = 0;//宝箱を開けたときに"○キー"の位置を変更する配列(ふつう用)
}
}
}
}
if (yes == 0 && boxcount == 3 && x >= -99999 && y >= -99999){
if (musicstop == 0)
PlaySoundMem(boxopensound, DX_PLAYTYPE_BACK, TRUE);
boxflag = 1;
musicstop = 1;
DrawFormatString(200, 450, Green, "宝箱は見つからなかった・・・(Enterキーで進む)");
if (Key[KEY_INPUT_RETURN] == 1){
BoxsetH();
boxcount = 0;
boxflag = 0;
yes = 0;
ote = 0;
gamecount++;
infor = " ";
musicstop = 0;
for (i = 0; i <= 3; i++){
for (j = 0; j <= 3; j++){
boxKeystoreH[i][j] = 0;//宝箱を開けたときに"○キー"の位置を変更する配列(むずかしい用)
}
}
}
}
if (gamecount == 11){
Menucount = 5;
}
}
|
ba012aa5fb5f91e6a2883d85584d41a53a8ffd83
|
7addc813ddaa31ed381f1d2f9fa94a7915857fea
|
/Data Structures/Linear/Linked List/question7.cpp
|
84f43213e7a5bb40ebe3f087db1cc6b93f023092
|
[] |
no_license
|
JasbirCodeSpace/Spider-Task-2
|
595127ee45c9282753ebf69921ee8015a465cf0c
|
637f6d0d2a8924950036327ebb2b959f6c227b81
|
refs/heads/main
| 2023-03-11T09:54:35.486541
| 2021-02-25T19:28:02
| 2021-02-25T19:28:02
| 329,349,675
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 490
|
cpp
|
question7.cpp
|
//Question: https://practice.geeksforgeeks.org/problems/remove-duplicates-from-an-unsorted-linked-list/1
Node* remove_duplicates(Node* root){
Node *prev = NULL, *curr = root;
unordered_set<int> unique;
while(curr!=NULL){
if(unique.find(curr->data) != unique.end()){
prev->next = curr->next;
delete(curr);
}else{
unique.insert(curr->data);
prev = curr;
}
curr = prev->next;
}
}
|
360e3040cf811e8ed377e5e9dd52750eac416de4
|
9ada6ca9bd5e669eb3e903f900bae306bf7fd75e
|
/case3/ddtFoam_Tutorial/0.004050000/Xi
|
315b0273a5792d01ed9927c230698150ed218e58
|
[] |
no_license
|
ptroyen/DDT
|
a6c8747f3a924a7039b71c96ee7d4a1618ad4197
|
6e6ddc7937324b04b22fbfcf974f9c9ea24e48bf
|
refs/heads/master
| 2020-05-24T15:04:39.786689
| 2018-01-28T21:36:40
| 2018-01-28T21:36:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 98,759
|
Xi
|
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.004050000";
object Xi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField nonuniform List<scalar>
12384
(
2.36762
5.20114
6.28899
7.32082
7.58952
7.57736
6.66197
6.10162
5.22127
5.02386
5.40425
6.25026
8.15287
7.2921
27.1379
34.8597
41.1111
44.6696
47.5662
50.1274
51.6009
53.5074
55.123
54.8122
54.4601
52.4031
50.2558
46.9948
43.8263
40.9092
37.5764
33.4951
30.1186
29.0191
32.3754
35.5922
34.2104
31.059
28.9744
28.5077
30.4444
27.1809
19.4444
9.57207
36.3408
72.5088
84.1964
93.1751
99.6926
104.304
106.172
103.589
101.255
96.2002
94.4797
88.4358
89.1881
77.9712
74.1161
63.6726
55.3469
50.6108
50.3233
50.0818
42.8942
31.0669
22.8763
20.3844
19.0139
18.8113
19.0338
20.4034
21.9305
19.5429
38.5007
66.4772
82.108
94.8748
108.167
123.829
143.113
155.021
158.973
161.368
165.867
167.179
167.159
165.635
163.879
158.229
156.568
152.702
149.066
144.173
138.431
131.459
122.449
107.018
83.4739
63.956
53.1915
47.5747
43.239
29.7348
32.6167
42.0803
48.3607
55.2857
63.6289
72.4361
81.1931
88.7308
101.215
98.2512
105.883
99.5412
97.5921
96.4797
94.1812
95.3049
93.8877
92.8016
91.9619
91.9514
92.5133
95.8015
97.4414
89.4967
71.5982
63.3878
55.3248
49.7186
39.0817
32.3531
39.9395
51.1671
56.2341
66.2857
78.6669
84.3998
84.6225
82.8928
82.8079
83.4162
83.3068
84.172
86.5978
90.9437
96.6094
104.554
114.824
128.235
134.326
142.438
174.608
156.76
155.264
154.157
147.885
142.696
128.337
88.3782
50.4708
32.1358
28.2994
39.4899
56.051
76.3001
83.9873
82.2503
77.0974
76.6837
77.3515
76.2927
80.2107
78.9979
80.8617
84.9468
89.3363
92.6414
95.3558
99.4183
101.344
102.823
104.294
103.279
100.118
96.3822
89.6959
82.7928
71.8599
58.4331
50.4657
38.0488
31.5668
47.3823
54.9897
55.3115
51.7569
40.5885
43.3407
49.5196
62.6657
74.1235
86.6769
94.7245
98.2962
99.1605
95.997
91.8787
88.3234
86.5388
83.4685
79.849
80.9968
82.8681
72.7094
77.1174
62.9053
56.5416
47.2616
40.4411
31.0787
21.2967
7.83534
12.5972
20.0847
38.4788
36.4842
48.2251
63.6342
81.4386
91.6382
103.824
111.797
131.147
142.018
145.45
145.478
144.192
138.42
130.414
119.38
105.328
89.5197
71.2831
51.1283
34.727
21.136
15.6291
10.9382
8.31396
6.22337
4.09209
3.15839
3.67159
4.30284
5.3713
7.27283
10.7591
16.2943
23.3796
37.211
46.9173
57.3898
68.1244
77.0443
88.124
87.8236
90.5953
89.7534
87.7593
84.528
81.9524
79.5464
78.0231
77.4888
77.55
77.5343
76.9175
74.2894
72.3541
62.4762
43.6966
3.74453
3.88639
5.74865
10.2187
15.2195
26.2752
40.0204
53.4469
71.2324
77.0554
111.358
99.4787
119.681
113.806
112.867
109.017
105.737
104.402
105.54
111.477
122.611
139.043
161.054
165.456
189.842
141.157
125.985
99.5194
78.3006
49.1356
5.6772
8.26405
19.368
22.3955
32.1492
43.8404
55.5373
68.4579
80.1686
96.0602
98.2412
109.108
103.137
108.719
97.6943
95.3059
83.0129
74.6111
61.708
51.365
40.4271
30.2234
24.4675
14.9612
8.56454
6.12874
5.3244
4.81842
4.23878
3.25439
4.82712
4.88898
5.31868
7.31969
10.5196
11.9924
13.8388
13.5732
14.3774
14.0823
14.7073
15.0562
13.7757
15.0766
12.7979
12.3688
9.64679
8.60692
7.11875
6.33772
5.81546
5.21862
4.86147
4.65311
4.54843
4.41245
4.42154
4.05682
3.5975
2.98772
3.86677
7.67957
8.91515
10.4301
11.8093
13.6765
13.5939
13.2342
10.6856
9.16104
8.53168
9.36351
11.6172
15.9997
33.8141
28.9233
34.9862
41.5859
47.4173
53.27
56.8639
61.4175
65.5501
69.2952
73.9322
77.6648
81.3687
83.2895
82.5771
79.5845
73.1567
64.5417
54.2414
46.8482
44.7535
47.9171
48.3239
44.4764
37.1432
34.5246
34.339
35.2813
27.9477
17.9647
55.0988
75.4603
82.0131
91.2025
105.175
121.877
139.484
155.37
168.097
172.866
173.759
161.96
155.552
135.944
131.084
113.682
102.006
92.3868
85.2801
82.9688
80.2764
71.1683
53.4521
37.7712
28.4459
23.9223
22.387
22.953
28.0479
34.7092
53.2484
68.0022
77.0841
87.9199
100.763
117.642
137.751
167.846
189.892
206.973
221.999
232.348
240.107
241.926
239.474
233.36
222.912
210.576
195.103
178.171
160.106
141.732
122.909
104.629
87.5386
68.9773
57.8887
51.9304
49.3888
45.3925
33.3913
38.1103
47.014
57.2262
67.9288
78.6796
89.1845
99.0163
108.673
115.083
116.703
117.76
111.639
106.971
101.218
96.2697
90.3841
86.3609
82.3265
80.7489
80.7639
83.7973
87.4915
91.1907
81.396
74.2573
64.5988
56.1508
45.6768
54.7899
65.1942
58.824
65.8736
71.7764
65.5305
63.2413
67.3017
69.1801
67.5075
66.9664
67.4724
68.893
72.1255
77.0227
83.5677
91.239
100.69
111.956
122.438
128.773
147.997
157.329
154.299
151.566
150.179
153.044
153.602
124.023
84.0193
69.5126
38.5295
41.8685
65.3586
81.7448
82.4383
78.1423
76.7264
76.9506
77.9054
79.1086
81.5926
85.1187
90.1497
96.052
101.651
105.646
108.968
111.063
112.919
114.523
115.976
116.392
114.964
112.063
105.917
100.145
91.2923
81.5244
74.5538
73.1849
52.6877
57.1249
64.3721
68.2456
73.0194
87.0376
100.571
95.469
104.76
114.271
119.348
121.251
119.68
113.081
103.384
92.5971
82.9421
71.2548
63.8391
61.8972
60.2492
64.2362
63.6201
71.9512
61.8841
62.9085
58.767
57.4507
53.687
51.2489
14.8474
20.6864
54.6167
79.3001
99.7373
122.316
140.287
154.423
163.212
164.822
166.778
173.711
179.633
172.091
165.943
156.784
146.994
136.057
123.329
109.926
95.1391
79.1591
62.1555
44.3475
26.9006
16.8808
9.76055
6.62435
4.61367
5.8337
5.00292
4.19829
7.63351
16.7503
36.0006
65.0405
93.7366
119.949
130.804
136.934
130.409
127.704
126.621
118.973
116.408
109.417
101.913
93.2143
85.3489
77.761
70.934
65.4415
61.828
60.4128
61.0033
62.1885
59.3811
59.6197
63.621
56.5645
12.3391
14.3775
31.8979
55.2558
75.5955
101.88
103.852
108.197
109.965
117.299
117.898
121.938
116.144
110.012
101.103
92.49
85.4076
81.8291
85.4359
98.7782
123.633
165.698
226.433
270.45
291.969
300.243
238.249
180.703
135.515
116.789
37.3722
56.2953
76.7129
81.3205
96.766
110.03
121.053
128.116
129.135
129.836
125.576
120.634
114.693
108.334
94.6081
85.5978
71.8192
61.9008
51.7147
43.6615
36.1611
27.8569
20.0141
12.2396
7.45391
5.04309
3.65007
2.80101
2.53942
3.91033
11.4286
8.80605
14.8996
21.8889
30.0568
33.1575
37.427
39.0351
39.0961
32.998
27.2755
22.8128
18.6
15.6747
12.727
10.8285
8.03103
5.96189
4.46266
3.56972
3.0873
2.65072
2.36063
2.16189
2.03838
2.21461
2.26566
2.35978
2.24195
3.52578
5.69443
10.5969
11.1591
11.9269
12.7584
14.233
15.5154
16.4272
13.8499
11.2083
9.36759
9.51141
13.135
22.0542
33.8742
35.2447
50.6388
65.6271
71.7235
71.335
67.473
64.2153
64.0627
65.3813
67.3173
71.357
75.6366
80.024
80.7827
80.82
75.9361
67.5982
57.8256
48.6268
44.3198
45.4436
48.0565
47.2928
40.9617
34.1989
32.5226
34.1785
32.029
21.8048
59.1162
77.2513
78.3632
82.7067
90.9848
106.642
127.144
150.397
163.739
167.883
166.912
151.876
149.186
133.911
131.905
122.539
112.647
104.702
97.7643
92.1717
90.7941
89.354
79.4088
59.4662
39.8104
27.8638
22.6115
21.3997
27.4116
41.5916
58.1013
77.5096
81.8445
82.3731
85.6737
93.4194
104.912
121.739
137.241
167.003
181.848
193.466
205.04
211.344
216.467
217.056
212.963
205.387
193.437
179.115
164.299
149.109
134.508
119.453
103.963
85.6522
66.7968
57.3735
56.2791
57.8388
39.8946
57.1327
71.5413
80.4463
85.0513
87.3816
90.7521
95.4446
99.6987
104.022
108.186
104.321
101.951
97.8557
90.2638
86.3612
78.8835
75.2724
72.7125
72.6063
73.889
77.6429
82.6659
89.7304
89.1503
83.5166
71.83
63.6286
52.3076
67.4909
77.8443
67.1949
73.0206
69.5558
71.2548
77.9688
80.6489
81.0831
77.832
73.4846
70.0722
68.3657
69.3122
71.7133
75.9159
81.7321
88.0824
94.0525
102.512
106.793
115.905
122.705
122.138
120.072
119.556
124.07
136.657
135.422
103.046
84.2813
44.4409
48.6468
71.2224
80.1811
76.9065
76.341
76.7515
78.3423
80.8405
84.6406
92.1222
100.913
108.926
115.192
118.382
119.709
119.056
117.628
115.612
114.195
112.285
112.483
111.653
112.067
108.924
104.452
97.7654
89.7648
82.8735
81.3301
70.3829
68.8226
72.9897
76.4291
88.0423
104.565
105.236
109.826
119.634
134.455
139.107
139.202
137.478
134.068
129.714
124.611
118.969
105.702
91.3341
75.3814
69.6886
75.3807
70.2203
79.9482
63.8686
57.2778
50.4695
50.9541
53.623
52.894
23.1189
36.8404
69.7372
91.0058
118.015
138.619
153.185
162.133
169.162
174.463
179.535
180.089
177.883
171.609
166.276
158.935
152.282
143.967
135.058
124.198
112.238
99.8224
84.3375
65.5455
45.0028
28.6549
15.7077
9.02412
6.09567
7.87128
5.73132
5.19151
10.9818
24.7935
45.9707
73.548
105.18
123.942
131.66
122.616
118.74
112.693
110.808
110.708
106.505
102.317
95.0857
88.1932
80.7401
74.8964
70.872
69.3335
70.5368
74.7099
79.4822
81.8875
67.3108
47.8227
61.0607
56.829
15.8631
18.3397
35.199
57.2687
78.9173
90.8452
97.4517
93.8414
97.2886
96.8696
101.422
101.222
103.304
101.049
102.276
102.989
101.146
98.0368
106.119
129.156
171.949
235.82
275.178
301.181
317.147
321.874
270.073
212.028
172.105
143.333
64.308
82.2943
86.002
97.2856
109.944
120.429
125.946
128.391
125.362
122.106
119.212
120.091
115.509
111.998
100.493
92.7173
79.5642
70.2371
60.5635
52.4963
45.2777
38.6488
30.7926
21.1943
13.085
7.38432
4.81275
3.9503
2.97813
4.9529
15.276
11.6206
18.9271
26.07
33.5239
36.8616
37.6114
34.9121
35.2052
32.7894
30.221
27.6584
24.6386
23.6308
22.6571
21.5331
16.4873
11.292
5.8922
3.78634
3.13043
2.77394
2.55544
2.35306
2.15657
1.94626
1.9235
2.18327
2.31314
3.97905
7.37298
13.0995
13.4695
13.6543
13.5999
13.9755
14.8121
16.2642
15.6439
12.9083
10.5053
10.2719
14.3029
27.2805
32.6282
45.6218
72.7166
92.2669
88.8601
75.4805
61.3393
53.0022
49.9503
49.3784
49.0332
49.7505
53.418
58.7827
64.9643
70.7019
70.7453
66.5452
57.5435
48.4892
43.1199
42.596
46.5632
47.5899
43.2604
35.2054
31.6863
34.1838
36.3825
25.8064
69.9222
85.7771
86.656
82.9422
84.5736
93.3503
112.997
138.821
155.726
153.119
148.049
135.607
130.327
122.474
123.701
119.671
118.975
111.346
108.077
104.23
102.101
102.794
100.437
85.685
61.677
37.8816
26.316
22.2649
28.2416
45.4329
70.2748
78.3438
76.5638
76.9257
79.7582
85.2253
92.7601
102.857
114.862
132.841
148.284
161.388
169.101
174.966
180.056
184.91
188.506
186.958
182.156
173.172
162.067
151.586
141.466
130.737
117.141
99.3622
78.7249
65.3026
61.9509
69.0106
56.8195
91.7382
98.6991
92.3286
83.6611
76.194
75.0177
74.0456
74.5307
78.1839
80.5419
84.4739
83.548
81.6622
77.6829
73.005
69.1465
65.3267
64.4847
65.8379
67.4325
71.7144
75.5302
83.5576
88.1713
87.0055
78.4685
68.4105
56.7623
74.9435
89.3432
76.9015
79.8313
73.4982
84.0288
98.4731
97.8008
90.9489
85.7124
81.9342
78.7159
78.036
79.7115
82.5455
86.0529
89.2937
89.5212
89.3232
90.7414
92.4181
92.6777
101.64
100.115
99.3716
99.727
105.854
121.352
135.851
117.541
90.2516
51.1932
53.638
77.9562
78.4966
76.8135
76.874
78.8919
81.2462
86.3052
94.7604
106.447
116.154
122.347
120.996
122.004
123.243
119.785
116.603
113.82
110.822
107.858
104.739
102.636
104.224
105.635
105.804
102.66
96.7748
92.6178
88.174
80.807
75.4
77.5765
83.8675
101.271
117.543
112.776
120.848
135.635
135.68
134.434
132.264
129.987
127.658
125.517
124.429
122.598
119.925
115.957
103.535
83.6241
84.3095
80.2504
92.7118
70.2992
59.2757
44.6624
45.7789
53.5609
53.3898
34.1481
62.7015
82.0491
105.866
131.795
148.271
157.072
161.748
164.116
166.915
168.45
168.312
166.296
161.655
157.491
153.672
148.646
143.797
137.288
129.568
121.112
110.278
98.5763
84.4827
63.2002
41.1862
23.34
13.076
7.8979
10.928
6.89476
7.22994
15.9226
31.6824
51.2546
76.9441
105.634
120.189
115.803
114.731
106.352
105.911
101.162
98.6451
101.254
100.562
98.2159
90.1912
83.3737
77.3435
74.8123
77.6771
86.778
101.891
116.122
121.333
89.6326
48.4781
61.3475
54.3766
20.3825
21.6274
39.1085
56.0093
74.2834
81.4271
78.7632
80.8711
79.7406
87.1886
86.1654
92.4408
93.1352
98.2736
105.8
117.341
121.026
116.44
135.731
194.52
255.488
285.445
299.404
305.521
309.237
310.183
273.893
239.157
218.102
171.359
87.9419
91.0944
97.9299
111.255
119.252
120.456
119.471
116.747
114.744
111.588
113.724
112.405
114.534
109.379
103.394
92.8026
82.984
73.2329
65.4174
59.0149
53.7858
47.5682
40.7019
32.174
21.5797
12.3601
7.30288
4.85383
4.14558
6.28191
20.6257
16.9397
25.6469
33.6955
39.0166
38.0562
39.186
40.7441
42.3196
42.8186
42.5302
42.5975
43.3533
44.8434
45.6307
42.7516
35.8899
25.6392
13.82
5.91977
3.38069
3.03258
2.85997
2.74878
2.58111
2.2508
1.9673
1.96868
2.39559
4.34875
9.40172
17.2701
18.2681
18.5698
17.8749
17.1237
16.0333
16.3162
15.9712
13.5728
11.3175
10.9278
13.899
30.2185
38.781
51.7389
88.4801
105.473
90.7011
66.8246
49.8834
41.7608
37.9858
34.5391
31.332
29.5491
31.3715
37.8638
46.9939
57.294
60.6974
59.9084
53.8254
45.7187
40.0914
39.7527
43.723
47.5781
43.4901
35.0776
32.4002
35.8201
43.342
31.7357
86.2177
111.968
103.166
89.205
81.3628
84.126
94.1303
118.331
127.799
124.641
126.563
109.88
111.357
106.247
110.225
111.163
113.797
115.129
111.199
114.36
113.934
115.434
113.82
112.007
88.003
55.2797
33.0174
24.9922
29.3967
51.7787
81.0965
76.0837
75.0951
77.9072
83.8805
89.093
94.8074
100.339
102.978
117.158
122.731
133.221
136.668
140.506
145.082
150.172
156.661
161.952
163.919
161.735
156.541
150.047
144.145
136.939
125.568
108.04
86.8497
71.3812
66.0961
79.0968
88.0011
124.872
108.487
88.3884
73.8595
65.3581
62.7982
58.1763
57.6458
57.8226
58.6841
60.0679
60.6933
62.5471
61.8466
60.1272
57.8687
57.3007
57.0312
60.1321
62.0937
66.3945
70.4999
78.0728
82.2729
87.0295
80.3642
71.6594
59.9322
79.2174
100.011
86.5847
86.4008
89.9504
97.6698
103.938
105.129
103.174
93.152
90.523
91.3843
91.7865
92.6722
94.8162
96.6656
95.4075
92.2385
86.9903
82.3343
77.9176
76.4455
75.666
81.0746
83.9579
86.9998
96.7051
114.157
137.269
130.289
92.1896
57.0128
64.3412
79.9614
78.8962
78.1251
79.6068
80.6611
84.7641
92.1212
103.841
114.578
122.46
124.736
122.814
122.993
122.757
121.06
118.989
117.007
114.525
110.196
103.971
98.188
98.709
102.157
105.904
106.031
102.371
101.438
95.6711
91.1926
81.9213
82.5809
93.232
112.079
116.169
120.508
135.091
134.594
129.176
124.204
120.993
110.05
108.8
108.245
123.626
122.977
123.87
123.884
117.548
105.782
89.9082
89.2572
100.34
80.3075
62.4332
42.8388
43.5723
56.1879
51.8818
45.0604
87.4036
96.7572
120.482
141.311
153.06
156.623
155.814
154.478
152.256
150.633
149.869
148.313
145.955
144.725
142.762
141.47
138.579
134.849
130.993
124.207
115.363
105.009
94.6277
78.9544
55.5998
32.1657
18.5073
10.8533
14.9893
8.43554
10.2051
21.8526
35.9457
53.1325
78.8524
101.159
114.016
111.244
103.724
102.771
94.9664
92.7539
88.098
91.0055
100.281
102.443
97.6277
88.647
82.729
84.1027
97.4767
127.742
173.748
186.578
165.638
129.889
56.4435
65.7247
46.9381
24.3831
28.9488
43.8817
58.7462
75.4697
77.4843
77.2557
71.7808
71.9533
68.8944
76.3536
80.5971
94.4635
98.2094
112.44
133.29
143.332
139.77
187.634
261.213
298.558
300.142
286.778
262.499
248.4
257.074
270.424
276.811
289.47
204.714
109.836
104.334
114.664
125.074
123.418
116.604
110.324
109.491
105.418
107.871
106.801
111.262
110.523
111.876
105.661
96.472
86.2015
78.3175
73.8582
71.6504
67.6578
62.3683
54.8087
43.9371
32.3596
20.7835
11.459
7.15533
6.04898
8.59141
28.2514
25.0686
34.0729
40.4631
40.0619
40.1983
44.6869
47.5738
53.4353
57.0446
61.7123
64.9139
67.2499
68.3363
65.7259
61.9018
54.7753
44.0559
29.0701
12.9246
4.32908
3.15726
3.05517
3.03702
3.05816
2.75441
2.1838
1.98966
2.39781
4.80714
11.9539
23.2237
24.6142
23.9251
22.4431
20.4422
18.2455
16.8231
15.383
13.183
11.7843
11.8314
14.495
31.6895
45.7677
58.048
104.346
108.901
82.1935
56.2301
42.6629
36.3809
32.2045
27.7712
23.5309
21.6679
22.5902
27.8073
37.0663
46.2421
50.6874
49.7648
44.7726
38.7411
35.5147
36.7394
43.5644
45.6638
40.8383
33.9973
34.2587
42.55
55.5402
39.7676
106.374
143.397
130.826
95.2611
80.3907
74.7463
78.0575
91.7898
100.109
104.851
105.271
93.261
94.7998
94.9209
101.588
102.939
104.701
103.998
105.214
106.652
112.325
116.204
124.767
121.503
107.267
72.1266
42.1384
28.5681
31.2777
56.9012
86.3683
73.3949
77.0466
86.3532
95.2306
100.128
104.757
102.233
101.246
105.91
101.592
103.572
105.156
104.504
107.136
114.035
123.875
135.332
143.615
148.278
147.747
146.026
143.842
139.244
129.643
111.467
89.3781
71.2784
66.7395
82.8994
123.625
139.572
110.839
89.7708
77.6473
69.7142
65.9099
57.2206
54.5761
48.4572
46.6983
46.5987
49.5989
50.2044
51.5628
51.0724
51.1075
51.9773
53.8056
55.5705
58.031
61.2954
65.204
70.8556
77.4553
81.3298
81.1251
74.2163
64.235
82.7022
111.293
96.4062
94.8249
98.0072
101.588
103.172
103.764
105.751
107.108
105.801
106.144
110.127
111.422
111.014
108.234
103.154
95.0593
85.5497
78.5691
75.1938
66.1981
60.3944
62.7451
69.5989
80.0001
93.1851
114.506
144.519
144.568
89.9071
67.4808
73.9134
81.68
80.4607
78.9153
81.4605
84.1204
88.5456
95.7254
105.304
114.681
120.331
123.369
124.46
125.053
126.166
127.224
126.844
125.83
122.746
117.792
107.744
99.4358
96.6662
99.4113
103.988
106.373
106.119
110.649
102.675
101.798
87.744
87.0203
100.508
119.97
118.956
124.899
136.329
129.02
120.01
110.906
92.978
88.407
85.1502
96.004
117.174
126.059
126.113
126.32
125.058
115.075
95.5843
96.8397
104.132
88.3107
66.1801
43.0796
43.5575
58.9899
51.1987
63.1976
114.847
112.439
131.936
148.391
154.324
153.748
148.569
141.154
134.734
130.079
127.185
126.105
127.171
128.487
130.801
131.412
130.778
130.704
128.48
124.266
117.731
107.433
97.1773
87.6483
67.7478
41.7357
23.9578
15.0622
19.4225
10.9577
14.023
26.8728
38.4652
52.2523
75.7088
94.2914
103.957
99.4217
94.2323
84.4976
79.3838
71.2347
74.3514
86.2451
103.5
110.034
104.757
95.0354
88.6596
97.0248
130.404
208.771
241.277
263.356
221.441
149.077
66.9444
67.977
45.8612
32.8517
38.0227
53.75
64.6906
75.9024
81.7853
70.8129
68.6283
59.9575
60.4676
61.0277
73.1884
88.7722
102.107
117.192
150.575
152.038
152.758
238.604
289.29
297.407
296.055
265.799
229.73
197.641
199.195
255.567
315.504
354.672
252.325
140.5
125.372
135.643
135.288
122.087
110.719
102.281
95.1766
96.1912
95.6785
103.274
104.167
111.962
113.228
109.972
99.7289
91.7422
88.3599
92.8524
96.832
97.1712
90.3775
78.4075
61.4465
45.7654
29.9851
18.3804
11.2746
8.23013
11.9237
37.7246
35.6044
42.2869
45.3363
41.4162
44.885
49.2039
56.6585
63.4801
71.3112
75.1958
79.1675
79.1621
78.2447
76.0773
71.1897
67.3362
60.1797
45.3195
25.7506
7.8219
3.26919
3.055
3.13215
3.32993
3.29694
2.4973
2.16494
2.78685
5.05484
14.3803
27.7667
28.275
26.2296
23.6847
21.5893
19.1424
16.6632
14.1994
12.45
12.8809
15.1175
20.3873
33.463
51.9934
71.8983
114.313
101.568
71.4094
51.7168
41.9173
37.0601
33.8683
29.8539
25.6557
22.7183
22.4033
24.1937
29.0868
34.3062
37.2027
37.2405
34.5186
32.3709
32.7385
37.2547
42.5916
41.6898
36.6877
35.5664
42.9647
59.5008
76.5859
51.337
139.926
167.704
154.087
97.722
77.3576
72.3814
73.2696
77.5742
83.8762
87.6997
88.3502
92.1229
89.9074
94.8316
93.2797
90.0831
78.8557
79.5501
83.5279
90.8836
91.7951
98.3726
104.118
112.806
106.558
81.9967
49.2061
32.5119
33.524
61.4619
96.7681
72.7724
82.2469
97.6492
107.53
116.709
114.887
110.918
109.622
102.046
96.5777
94.3102
83.1889
75.1333
71.1813
78.0873
92.8032
113.968
128.716
137.223
141.258
142.366
143.794
140.375
129.801
109.213
85.809
67.2683
63.7796
80.9659
162.639
149.136
122.717
106.466
98.148
90.494
85.8958
75.1763
71.7979
63.7616
61.2168
58.1135
54.134
54.0035
50.8303
50.054
48.2761
48.221
48.4353
50.5669
52.2152
56.1525
58.8509
66.3207
71.384
78.1609
79.7789
76.5776
68.4359
87.5116
124
105.823
102.76
103.027
102.154
100.421
102.509
100.824
112.403
118.738
120.325
119.276
118.456
113.521
107.72
103.64
94.9901
85.3486
80.6945
74.7381
69.6914
55.9327
54.9158
65.1976
77.6416
96.4341
122.591
156.216
154.15
78.056
78.6724
77.9835
84.7101
75.9347
83.1414
84.7267
86.4139
90.8009
95.4469
102.25
108.431
114.779
119.598
123.134
126.114
129.806
134.116
137.261
137.921
134.816
128.065
115.459
103.053
97.775
100.153
102.824
105.42
107.508
120.274
115.86
112.398
93.3067
91.0319
105.575
118.291
120.573
126.157
134.551
123.75
110.541
90.2503
73.4258
66.9392
77.469
98.5788
109.732
124.427
128.148
127.282
128.307
119.77
102.347
99.1101
101.605
93.6467
68.8284
43.941
45.0294
62.0808
47.8384
75.9239
141.936
127.762
141.306
152.374
154.878
150.042
141.067
129.95
118.203
109.246
99.8815
94.627
102.833
112.098
118.955
122.039
124.845
125.519
124.911
122.963
116.737
107.613
97.7797
89.4487
74.5466
50.9822
30.0458
21.5964
26.272
16.0107
19.133
30.688
39.3758
49.9853
67.22
83.7291
90.3433
88.1691
82.2411
75.0723
66.2907
64.7804
69.3107
92.2969
117.6
121.933
112.413
101.018
102.602
130.049
204.498
252.411
337.793
339.366
289.66
180.18
95.0365
76.2271
48.2191
52.5352
63.8794
76.8161
75.4943
83.9435
79.8731
75.3889
67.1763
62.3599
57.4269
60.3483
69.0928
92.4531
97.2868
116.142
151.248
156.306
157.305
247.745
303.498
302.446
244.025
257.363
228.38
183.671
190.391
257.759
337.918
370.182
224.904
156.535
162.982
159.576
148.77
133.371
115.503
99.1961
93.9588
87.2889
91.2196
92.5445
103.441
109.355
117.141
112.757
103.058
99.2201
109.494
123.606
127.449
117.637
110.439
102.145
86.0913
58.4074
39.4584
26.385
16.723
12.1533
15.4146
50.7695
47.6572
49.8897
45.4378
44.7941
47.3826
55.3815
61.2921
71.5289
76.8681
81.744
79.897
78.8349
75.0848
71.9004
72.7991
73.6079
68.2461
60.413
41.4086
15.2984
3.82219
2.90606
3.02848
3.35523
3.73671
3.05653
2.59969
3.36294
6.34294
17.3167
31.67
29.9983
26.6985
24.23
22.2982
19.3239
15.2853
12.8916
14.1321
20.085
31.2517
38.2825
40.5784
58.271
88.0357
112.78
91.5577
69.8965
55.9287
47.993
44.3158
42.0291
39.5168
35.4838
31.0751
27.311
25.6194
26.2353
27.4618
28.6177
28.8027
29.1647
30.0996
33.6694
38.7403
40.4359
38.2263
40.1532
48.9668
65.544
83.9873
97.5243
69.634
172.166
167.583
149.429
101.546
73.8677
72.2718
75.1419
82.2459
80.6359
88.8904
88.8708
100.832
95.2504
93.5317
80.4012
71.4859
69.7629
75.7823
84.5378
86.8835
90.3816
90.8343
96.7302
100.554
102.735
81.2325
53.1648
35.4508
37.8708
67.8766
94.3485
72.4728
88.6961
106.295
123.577
129.073
128.212
127.374
117.753
118.144
111.568
102.807
92.568
81.5482
73.0683
73.9206
89.1372
111.947
127.198
137.77
142.796
145.224
146.273
140.675
125.846
102.089
80.5717
62.4766
57.7393
81.7336
204.027
163.847
149.843
141.583
137.969
135.257
133.984
127.339
121.808
110.852
98.6707
86.0724
78.2125
69.4962
65.1941
59.301
57.0137
54.0261
51.8427
51.8993
52.5306
55.2088
60.2959
65.0026
72.3822
78.472
81.7053
79.7839
75.676
94.2828
137.952
117.652
112.249
107.585
101.887
99.7099
99.2269
105.989
109.907
122.523
126.972
129.51
128.985
125.983
115.53
105.604
95.6454
88.2554
81.392
81.5032
75.3723
67.3852
64.3154
70.1965
84.4942
103.809
134.02
170.194
155.269
64.9535
87.7791
89.8267
82.5081
80.4719
84.1869
85.9569
88.1024
90.7198
94.1681
98.5051
103.512
108.517
114.4
119.277
124.166
130.16
138.032
145.968
150.275
147.84
139.406
125.384
111.273
103.384
103.302
105.93
107.974
114.271
138.579
142.855
123.122
100.677
94.946
108.384
116.96
118.556
124.102
133.106
120.916
103.844
85.2001
64.3438
64.055
86.6187
95.9524
115.943
127.722
129.593
128.01
129.847
121.17
106.345
88.983
101.194
93.5408
70.0652
45.2739
45.9151
64.8393
48.314
96.7747
170.308
139.219
145.907
153.219
153.875
147.213
136.43
123.045
109.353
96.3487
82.6167
77.4748
84.9096
100.486
109.23
115.982
119.451
120.61
121.306
119.031
113.671
105.679
95.3798
87.8584
77.1922
57.3046
38.2869
34.6657
48.7454
30.7939
32.4999
34.9188
40.5748
46.7843
58.0162
71.4317
78.0994
76.644
72.2588
66.7774
62.0405
65.1084
79.6844
108.773
131.746
125.844
114.47
100.608
105.9
149.11
214.041
304.629
348.005
330.003
307.594
220.365
140.281
79.6758
63.8131
78.2887
102.264
93.6373
91.1274
80.7129
79.5546
73.8043
69.754
66.0405
68.7498
71.1094
80.2699
85.6724
85.9957
101.573
140.852
133.256
165.825
250.884
306.775
268.325
267.014
272.21
251.491
231.42
234.819
286.698
342.438
363.861
200.998
168.963
210.677
188.643
170.247
138.944
109.323
94.1759
79.3061
74.9038
73.0713
87.188
96.3873
109.142
116.901
113.97
106.61
113.257
135.042
141.573
127.966
115.436
102.943
96.3418
86.616
69.1185
47.4939
31.6121
22.2368
18.1153
22.0334
62.5341
61.3436
55.9114
47.0895
46.2917
51.1447
57.0843
65.0026
73.0511
75.3884
75.3928
71.1035
64.2337
61.9907
63.5109
68.1206
69.8913
72.1544
69.7397
54.9355
26.5365
6.15124
2.72604
2.75295
3.09648
3.8869
3.97349
4.21264
5.41105
11.7796
18.1211
30.5268
29.1414
26.4225
24.5351
22.5867
19.4573
15.2007
15.2001
20.6776
33.2241
50.1459
67.974
74.5786
77.8244
97.4581
92.5226
133.371
118.343
95.6684
80.6049
68.9927
62.0871
58.2241
56.2364
54.7807
51.2136
46.6943
38.9656
33.5808
29.7066
28.0682
27.9933
28.6302
30.0897
33.4808
37.7683
40.6847
43.7297
49.6568
62.3986
78.1841
91.7968
100.464
116.422
108.633
127.206
112.01
150.72
150.198
136.468
95.7978
72.3849
70.0959
78.903
91.855
92.0087
104.302
102.362
106.184
97.3
91.172
85.8061
92.8387
104.346
114.497
113.434
105.22
93.2684
84.1308
83.3888
94.5391
91.1068
78.1066
52.1663
37.2911
44.1655
82.858
156.685
143.689
66.8795
73.5328
91.6807
115.469
132.866
142.282
146.62
141.633
143.042
141.005
133.578
128.563
117.897
109.357
105.748
110.332
126.083
141.425
150.033
155.199
157.519
155.506
151.544
140.043
122.494
103.764
70.5222
65.7637
77.21
116.396
162.014
200.81
178.97
184.658
189.523
195.976
202.724
208.239
211.903
213.035
211.91
207.286
196.219
180.77
161.737
141.771
124.918
115.166
101.27
94.8746
86.274
79.3092
74.9181
71.6946
71.6446
76.917
81.2574
85.0711
85.0635
80.1597
73.8876
80.4055
129.98
165.834
149.207
127.923
118.345
107.871
99.4122
87.8171
88.5649
101.301
114.095
123.585
130.261
134.341
133.193
126.485
112.683
104.554
98.4582
89.5227
85.7109
84.6303
86.1171
82.0525
78.752
81.8702
94.1451
117.474
148.019
164.64
137.055
63.7347
92.8708
103.396
97.8227
96.2026
85.8458
78.0391
87.229
87.4129
88.113
89.7522
87.9808
90.7834
90.0286
98.104
106.914
112.562
118.034
125.887
135.714
147.841
158.295
160.316
152.79
137.611
122.549
116.216
116.458
116.654
120.913
133.92
160.703
182.386
171.299
147.229
121.611
107.039
98.1595
108.736
115.515
115.328
119.152
126.765
121.457
107.008
92.2955
81.5574
84.8775
98.3957
113.615
125.028
129.249
129.549
129.121
127.687
120.94
101.838
82.9362
93.3417
88.6404
72.5695
47.2616
48.1023
68.2713
72.483
80.7645
95.7827
119.822
172.572
146.313
144.158
149.59
149.563
144.397
134.877
123.467
110.29
98.6312
86.5678
81.9383
86.9815
99.8735
107.455
113.741
115.853
118.232
118.725
116.155
110.602
101.298
91.3296
83.7122
77.4614
63.6066
52.6537
60.7976
77.814
81.4471
81.3165
70.7433
57.868
46.5916
46.479
47.2647
50.08
59.6062
66.2171
68.4534
66.4711
62.8193
63.3877
70.4967
96.4005
122.905
125.793
121.075
109.086
102.453
119.721
184.574
224.373
332.196
334.473
304.046
285.043
261.587
181.147
88.5708
63.3923
105.898
180.15
244.211
164.667
128.481
105.253
94.0176
83.2891
77.0454
76.1617
79.4749
82.6835
85.5027
85.0405
86.7434
74.4258
95.7658
126.725
121.05
144.947
243.671
296.963
301.058
257.164
284.003
278.227
275.931
283.391
304.82
331.845
333.342
197.641
191.791
263.683
297.936
297.103
240.738
191.355
142.761
114.88
91.7038
73.836
60.6604
62.6493
78.2933
92.4064
104.782
110.215
111.593
105.152
116.781
139.895
132.992
122.892
113.253
99.5948
85.6266
82.7157
74.4878
49.487
35.9842
29.079
31.7238
67.1522
82.6438
146.418
129.06
72.5892
60.4702
47.5785
48.4179
51.7716
57.9462
65.5548
69.3295
73.961
66.7302
57.882
49.8278
49.0562
55.4746
62.3673
67.0768
72.8283
72.7155
64.8805
38.6147
11.1685
3.00658
2.40204
2.69775
3.6437
5.47301
8.08853
9.70987
10.1301
3.83207
2.45482
19.8953
30.5649
29.1629
27.5418
25.5476
22.7385
19.4037
16.0391
14.7694
16.5542
23.1074
40.3252
69.99
107.61
136.815
152.403
142.427
138.2
121.124
108.226
97.3663
87.6566
80.4496
75.9487
73.6238
72.436
69.9044
67.6969
60.4389
53.4321
45.64
39.2159
37.3945
36.2553
38.6305
41.6123
46.2446
52.2596
62.5
74.2632
84.1976
82.798
81.5829
82.9976
93.1329
100.635
87.6741
86.1438
126.556
125.122
122.308
102.728
69.7845
69.1611
78.2956
92.3816
100.061
111.882
106.411
111.738
108.215
106.387
108.997
118.494
128.253
136.412
131.641
118.909
106.449
98.4858
91.4109
88.6479
84.2865
67.1598
48.8658
39.0696
50.9017
86.831
83.9669
73.6455
68.4472
76.044
93.0358
113.515
135.346
153.419
161.468
165.308
176.359
164.409
172.811
159.324
158.697
151.777
152.595
163.223
180.707
184.105
183.571
182.304
176.82
168.727
159.042
144.545
133.411
100.923
88.2935
109.603
152.762
166.313
173.358
180.044
194.291
200.648
206.418
212.983
219.256
223.436
225.345
226.221
226.737
226.663
226.506
225.426
223.983
221.958
208.094
185.651
176.394
153.015
137.86
122.03
110.576
104.36
100.933
96.3751
95.0968
92.1826
86.3615
79.1119
74.098
77.531
107.658
144.374
157.868
136.897
122.843
107.344
83.9356
73.4453
79.6623
94.7751
106.598
120.033
128.235
134.775
136.317
132.372
120.372
109.696
101.985
94.873
87.582
88.1893
92.3793
95.3722
94.1215
99.6071
108.35
127.584
150.278
147.981
110.512
66.2658
65.2069
80.3164
96.4758
100.051
84.9748
79.677
82.5295
85.5395
83.7645
76.963
76.6752
75.4284
72.9836
79.668
83.2913
100.697
108.783
116.321
126.034
141.171
155.812
165.625
163.903
153.082
140.329
133.195
135.517
145.202
149.656
152.356
166.401
189.04
140.1
120.214
123.854
108.166
98.8948
106.396
116.289
111.54
113.413
119.643
124.456
117.504
108.887
106.892
109.504
118.63
126.419
132.089
132.012
132.175
126.485
127.135
119.77
101.453
69.3629
81.1871
85.9177
72.7369
49.5291
49.0399
71.8215
82.0349
86.0732
108.475
141.161
158.036
142.489
136.635
140.565
143.01
140.229
133.785
126.251
118.717
110.437
102.473
98.6937
104.991
107.569
111.675
112.333
114.227
115.589
115.503
112.146
105.11
95.9037
86.4803
77.8145
74.4309
64.7195
62.752
82.4962
99.7346
79.3518
79.4675
87.0169
62.7097
52.017
54.2696
55.8084
52.994
52.2665
55.1882
59.0344
59.5701
61.1795
65.1166
84.6864
108.54
116.895
117.411
106.823
99.0463
99.6848
123.302
173.839
225.745
329.167
328.597
301.591
291.86
262.017
210.259
139.491
104.123
177.801
241.006
271.424
184.751
152.677
123.622
105.162
95.8009
91.4957
92.8339
93.2794
96.6897
89.69
85.0952
70.8093
61.7205
82.8032
106.242
100.602
139.341
226.929
287.926
286.32
306.205
263.705
269.47
238.783
253.18
243.455
263.085
231.952
146.736
162.92
244.381
370.622
303.989
230.238
173.948
134.089
108.674
90.5011
69.7597
55.9231
58.8824
75.2348
87.9569
94.653
108.434
106.518
95.3542
115.689
137.668
132.147
130.795
123.502
105.042
92.6464
86.1745
71.3495
49.216
39.7089
36.378
49.8266
81.4354
94.9207
129.366
122.797
73.7513
54.856
48.2342
47.9019
51.5752
56.9876
61.8246
67.3069
69.2159
61.8441
49.1664
37.6106
37.7454
51.4137
59.8456
67.0431
71.3567
74.4722
69.0578
48.8757
19.0292
4.7315
2.20387
2.17976
2.49493
3.71548
5.02746
5.57896
5.4395
2.17746
2.48053
19.0377
27.1043
28.062
27.5479
27.1569
23.9223
20.0646
16.9812
15.5935
15.8421
19.517
33.6438
57.9267
89.5393
116.501
130.569
130.677
130.523
124.678
117.569
108.719
98.4446
90.5415
84.6303
81.3714
80.313
81.1736
80.7186
80.2179
76.0502
70.6794
63.8313
59.1927
55.9433
56.7779
58.9632
65.8861
75.7971
85.4579
85.707
79.4405
74.3477
72.9803
71.27
76.1951
82.3882
81.8632
101.358
112.769
115.27
117.028
118.126
76.5727
66.1413
74.0393
87.0223
102.252
108.713
114.896
118.002
112.685
113.449
115.849
124.945
143.213
154.646
162.638
140.795
117.493
100.703
91.9401
81.7757
69.445
54.3599
45.7432
44.5068
62.8864
90.1783
76.9777
72.125
68.7831
77.7761
89.3262
105.223
128.257
148.297
171.77
182.869
198.067
195.573
201.105
200.774
190.12
197.027
205.275
218.36
219.651
214.73
209.185
199.678
189.481
176.471
166.561
154.62
112.332
106.37
113.5
137.015
160.024
169.598
183.008
196.804
208.805
215.585
219.723
223.013
223.701
220.586
216.055
212.681
211.855
212.217
215.241
218.892
224.479
232.293
239.439
244.628
228.549
212.432
189.753
174.736
158.193
142
130.462
122.143
114.939
109.209
104.068
87.6204
84.5655
102.951
132.542
156.19
161.102
138.072
119.862
101.257
69.7534
61.8431
70.2115
93.3385
106.868
108.813
120.969
130.9
136.755
136.255
126.362
115.678
109.796
102.787
94.2735
90.0107
90.5598
98.3087
103.013
103.576
113.296
116.657
121.207
109.457
77.2528
66.5012
69.3922
88.9582
102.609
101.931
85.8409
79.102
79.7041
77.125
71.5966
70.1482
66.6569
65.3742
67.1354
63.007
67.5174
71.7486
82.6958
101.867
104.22
125.928
145.062
164.723
171.42
168.433
163.539
162.461
166.536
168.182
165.944
157.594
152.061
159.835
123.919
113.851
118.049
103.109
95.6989
100.56
114.014
109.296
110.208
113.958
116.074
127.631
127.309
128.228
131.532
136.109
139.419
138.723
136.997
131.59
126.529
127.449
115.502
93.9286
58.8561
67.9395
79.8283
73.9561
54.9949
47.4582
71.3088
84.6492
80.7998
99.3759
119.025
124.646
140.669
127.85
130.451
133.634
134.434
133.057
129.556
126.089
123.584
120.685
119.494
116.989
117.151
115.248
114.393
114.777
114.482
113.992
109.001
100.211
90.1296
80.6003
72.5272
70.4672
61.3337
58.4322
74.9553
85.514
75.8459
81.751
80.8596
56.9834
50.4466
56.4781
66.4768
66.7853
62.4083
59.106
56.7332
60.4271
65.5152
77.3095
95.4062
100.343
103.937
99.0086
94.7312
92.1978
95.615
126.805
163.368
214.606
309.312
286.126
274.205
264.524
281.425
254.119
228.9
207.983
253.201
272.693
234.311
170.247
143.648
124.918
111.574
102.451
99.9443
98.586
98.9985
93.0393
86.1885
72.6798
55.2367
53.9924
78.028
85.7444
88.9946
112.652
191.765
258.89
320.8
293.562
286.65
228.701
218.865
197.452
188.112
174.128
162.35
156.271
216.172
300.352
370.81
221.261
180.392
149.842
120.435
97.013
78.1876
63.4136
58.598
66.3772
78.9722
84.0161
91.3717
97.7597
92.9211
85.8584
108.626
125.585
120.208
123.425
124.858
118.953
110.034
92.4495
67.7508
50.6142
43.8004
42.3938
61.2742
87.089
102.726
119.459
105.057
66.5731
51.7126
45.9951
46.4987
49.8952
54.0086
59.2534
64.117
65.7716
60.6399
54.9061
48.0086
52.871
58.3327
65.3087
67.779
71.9269
73.1567
69.6234
54.0083
28.1789
8.37082
2.43583
1.96848
2.04848
2.48418
3.06329
3.35716
3.17008
1.88237
2.29788
18.7504
25.3269
27.1863
28.1054
29.2556
27.5965
23.4529
19.6572
17.5769
17.5926
21.4776
33.4774
51.2666
68.9373
77.7242
86.1182
92.185
105.481
114.194
116.095
109.791
98.8971
88.6159
82.914
80.5792
81.6706
83.2315
87.8642
89.2815
91.1893
91.0892
87.4499
85.8487
82.2552
82.8954
84.871
90.5677
92.943
89.2355
77.3896
74.6385
75.195
80.6095
73.6488
79.494
76.7051
101.382
105.434
110.354
113.573
114.96
114.976
88.3238
68.2427
69.1281
81.7405
96.3337
106.324
109.46
110.984
108.5
105.095
105.348
114.146
132.359
142.631
156.187
163.372
126.528
95.853
76.8956
68.0928
57.8083
50.9719
49.244
58.6734
81.429
99.7994
78.9289
76.893
69.5527
71.415
80.8573
94.3747
110.301
131.468
165.453
181.011
206.911
206.752
208.641
211.688
223.803
224.408
232.407
239.469
232.684
223.836
210.196
198.631
186.048
173.034
134.661
117.843
105.165
101.267
106.829
108.338
131.286
153.554
176.414
199.277
215.341
224.029
227.215
225.203
217.72
208.529
202.284
200.818
202.035
205.197
207.764
213.191
219.221
226.859
237.244
245.872
252.059
251.524
246.143
228.818
211.973
196.092
181.016
166.218
145.791
126.76
111.951
106.607
114.619
132.859
151.405
161.946
158.453
133.292
113.501
74.6895
53.0472
43.6602
51.5178
77.9585
98.0484
102.805
106.53
120.211
131.565
137.547
135.402
124.368
120.389
116.199
109.311
99.1284
91.1945
93.0002
93.0373
95.2859
93.996
95.9921
89.2342
76.6106
71.1487
72.4733
80.7061
96.8611
104.648
100.05
85.0688
79.5808
76.2784
70.6097
65.3248
59.7985
57.3454
60.0022
57.3401
60.7168
56.2711
54.9227
61.6475
65.725
80.0757
97.1152
116.218
152.787
172.766
177.86
176.467
177.673
179.933
174.727
160.814
149.302
140.652
134.598
110.993
108.467
108.888
96.6463
93.9146
94.0045
104.165
109.592
109.421
109.762
122.949
129.134
134.771
141.597
146.111
148.567
146.936
144.349
138.045
133.264
129.037
125.441
113.661
82.2553
51.5964
55.6221
72.3567
75.4257
59.8488
48.2058
64.5928
80.8859
68.3796
69.2702
81.0812
85.9092
112.338
134.633
124.893
125.216
127.448
128.092
129.192
130.173
130.262
130.431
127.836
125.998
122.856
118.338
117.078
114.936
113.442
110.54
103.546
93.6422
83.1493
74.7569
67.3468
64.857
61.5505
53.7139
57.9358
75.1864
69.6853
68.0905
66.2356
49.591
49.8353
57.4496
68.0903
74.8919
74.8507
71.0715
69.7871
72.6668
78.5852
86.4561
89.1459
92.3757
91.2692
89.8175
89.0347
84.3543
91.6515
130.583
154.117
193.064
271.08
300.964
272.346
251.36
237.936
250.798
255.995
250.143
248.668
227.027
180.645
136.267
120.165
107.002
98.3305
91.1062
86.5295
85.9515
82.1396
76.7679
65.0564
50.929
44.6537
50.6033
69.9495
74.1067
75.6058
101.727
143.05
241.277
273.269
329.61
312.196
316.66
262.276
258.119
258.726
243.996
241.047
242.935
286.58
322.866
250.188
167.345
144.368
124.603
105.487
89.754
78.6797
73.1004
75.6367
80.5487
81.4505
82.6605
85.3348
86.0702
79.7264
72.3665
93.6043
112.23
111.508
113.597
121.218
123.105
112.864
86.8375
66.5458
55.8086
49.7239
52.8277
81.0038
102.225
116.315
117.854
94.7356
59.3991
47.4016
43.8266
44.1058
46.9721
51.7712
56.7267
60.9851
64.1425
67.1225
65.1552
66.5258
64.2047
66.3501
66.6014
69.8073
71.6137
72.2485
66.5546
53.6159
31.6133
10.7676
2.6968
1.91013
1.88163
1.96874
2.21975
2.38751
2.19516
1.70992
2.13073
17.5261
21.5604
26.1458
27.3591
29.3398
31.1556
30.6616
28.7999
27.4972
27.4035
31.0562
38.3129
46.2994
51.2741
51.9095
51.9029
51.7496
57.8158
72.3198
92.3268
101.866
98.7806
93.8725
87.5802
85.3075
82.9344
86.3666
88.4173
93.6262
96.5659
98.6605
99.3108
98.35
96.3182
95.1605
94.3804
92.6151
86.2363
76.8681
68.463
70.7668
69.5419
76.2782
73.9804
83.0989
83.3543
88.8353
88.5516
105.927
113.835
113.292
111.102
111.604
77.36
68.6522
76.8209
90.5328
96.4457
101.415
99.3058
96.6319
93.968
89.8178
91.8662
104.981
113.84
125.864
140.531
154.795
124.703
94.3485
74.8939
65.3684
62.3041
67.6147
79.3277
98.7143
92.8478
79.5218
75.4124
67.854
64.4441
67.937
76.9512
89.8435
107.912
135.306
165.29
205.026
201.973
209.405
216.237
218.207
217.512
216.783
211.111
211.24
196.226
190.227
158.474
137.643
121.752
105.385
97.3255
93.9581
82.1617
80.8725
71.3274
77.2682
107.691
147.98
179.973
205.48
219.823
222.913
216.732
205.418
196.705
195.641
198.175
203.242
208.164
214.257
219.041
226.344
232.581
240.352
246.748
251.785
250.916
248.016
238.236
227.162
212.158
195.055
177.08
159.157
145.532
138.289
138.231
144.49
152.73
158.647
157.953
146.026
119.086
87.8948
61.5837
45.0902
39.0244
47.0932
68.377
91.0148
93.5466
92.3105
101.501
119.483
132.033
138.149
133.576
130.679
131.538
130.659
122.445
109.808
98.3595
92.0947
86.4604
82.1871
77.1454
77.5502
75.7396
73.1295
81.6404
91.0998
102.415
103.11
94.8349
85.7555
79.9652
74.6361
68.099
60.6968
55.6038
54.2708
51.319
56.5388
56.0074
55.1098
53.2521
45.6724
48.8267
56.1424
62.6359
83.787
123.993
161.635
182.654
187.513
187.543
184.596
177.589
163.15
146.182
133.841
126.095
111.146
106.562
105.619
98.5299
97.0689
95.2124
96.2595
104.451
113.894
121.543
128.834
136.192
143.028
147.436
151.662
152.197
150.626
145.403
140.637
138.509
131.012
124.334
109.222
73.8863
45.8593
45.219
63.0808
74.2835
67.5725
52.5945
55.9239
72.4817
60.7946
54.5917
58.3564
65.6498
84.287
107.704
141.875
128.239
122.992
124.619
126.692
129.6
132.578
132.98
131.692
130.4
125.255
123.325
119.029
116.8
112.565
106.612
96.8109
86.4639
76.5593
69.3391
63.2962
61.051
62.8181
54.778
55.0969
63.5661
56.8709
51.991
50.9482
44.9745
51.2864
59.8683
70.1552
75.4589
78.6719
80.363
79.1549
79.647
82.0839
81.713
85.4046
85.4501
86.3645
87.0462
83.8001
79.4349
93.2054
129.626
147.173
169.824
214.778
264.243
285.103
261.505
232.433
214.811
212.472
202.782
186.926
159.058
122.987
95.7587
81.8453
70.4508
63.4975
58.3965
54.0263
52.5237
50.0581
46.4661
43.1352
41.0577
42.6112
53.2906
67.2418
62.7284
67.0231
83.8191
115.671
152.029
232.498
267.727
297.718
271.056
281.081
287.745
361.799
359.615
342.96
331.482
302.857
222.88
163.656
127.246
113.977
102.357
91.7237
84.1992
80.3714
81.1452
81.9617
81.8353
81.4003
81.4394
79.6614
77.5138
68.5139
58.7274
77.033
105.083
112.445
111.505
110.587
106.075
97.3359
87.0627
77.3626
72.3953
78.2231
103.278
116.465
123.265
127.088
116.491
90.95
53.4946
43.9218
40.5104
40.5147
44.3728
49.7502
55.1575
60.218
65.8997
69.1859
73.8756
72.8802
73.8256
72.2609
73.4945
71.7339
71.877
68.7695
62.217
49.2136
29.8175
9.98592
2.60542
1.90195
1.8588
1.85035
1.89094
1.93989
1.77838
1.56708
2.0432
16.1826
18.9308
24.5292
27.001
28.4193
30.9269
34.0845
36.6473
39.2574
41.1687
42.2847
42.6781
42.2982
40.5925
38.2792
35.6177
33.5081
32.6891
36.6057
47.9471
69.8142
89.0904
95.9585
95.7594
92.5925
90.3225
87.1274
87.9344
88.3492
90.5358
93.9662
94.6276
96.1007
92.9997
89.7683
84.8697
79.2019
71.4271
64.9176
60.182
59.9784
57.356
56.3534
54.3648
56.9921
58.256
64.1361
65.7252
76.9582
91.4445
109.315
106.25
109.023
104.463
81.1018
78.46
84.912
86.4473
87.34
88.2516
82.3575
77.3244
72.5565
73.6024
83.5523
86.576
92.8693
101.343
112.234
125.176
134.852
117.298
99.1297
96.7231
96.4827
105.032
92.5178
80.9019
74.9615
69.8083
62.0608
56.6084
56.1378
59.7306
66.4177
81.0923
100.916
132.315
165.596
199.519
206.553
212.342
214.199
208.044
207.871
204.111
205.893
186.842
183.154
152.197
133.21
114.439
100.376
83.2192
80.3597
67.2004
63.6137
57.4036
54.1996
59.2569
85.5056
136.623
171.697
195.561
203.692
200.717
194.253
191.425
193.997
200.807
208.063
216.246
223.233
230.907
237.47
245.716
253.251
257.066
263.179
260.515
260.006
251.441
240.805
228.227
211.747
197.095
183.971
174.132
167.455
162.938
159.091
155.343
150.079
141.158
122.88
85.3513
65.7183
56.1935
51.3982
55.364
72.6696
91.8937
94.7997
91.5158
86.5112
82.7466
96.8128
115.91
131.529
137.133
138.549
140.226
140.359
139.63
139.986
131.653
110.324
97.3269
92.1899
81.6531
84.3574
80.9882
87.3742
88.6398
95.2606
100.305
95.5258
85.5962
78.8281
74.4336
71.3735
69.299
68.7236
62.7699
60.2092
60.8982
58.7882
55.9869
59.651
52.7698
47.3946
41.4021
40.1268
45.9171
58.597
86.0074
130.041
156.753
187.741
193.64
191.823
183.607
169.363
152.815
138.206
122.888
116.217
116.896
109.948
105.298
103.562
99.8374
97.7144
97.3091
103.939
113.478
121.657
131.894
140.059
145.918
150.064
153.268
152.474
150.813
148.479
145.433
133.295
121.461
103.64
67.3682
41.1429
39.1183
53.0096
68.2772
73.2533
60.6805
52.9772
60.3983
56.4419
56.1035
59.7695
65.488
75.6518
88.8875
109.112
136.089
128.411
126.696
127.85
132.88
134.034
137.179
136.32
134.24
133.141
128.388
124.056
118.832
110.296
100.787
89.4482
78.8569
71.1409
65.3754
61.0053
57.602
60.4645
57.9624
57.2468
57.8205
45.0641
41.3758
38.2901
38.4413
47.8955
59.8459
71.1911
79.1892
83.5261
84.7007
87.0221
85.7216
85.0338
86.0763
86.916
87.0137
87.482
84.155
78.313
74.3588
88.8361
128.87
144.865
158.665
176.405
197.638
225.911
259.119
276.245
257.581
226.527
196.665
162.894
130.157
102.955
84.3579
71.4241
62.1235
55.0954
50.0806
46.5363
43.8578
42.7827
41.9902
42.3931
43.9807
50.1112
59.067
63.6518
58.2462
59.3326
74.5332
91.7996
114.774
136.476
174.73
198.525
215.434
213.859
281.993
289.598
327.441
299.248
254.164
193.172
145.507
114.729
94.5276
86.9192
80.2458
76.8277
77.0277
79.9381
83.4289
85.9859
86.1835
84.9074
80.8588
75.8206
70.3909
58.4314
47.7216
60.14
94.5645
118.945
128.462
133.362
133.615
133.054
133.624
139.295
140.79
137.843
132.634
128.455
124.403
117.624
101.132
67.5566
44.7446
38.2241
36.2958
37.8039
42.0551
48.1341
54.9875
62.5729
68.0779
74.0433
76.1301
77.202
77.7892
77.5106
75.6015
73.6554
69.6698
64.6584
54.7854
41.9494
21.9905
5.55448
2.06035
1.8758
1.85593
1.83737
1.7921
1.74979
1.61989
1.47849
1.96496
14.4129
16.608
21.8809
26.7662
28.7401
29.7898
32.2835
34.7708
37.2439
38.6322
38.9159
38.3604
37.0825
35.8244
34.6223
33.2445
31.8883
29.3827
26.874
25.8803
30.5161
44.1087
68.4663
86.6807
96.4239
94.3183
93.2291
90.8492
89.129
87.6376
84.2926
82.0472
82.2785
78.0592
75.0339
68.8336
65.1188
60.3619
57.7306
56.3591
56.0347
54.5459
55.6914
54.3118
57.0865
57.6849
62.9174
64.1086
68.5018
71.5361
103.998
100.368
103.785
107.493
109.049
104.175
95.9789
86.3487
83.7387
81.3252
77.4232
75.3805
75.7185
80.1088
81.1437
82.1765
82.907
82.8083
84.0015
85.3535
87.9416
91.2809
92.233
89.9252
83.4606
77.1911
71.2898
66.065
64.9471
63.934
63.2071
63.3913
61.0164
57.0674
55.3526
59.8953
71.3601
96.2974
125.137
165.619
188.416
202.161
208.027
203.945
205.236
209.338
213.566
207.75
192.876
180.034
162.173
144.686
127.277
95.9002
87.0007
71.5496
64.3884
57.0859
51.995
48.5632
47.1631
59.265
101.472
149.507
172.959
181.06
183.554
186.63
192.605
199.827
208.787
217.34
226.497
234.383
243.154
250.977
259.53
263.608
268.305
265.849
264.012
256.568
248.365
237.217
225.24
214.404
202.822
192.167
181.534
169.232
155.97
141.886
127.924
114.06
96.6455
81.4215
80.1447
85.407
94.342
103.892
109.785
112.358
108.838
100.041
89.5593
79.4674
79.5354
92.6777
116.46
129.737
136.047
140.48
143.419
144.475
145.522
144.975
143.598
128.618
112.969
101.985
101.139
96.8613
94.5688
90.8314
89.0219
86.5737
78.4035
72.5928
68.7939
67.7722
70.3096
74.45
79.2808
75.1089
76.7014
72.4658
66.5456
66.6063
61.1266
58.6305
52.4141
41.4792
37.8115
38.2631
43.6057
59.1974
92.5902
128.261
146.374
159.261
170.971
162.307
146.759
129.027
123.607
123.51
121.046
115.085
108.959
106.687
99.0076
101.911
97.5043
99.299
102.562
111.756
122.449
132.691
144.125
153.936
159.787
165.851
165.424
162.756
156.696
147.726
133.457
116.765
100.358
60.1598
41.2709
37.0042
41.3134
57.6784
70.4208
74.2694
65.4376
63.045
65.2632
67.173
68.5635
70.4779
73.1066
79.746
93.3772
105.267
135.073
139.062
144.091
148.177
153.986
155.853
155.512
152.747
144.956
137.981
128.847
119.566
107.06
94.9108
83.38
74.0241
67.9703
64.0409
60.1557
54.967
51.2609
51.8646
47.9381
41.9622
33.3335
32.114
29.2398
32.6044
43.1511
54.8864
65.6885
76.8241
81.337
84.5013
88.8862
85.8702
87.1235
86.1768
84.2167
84.4265
79.5884
74.8268
71.8972
72.6781
85.8498
122.884
146.318
160.392
165.703
165.111
171.697
186.439
211.797
219.477
218.807
207.911
181.539
146.958
119.68
98.5895
82.7029
71.5769
63.3967
57.6803
54.4078
52.4776
52.6484
54.2185
56.7306
58.9038
63.1215
65.5867
68.9486
59.9987
57.5019
64.6865
79.1661
90.9055
105.766
116.852
132.064
135.303
146.647
193.951
224.908
279.1
226.623
180.735
136.694
104.843
83.3877
69.0005
62.4753
59.2388
61.3241
67.3694
75.5831
83.1656
87.04
88.5984
85.1336
79.6637
73.2524
64.3257
51.5176
41.6184
46.6172
74.6947
113.56
133.353
151.182
167.217
175.408
176.633
170.606
162.448
144.518
125.524
110.226
95.9064
80.6215
63.7179
48.3007
36.8642
33.3228
32.9608
36.2648
41.2625
48.7578
55.9209
64.6519
71.2827
76.8861
79.8611
80.0443
79.4342
78.0593
76.121
71.6614
65.5535
55.8668
45.313
29.8679
9.5772
2.31756
1.91727
1.89496
1.88164
1.84005
1.77536
1.69003
1.5721
1.44392
1.9082
9.45503
17.7058
24.8357
31.275
37.1817
40.3192
42.3249
43.9489
45.4715
46.1302
46.7437
46.5915
46.4371
46.2984
45.5479
43.8726
41.2554
37.9436
36.1267
33.3099
30.2961
29.2294
36.2876
56.4221
90.9597
105.307
105.58
102.716
100.149
96.5504
91.4964
82.3583
79.3401
75.8855
73.2554
71.1879
69.0337
67.0533
65.5184
65.3514
62.4163
65.2206
61.7901
62.2815
63.8332
61.789
64.6583
62.6325
66.1389
64.4797
105.127
108.876
113.195
119.626
127.283
133.28
139.245
141.911
142.627
142.815
141.158
139.227
136.691
134.469
131.107
127.09
122.694
117.475
113.017
108.668
106.895
105.091
104.196
98.6644
89.9347
84.0532
76.5013
73.8606
70.2191
67.8797
65.3407
61.4168
58.3394
55.8515
57.1222
64.6118
78.6552
85.2565
90.4484
117.288
130.678
149.011
153.048
156.328
165.516
167.969
188.76
186.299
181.986
174.922
167.024
160.138
151.913
145.405
120.654
117.679
95.4641
84.8005
81.5861
73.9157
70.8591
67.7979
64.8578
69.6977
100.68
120.208
122.582
127.33
138.283
152.842
156.897
159.428
159.849
159.651
158.32
156.278
153.509
148.301
146.877
143.886
144.289
143.972
144.855
143.847
144.068
145.028
144.574
144.811
144.523
144.489
143.473
141.031
136.355
128.856
117.272
108.058
104.228
102.933
103.093
104.461
105.116
106.483
104.687
100.168
94.4963
87.2247
77.5969
83.8316
103.036
124.631
131
132.065
131.178
129.5
128.384
129.787
131.254
134.442
128.178
116.563
120.25
112.972
112.795
106.035
103.038
98.938
101.33
100.328
96.3896
94.2292
93.0174
94.513
94.9394
95.7878
82.1542
80.4027
78.5578
69.6538
72.0842
70.577
61.9529
52.7115
46.8544
44.8851
45.56
50.201
63.926
88.4783
104.268
122.89
129.7
137.69
136.762
143.761
146.413
144.266
150.416
149.353
146.153
143.549
145.869
140.575
144.968
140.118
140.12
137.586
135.849
137.537
136.689
136.028
135.959
138.606
137.408
137.094
134.174
130.867
131.134
122.011
120.742
72.6749
54.4337
46.9506
42.9315
46.7085
57.723
68.3176
78.6933
80.9016
81.4447
80.6663
75.0479
76.0807
73.4279
78.2209
76.763
89.2254
96.0118
98.8167
129.863
129.352
143.488
142.402
144.337
142.138
139.794
137.572
133.501
129.25
122.619
115.03
106.134
91.3738
73.6919
52.06
34.8386
29.9759
28.2653
33.2675
33.6899
30.4363
29.1077
28.1759
28.7541
31.0692
34.7346
41.5282
46.9483
53.8149
59.6989
61.2975
64.5357
64.2534
65.62
64.8202
67.983
67.2695
71.3186
72.8877
77.8821
79.0916
85.5663
120.525
140.979
141.288
140.249
131.91
119.324
108.47
98.8752
101.679
107.399
113.14
116.966
114.413
106.901
101.476
97.5933
95.7566
95.3109
96.0427
98.5575
99.0333
103.697
102.486
108.6
106.691
113.991
114.266
115.7
103.328
83.3383
75.988
74.2972
75.4322
71.967
71.6299
66.7507
64.6115
63.1644
97.3612
79.5942
152.074
114.921
103.922
89.7443
77.4319
67.6965
61.0206
58.1586
56.7565
58.9776
62.5286
66.8123
69.4171
71.9906
72.5163
73.8801
74.3247
76.0779
74.619
68.2172
61.7606
58.986
67.3437
91.2718
77.9516
71.2865
82.5345
102.978
120.098
128.842
132.541
127.7
118.811
107.994
93.9711
82.6054
74.6916
67.7646
57.3987
53.2502
52.7604
53.7143
55.7447
60.8138
63.1001
70.0735
68.956
75.7124
71.6496
71.6034
69.1866
67.8853
65.176
60.7415
50.4811
35.3363
17.7206
6.46221
2.88512
2.67824
2.67746
2.66439
2.70567
2.64853
2.54913
2.48259
2.24207
1.97303
1.72616
2.24385
5.04415
6.39289
7.12977
7.73417
7.42478
6.91914
5.84243
5.36759
5.13754
5.4697
6.17832
8.53267
8.17879
25.6435
35.3463
40.5928
44.9043
47.6865
49.712
52.2405
53.5993
54.3394
55.4119
54.3465
52.8817
49.927
47.1135
44.1728
40.8449
37.4616
33.665
29.8389
29.3397
32.1043
35.0793
34.2396
30.0832
28.0877
28.8954
29.2058
28.3626
18.7529
9.54111
37.2705
71.4714
84.8346
92.8665
99.7654
104.288
105.595
104.632
99.7193
97.5027
92.7148
92.9529
83.887
83.1844
71.2976
63.2643
55.1236
51.0011
50.2818
50.1499
43.0658
30.6116
23.1763
19.9847
19.2027
18.5276
18.4782
20.1906
23.6606
19.1813
37.957
66.3132
81.9863
94.4525
108.416
125.277
145.763
155.79
158.65
162.674
164.372
166.523
167.582
166.142
161.711
160.506
155.838
153.429
149.275
144.423
138.421
131.556
122.036
106.718
83.3014
63.7946
53.4034
47.2335
43.2735
30.6596
32.4065
41.8498
47.9713
55.1804
63.2403
72.163
81.3074
90.9992
93.4894
104.923
100.386
102.583
97.5984
95.4657
96.1399
93.9168
93.9555
92.9728
92.0155
91.7157
92.8544
95.6076
98.1133
88.8663
73.2701
60.8019
59.2584
48.7422
43.5217
32.9155
40.7479
51.6495
56.1324
66.7422
78.7115
82.4741
82.5591
83.4104
83.6159
83.1076
83.29
84.2731
86.6482
90.9781
97.0888
104.722
114.148
123.359
140.995
158.509
147.135
171.975
167.297
151.913
146.68
141.103
128.535
89.0922
50.8183
33.8111
28.4059
40.1088
54.5651
75.2416
83.995
81.9158
77.1414
76.5359
76.485
78.4239
77.1251
79.9709
81.2031
85.3704
89.2284
92.2348
96.1758
98.2844
101.552
103.324
103.355
102.633
100.564
95.7088
90.7683
82.1238
72.0782
59.4711
50.5199
37.5965
29.1794
44.7047
49.8964
51.1128
48.5422
42.2103
43.015
49.1345
62.2154
75.6339
85.061
93.8354
98.5818
98.3645
95.7787
92.2697
88.8218
84.6644
83.158
83.3576
80.0387
76.7763
81.615
68.4096
67.315
55.1136
48.4432
39.8207
31.3258
20.8265
8.12766
12.7151
20.9556
35.6194
38.2945
47.7146
64.4044
80.6417
92.8459
101.324
115.127
124.626
142.76
145.1
146.562
143.458
138.895
130.354
119.058
105.791
89.3663
70.6183
52.0559
33.5659
22.196
14.4912
10.9648
7.95518
6.04023
3.91718
2.99172
3.64829
4.08011
4.98362
6.95726
11.1657
16.1512
23.2211
35.5092
49.299
57.3185
65.6786
78.1816
83.7958
90.26
90.6199
89.9348
87.0649
84.7884
81.9886
79.5524
78.0369
77.4781
77.6066
77.5653
76.8821
74.4817
72.2324
62.4885
43.9016
3.66082
3.83725
5.88054
9.96024
15.1739
27.1676
37.944
50.1524
65.3281
92.2538
89.0625
120.934
108.017
118.087
113.154
109.352
106.171
104.666
106.029
112.009
122.404
139.248
157.438
181.751
162.195
170.744
121.865
99.9435
78.0265
49.5503
5.47364
7.63826
19.4752
22.6616
32.3932
44.7469
56.8364
69.5202
83.2887
90.2453
104.086
102.521
110.895
101.579
103.335
91.3018
85.3358
72.9098
62.7342
51.0475
40.2603
31.439
23.0964
15.1195
8.59425
6.24187
5.31971
4.71855
4.03558
3.21572
4.99588
4.46164
5.27713
8.03421
10.1792
12.8392
13.3001
14.5447
14.0086
14.6748
14.412
14.477
15.3751
13.0738
13.6868
11.2015
10.4245
8.10214
7.19535
6.34858
5.64387
5.23047
4.84082
4.59849
4.46964
4.51084
4.31449
4.17992
3.62237
2.95935
3.6852
7.63568
8.97875
10.343
12.085
13.0455
14.3054
12.5598
10.9627
9.1474
8.35877
9.28361
11.2831
16.235
34.3867
29.3744
34.8329
41.2937
47.7462
52.4237
57.8171
61.3569
65.0517
69.5986
73.6298
78.3148
81.1237
82.8907
82.8755
79.4046
73.3964
64.3361
54.3345
46.7037
45.1619
47.2854
48.8663
43.9072
38.0048
34.0125
34.84
35.4883
28.1165
17.8753
53.3324
76.5238
81.6146
91.2296
105.028
121.534
139.079
155.891
168.008
174.012
169.25
165.461
149.031
144.032
124.188
116.664
102.538
91.3073
86.1719
82.8818
80.2141
71.4007
53.753
37.4781
28.3926
24.2541
22.0071
22.8782
28.2064
34.584
52.9183
68.1147
76.7763
88.0781
101.142
117.23
139.866
160.958
191.588
207.684
221.163
233.964
239.193
241.932
239.538
232.771
223.651
210.241
195.176
178.121
160.128
141.694
122.944
104.675
87.7181
68.8835
58.2227
51.8818
49.2701
45.89
33.32
38.0765
47.1237
57.1852
67.8643
78.6658
89.2651
100.051
107.998
113.301
119.491
115.149
112.085
106.444
101.849
95.9143
91.0301
85.5906
82.6853
80.5239
80.9465
83.0951
89.0042
88.8137
83.9589
72.1919
67.0852
55.5063
47.3647
55.5624
64.4531
58.5274
65.7959
72.0715
67.2989
66.4832
67.2961
67.8655
67.7802
67.4241
67.2596
69.0093
72.2386
77.203
83.1326
91.6309
100.728
110.027
121.115
138.458
142.966
151.811
157.913
152.661
150.028
153.332
153.479
124.395
84.1524
69.4427
38.4631
42.9086
62.017
81.3789
83.836
77.7216
76.3636
76.9509
77.624
79.3014
81.6433
84.9299
90.0801
96.2193
101.535
105.927
108.609
110.982
112.904
114.504
115.834
116.298
115.261
111.225
106.63
99.5989
91.5192
80.6762
71.9548
68.6393
53.1909
57.6809
65.2521
69.381
73.9267
88.0517
101.517
95.9527
104.835
112.152
118.953
122.706
118.96
112.935
103.619
92.5983
80.6327
72.735
65.0531
59.2595
60.9218
62.5973
71.2871
64.1611
68.3266
60.2722
59.1153
57.5592
53.4943
50.5002
15.2758
19.3952
54.2218
77.2994
99.6413
122.26
140.501
154.155
161.724
165.562
167.07
175.977
179.505
174.623
164.935
156.642
147.081
136.025
123.645
109.55
95.0745
79.6225
61.9547
43.5667
28.4331
16.1653
10.0629
6.52629
4.64628
5.61158
4.90597
4.09217
7.51852
16.7862
36.3238
66.2683
95.1324
117.365
136.072
132.72
132.657
130.167
123.29
122.958
115.831
109.746
101.286
93.3902
85.3524
77.7585
70.9124
65.459
61.864
60.4184
60.9824
62.1895
59.1569
59.6966
63.602
56.4867
11.6885
13.9854
31.6074
56.5942
76.4907
97.1985
107.969
106.943
111.033
113.306
122.313
119.24
117.69
109.6
101.354
92.7767
85.8302
82.1123
85.6585
98.4486
124.347
167.49
222.549
271.22
291.819
300.228
239.57
182.593
135.472
116.91
36.3184
54.8828
79.3527
81.2111
96.9965
111.017
120.05
127.72
130.282
128.318
125.18
121.227
115.969
105.673
97.4281
83.2385
73.3798
61.7651
51.8515
43.4622
35.3632
28.0012
19.5322
12.5839
7.41618
5.317
3.56111
2.79496
2.53821
3.90322
12.4458
9.41733
14.7851
23.3315
28.8894
35.2893
37.3929
42.1766
42.5675
35.9029
28.2547
22.5707
18.7963
15.2936
13.1328
10.4311
8.47889
5.95952
4.4006
3.61589
2.99208
2.61422
2.32582
2.14367
2.07536
2.08741
2.28644
2.36889
2.28205
3.36901
5.51115
10.5946
11.1989
11.8574
12.8443
14.0832
15.8503
15.854
14.5249
11.073
9.38408
9.60416
13.0844
22.3551
34.681
35.2386
50.8647
64.9254
72.3189
70.701
67.4514
65.11
63.725
64.7584
68.0459
71.4194
75.413
78.8185
82.2604
80.0803
75.6951
68.0721
57.6351
48.8555
44.1531
44.9581
48.7242
46.8837
40.6752
34.3817
32.5281
34.7105
31.4724
21.4745
61.3327
75.7508
79.1787
82.3139
91.3232
106.215
127.523
148.09
164.535
168.473
161.346
158.65
141.724
140.157
128.066
122.384
114.519
104.765
96.4214
92.8085
90.977
89.1176
79.9829
59.0712
39.8441
28.1525
22.3431
21.5317
28.0511
39.5338
57.761
77.2397
81.9275
82.3649
85.9268
93.5974
105.138
118.745
143.033
159.512
180.694
194.685
204.258
212.07
215.662
216.767
213.749
205.13
193.479
179.164
163.736
149.217
134.632
119.517
103.988
85.2992
66.7151
57.637
56.3129
58.4688
39.7
56.983
71.5379
80.402
84.6506
87.9827
91.0017
94.6195
99.8452
105.258
106.057
108.273
103.066
96.479
92.6754
84.3741
80.2797
74.8614
72.7363
72.6694
74.3163
77.0534
83.3818
88.5937
90.7689
81.5794
74.1868
61.7775
51.9096
68.2878
77.8559
67.3114
73.0636
68.8387
67.6449
77.7971
84.0713
81.1553
76.9754
73.0001
70.6055
68.4763
69.1917
71.7484
76.2294
81.849
87.6591
94.6377
100.201
111.142
114.926
117.528
121.285
120.722
118.017
124.539
136.464
135.313
103.167
83.992
44.738
47.2962
71.6261
79.9631
77.4371
75.506
77.0541
78.2977
80.7959
85.3051
91.7214
100.54
109.25
115.271
118.211
119.434
119.206
117.508
115.577
113.746
113.416
111.669
112.35
111.4
109.255
104.047
97.5687
89.0613
81.9879
79.6479
68.1914
68.1443
72.9104
75.88
87.2181
105.084
106.735
108.381
121.838
136.889
139.072
139.32
137.459
134.125
129.825
124.966
118.628
108.62
87.4608
76.9885
72.3307
68.6499
81.3802
69.7098
69.4654
55.492
49.9795
50.5223
53.1771
53.6267
23.43
35.1667
69.4522
90.6697
117.808
139.089
152.781
162.372
168.811
174.861
178.658
181.03
177.667
172.811
165.297
159.495
151.992
144.285
134.565
124.119
112.794
99.4474
84.3964
65.3362
45.9949
27.2042
16.2704
9.00833
6.03149
7.92421
5.48295
4.97222
10.702
24.9983
45.7162
74.0858
104.031
125.778
125.979
126.084
115.8
113.667
111.696
107.528
106.856
101.595
95.8385
87.6423
80.9748
75.0337
70.8764
69.3571
70.6226
74.5596
79.5144
82.0897
66.9375
47.376
61.0694
57.2189
16.1015
17.6483
36.0154
56.2369
77.4529
93.2072
92.5571
95.6624
95.4346
99.4348
99.6784
103.458
101.918
102.583
102.244
103.151
101.454
98.1859
106.027
128.841
174.807
236.221
275.708
300.88
318.928
318.112
266.511
213.069
172.097
143.436
63.0656
83.2122
86.021
98.0973
110.795
119.244
125.859
128.669
125.682
121.356
120.357
118.702
118.2
109.176
103.138
90.3973
81.693
69.9576
60.5289
52.8497
45.9049
38.6443
30.604
21.6472
12.805
7.43894
4.87789
3.75622
3.02085
4.88619
15.732
11.7891
18.5987
27.5349
32.7087
38.9856
37.2033
36.9079
34.3662
32.9154
30.1211
26.9447
24.8981
23.1436
23.6224
21.1825
17.8213
11.215
6.43378
3.8443
3.12528
2.80126
2.54658
2.36633
2.14867
1.98325
1.94812
2.24614
2.34589
3.85583
7.16268
13.0943
13.5119
13.6232
13.7111
13.807
15.0025
16.0357
15.9427
12.7248
10.5449
10.1659
13.8458
26.961
32.4487
45.6597
72.765
91.9008
89.6551
74.6588
61.2963
53.5759
49.9472
48.7951
49.3678
50.4648
52.6116
58.344
65.9869
69.7912
70.9783
65.9497
57.7451
48.6931
43.0471
42.7751
46.1183
48.3113
42.6276
35.406
31.946
34.2552
36.532
26.0208
68.5958
87.8761
85.4453
83.653
84.7541
95.421
114.494
139.834
153.465
156.595
144.692
137.799
127.138
126.453
121.406
121.724
115.736
114.035
107.434
104.029
102.295
101.712
100.05
87.2362
60.0187
38.9886
25.9061
22.5646
28.0014
46.9526
69.2016
78.3962
76.6487
76.6997
80.0452
85.3402
92.868
101.546
116.811
131.482
148.469
162.218
169.36
174.56
180.272
185.236
188.011
187.065
182.181
173.659
162.679
151.655
141.664
130.532
116.921
99.2236
78.7628
65.504
61.9866
69.2928
56.0931
91.4698
98.5608
92.2054
83.3108
77.8349
73.0469
73.7725
76.5701
78.1434
82.2143
82.0213
83.0674
80.5353
77.496
73.3993
68.3021
65.7067
64.444
65.3421
68.1983
70.6013
76.9763
82.4865
88.0613
87.5738
79.2138
67.9433
56.5388
74.6452
88.8724
76.8445
79.7609
77.1736
87.0669
92.9093
96.4724
94.1524
86.971
79.5334
77.8247
77.4486
78.6285
81.6407
85.3359
88.193
90.2275
90.0601
88.6362
91.2414
98.8368
95.7545
99.0628
98.6276
99.9703
105.887
121.351
135.878
117.419
90.5688
50.2557
57.0441
77.8753
79.1256
76.3153
77.7693
78.5495
81.5931
85.873
95.1608
105.661
116.642
122.942
120.585
121.441
122.944
119.995
116.73
113.547
110.964
107.892
104.551
102.966
103.409
105.88
106.187
102.717
96.4322
90.7899
85.4449
80.5701
76.2617
78.8658
85.0959
101.054
118.13
112.016
122.684
136.18
135.475
133.917
132.162
129.769
127.573
126.017
123.693
122.158
120.803
115.555
105.657
85.3373
76.8499
92.2455
81.1239
77.7269
56.0533
44.9577
45.3897
53.5557
52.5406
34.2067
60.507
83.1653
106.311
131.571
148.142
157.506
161.64
164.514
166.467
168.602
168.711
165.547
161.864
157.692
153.212
149.176
143.341
137.361
130.101
120.632
110.252
98.9769
84.1256
63.4578
40.5429
24.3
13.203
7.90317
10.7534
6.48548
6.89475
15.775
31.6462
50.5957
76.4335
106.552
121.009
122.79
111.833
109.571
103.974
104.938
102.144
100.224
101.003
97.305
91.334
83.1325
77.3359
74.8608
77.8414
87.0176
101.345
116.819
122.135
91.2716
50.1933
62.4999
52.9684
19.5856
22.0428
37.9024
56.3277
77.0276
84.0082
85.8011
81.4886
83.9425
83.3602
90.5321
89.4337
95.4699
96.9161
105.742
117.288
120.298
116.653
136.887
194.969
257.426
279.438
298.783
303.875
310.18
314.004
276.889
240.624
219.485
171.103
86.5956
91.5519
98.3709
111.015
117.689
120.138
119.321
119.109
114.942
114.633
111.636
115.479
112.48
110.768
102.752
93.8158
82.5664
72.9931
65.1517
59.4256
53.145
47.8698
41.1567
31.6972
21.4888
12.5411
7.02485
5.168
4.25691
6.16734
21.2101
17.5022
26.4056
34.0206
39.7257
38.3584
38.7859
41.075
41.875
42.1753
42.6709
42.6185
43.3135
45.4837
46.1241
43.1138
36.6999
26.5806
14.9263
6.13354
3.44945
3.02621
2.86422
2.73562
2.55983
2.24206
1.98145
2.0668
2.29116
4.3207
9.23619
17.2757
18.3899
18.4832
18.1043
16.858
16.2922
16.1082
16.0526
13.3591
11.3801
11.0079
14.2857
30.2672
38.8376
51.8164
88.3021
106.18
90.7115
66.2302
50.0269
42.085
37.8268
34.594
31.2383
29.6094
31.4718
37.4405
47.6945
56.7514
61.6454
59.9972
53.3958
45.4385
40.2461
39.5055
44.0977
47.3687
42.9409
35.9555
32.0851
36.3319
43.2417
31.4062
83.3851
108.14
103.795
87.7327
81.4559
82.2213
95.7575
115.057
128.366
132.467
116.91
117.364
106.463
109.618
108.518
112.576
113.408
112.322
114.978
111.517
112.866
113.968
118.345
109.057
88.2462
55.8293
32.8577
24.9797
28.9589
53.449
81.5965
75.7676
74.7454
78.3586
83.5355
89.7149
94.4309
98.2325
107.902
111.53
125.869
131.658
136.691
141.192
145.037
150.242
156.339
162.029
163.642
161.939
156.227
149.772
144.189
137.09
125.769
108.149
86.9247
71.4579
66.1243
78.8938
87.1693
124.523
108.621
87.9821
74.3844
65.9566
60.359
60.3148
58.0661
56.5123
56.4592
59.0599
62.0452
62.1419
61.8626
60.1566
58.473
56.6237
58.0371
59.282
62.8035
65.97
71.7284
76.0681
84.3341
85.0838
81.7369
71.8862
60.7474
78.9311
100.172
86.6165
86.8474
86.4958
97.6557
103.369
105.897
99.1932
97.1729
94.5344
92.1536
93.041
95.4718
97.2835
97.6132
97.5942
92.7142
86.3041
81.0606
79.3996
76.0602
77.6188
78.9332
82.1543
87.7277
96.8948
114.048
137.36
131.034
92.5707
59.4243
63.7446
80.6043
78.7354
76.2137
79.0404
81.0374
84.5434
92.2788
103.619
114.792
122.655
125.859
122.443
123.489
122.719
121.024
119.15
116.976
114.63
110.228
103.859
98.7356
97.9408
102.411
105.271
105.39
101.957
100.435
92.1317
90.1959
81.9854
82.7772
93.2921
112.245
116.855
119.411
134.281
133.877
129.941
125.121
120.758
111.55
104.248
114.631
123.361
124.539
123.29
123.52
118.192
104.837
86.4942
97.901
94.769
85.134
60.3041
43.1918
43.7436
55.3577
52.1867
48.1309
89.6262
97.1919
120.296
141.722
152.473
156.545
156.446
153.805
152.339
151.276
149.668
147.941
146.423
144.387
143.062
140.628
138.284
135.467
130.356
124.343
115.615
104.53
94.7712
79.3201
54.8824
32.6881
18.3379
10.8378
14.6972
8.41852
10.1145
21.7097
36.4649
52.9424
75.7279
103.957
110.869
108.443
104.129
96.1433
93.4467
85.7232
86.3086
92.5887
99.7751
102.694
96.7587
89.1321
82.3581
82.9512
95.6129
124.672
172.836
186.525
165.801
130.52
53.9918
64.4612
50.0653
26.2641
27.935
45.1529
58.4794
72.3385
78.8168
71.041
71.5311
66.9854
72.5637
73.0137
83.6627
90.248
99.5157
111.966
135.412
140.635
136.956
184.402
261.367
298.757
290.613
285.945
268.182
255.672
258.499
273.565
271.228
288.667
209.339
108.803
104.708
114.427
122.349
121.414
115.986
110.712
105.337
105.426
103.565
108.511
107.845
112.293
110.726
106.057
96.0152
85.7718
78.2301
74.1633
71.2585
68.1931
62.446
53.7144
44.7106
32.5725
20.1743
11.783
7.23722
6.36394
8.69609
28.803
25.696
34.5142
39.9831
40.6694
41.4119
43.1177
48.6979
52.2649
57.611
61.2415
64.9423
67.3391
67.7374
66.5824
62.053
55.7139
45.183
29.7982
13.9427
4.47567
3.16383
3.03417
3.04573
3.03647
2.78572
2.19183
2.05761
2.48434
4.62517
11.713
22.9051
24.3208
24.0078
22.326
20.5092
18.2781
16.7228
15.6413
13.1123
11.8892
11.67
14.3356
31.0082
45.7579
57.8286
104.515
109.783
81.0484
56.4538
42.6779
36.3766
32.3409
27.6829
23.5173
21.4765
22.7367
27.9825
36.6376
45.3662
50.0186
50.378
45.246
38.9661
35.7757
36.9624
42.8147
46.1376
40.2305
34.59
34.206
42.7138
55.7703
39.4315
109.684
148.623
127.297
94.6263
79.4494
76.4083
79.696
88.8483
99.6744
105.272
97.2144
97.7155
93.1874
96.8782
98.6771
105.053
105.272
103.831
103.667
107.928
111.322
118.889
120.324
122.268
106.836
73.1725
41.5929
28.8782
30.7477
59.452
89.4663
73.983
77.4672
86.207
94.9542
101.338
101.459
104.05
103.818
99.672
104.677
104.29
100.917
102.957
106.516
113.953
123.995
135.225
143.918
147.992
148.264
145.697
143.651
139.816
129.55
111.443
89.2272
72.7371
66.8873
85.1494
122.993
139.81
110.43
90.1505
77.6288
70.5095
62.9898
60.5196
52.3078
49.7249
46.4771
47.7582
48.4643
51.0367
50.8874
51.1269
51.1769
51.9734
53.5267
55.9176
58.262
61.3323
65.453
70.9077
77.3989
81.9617
80.3727
74.2485
64.1535
83.047
111.245
96.1003
93.9157
97.2122
101.742
102.628
102.756
102.857
101.279
104.948
107.229
106.822
106.02
104.897
104.075
100.952
93.7305
85.797
79.9427
73.0575
67.9499
59.7208
62.5972
70.7042
78.9716
93.2046
115.311
144.899
143.787
88.0393
66.4867
70.4207
82.0162
75.7105
80.5905
82.089
83.5986
88.1533
96.1315
105.795
114.064
120.581
123.561
124.42
125.184
126.21
127.12
127.199
125.527
123.247
116.871
108.974
99.0293
96.0791
100.22
104.295
106.253
105.535
109.593
102.855
100.667
87.815
87.16
100.636
119.856
118.606
125.473
136.186
129.635
120.109
110.305
93.043
81.902
89.779
97.7357
107.421
125.653
125.349
127.071
125.092
114.797
95.5023
96.9083
103.135
90.6121
64.8364
43.477
43.845
58.8308
48.8815
59.3755
115.159
113.072
132.645
148.289
155.002
153.234
147.892
141.524
134.729
129.567
127.007
126.388
126.834
129.249
130.326
131.452
131.826
130.232
128.714
124.775
117.242
107.707
97.635
87.0651
68.2806
42.1046
24.3983
15.3761
19.7378
10.8436
13.7654
26.6225
38.7331
53.2894
72.7389
96.4108
102.229
100.438
92.8376
89.7386
79.1048
75.7344
74.1241
84.513
103.559
110.614
105.402
95.1376
90.7971
101.414
138.195
207.088
241.755
264.449
224.909
147.977
67.8527
69.8759
41.7408
33.1728
42.2669
59.413
65.2521
80.0479
77.6436
75.1192
66.6164
63.7601
58.247
64.1458
71.3259
94.1502
99.4063
116.979
150.83
161.472
161.605
238.119
289.554
316.629
262.558
262.663
226.949
190.283
197.784
253.944
323.698
354.518
245.996
132.61
126.753
134.649
138.15
129.297
114.841
103.304
101.122
97.3636
101.206
100.382
107.833
109.582
114.244
109.328
100.361
90.7706
89.0337
92.6385
97.0477
96.3817
91.116
78.8274
62.0182
44.4355
30.532
18.4909
11.0748
8.54673
11.683
38.4039
36.048
42.6181
45.1024
42.4172
43.9515
50.0488
56.3693
64.4564
70.1696
76.4709
78.2294
79.6192
78.1958
74.52
73.0749
68.3772
59.9351
47.5101
27.0347
8.41407
3.29812
3.03254
3.13665
3.31841
3.30051
2.52984
2.18096
2.59826
5.15289
14.7054
28.7767
28.7546
26.1669
23.7992
21.5591
19.1342
16.5558
13.9817
12.4857
12.8212
15.0609
19.8152
33.4445
52.0716
72.2468
114.185
101.301
71.3693
51.7316
41.7739
37.2034
33.6941
29.9321
25.7263
22.8004
22.1769
24.6483
29.1574
34.6713
37.7594
36.7027
34.1412
32.3502
32.5256
36.9834
42.9926
41.4002
36.4409
35.708
42.6474
59.726
75.6531
51.2025
132.251
167.255
152.939
99.468
77.5336
73.6367
74.5182
76.7426
84.0845
88.2852
93.3782
88.2815
93.278
92.9726
94.7758
87.4527
81.4569
77.1025
83.2853
88.4294
98.1839
100.11
108.433
113.271
108.975
80.627
49.4921
32.454
33.7181
61.4115
91.2142
72.5749
82.6673
96.604
109.674
113.647
116.278
113.449
105.812
103.75
99.0277
90.9072
87.2206
78.405
74.2351
78.0112
93.514
114.279
128.262
137.723
141.243
143.071
143.062
140.591
129.756
109.209
85.789
65.9748
63.6283
80.4188
162.334
149.531
121.967
107.473
97.4068
91.6057
82.8612
79.185
68.7064
65.7587
60.0806
57.051
56.3284
52.5375
51.8217
49.3561
48.8768
47.8203
48.0516
48.5834
51.5445
54.0386
60.3934
65.0422
72.5377
77.1928
80.4354
76.3372
68.379
88.0054
123.615
106.539
103.774
103.828
102.812
101.152
102.699
107.155
110.278
114.462
122.722
124.982
124.315
120.393
114.005
104.729
95.3797
86.5921
79.2062
76.5648
66.2023
58.0168
56.2169
63.9685
78.3876
95.2988
121.382
156.026
153.32
78.4406
76.4854
82.8978
82.3894
81.117
81.9196
84.0403
86.8328
90.1506
96.3849
101.572
108.445
114.766
119.676
122.912
125.962
129.706
134.073
137.367
137.919
135.134
127.345
115.832
103.247
98.0555
99.2363
102.646
105.33
107.427
119.593
114.894
112.692
93.9862
91.5657
105.765
118.651
119.955
126.78
134.299
124.064
109.512
92.6542
69.9349
70.3452
79.4629
89.004
111.347
126.702
127.849
127.797
128.314
119.068
102.483
91.1602
108.009
91.7258
69.1867
44.6892
44.6203
61.8304
46.7844
79.6026
142.505
127.025
141.12
152.552
154.818
150.17
140.888
129.637
118.809
109.02
99.24
95.3747
101.29
112.125
118.109
123.039
124.156
125.076
125.169
122.197
116.804
107.896
97.2452
89.6189
75.035
50.5829
30.5723
21.2529
26.7487
15.6912
19.0231
31.1377
39.9599
50.2918
67.6955
83.5441
90.0643
87.7988
81.6518
73.704
67.0644
62.1852
72.2083
94.0344
118.22
120.805
112.134
99.4435
96.6369
118.335
195.742
249.453
331.216
335.657
285.608
184.256
96.019
72.2196
50.382
46.3049
58.5933
70.9039
78.6986
80.244
81.2874
74.3925
67.2153
60.5852
59.7251
59.9377
71.5154
87.5043
95.9008
111.218
156.063
148.324
170.601
249.213
303.606
281.698
276.738
262.951
221.282
184.655
186.797
255.118
334.507
369.705
232.475
154.933
158.438
163.125
154.739
128.5
108.207
96.7079
87.2672
87.6566
85.7847
96.0105
100.475
111.013
115.405
114.734
104.495
99.9051
109.794
124.96
126.16
119.676
108.893
103.73
83.6813
59.833
39.9892
25.6368
16.7744
12.4431
15.6689
49.1888
48.0916
49.3229
46.5365
43.9684
48.5564
53.3658
63.3716
69.173
76.609
77.9801
80.6404
77.0523
74.3526
73.9161
72.4274
70.9589
70.5944
60.8823
42.5617
16.4371
4.05934
2.89971
3.03064
3.3448
3.69164
2.99706
2.65485
3.37328
6.35594
16.5603
30.2625
29.3646
26.4866
24.0673
22.2976
19.5036
15.4913
12.9642
13.9694
19.9173
30.8768
37.6238
39.4896
58.2144
87.7513
112.718
91.7108
70.0239
55.7669
48.0466
44.246
42.0795
39.3804
35.6972
30.9941
27.1787
25.684
25.934
27.2707
28.3824
29.1361
29.2419
30.4101
33.9718
39.1521
39.8318
38.7165
39.8541
48.8165
65.4645
84.4156
97.0837
67.8407
175.535
167.585
148.596
97.2875
74.307
71.3617
77.6385
77.3638
87.0087
85.4743
94.275
92.0381
100.661
92.1838
80.6738
70.7604
69.7154
79.4341
88.093
93.3879
88.668
90.4283
92.58
102.547
99.0711
82.0202
52.8954
35.6064
37.8939
64.6717
96.1318
71.3816
86.9878
108.324
120.804
130.783
131.106
122.398
122.472
114.612
110.193
102.603
89.4407
76.8934
70.3137
72.175
86.9873
111.714
127.456
137.264
142.984
145.929
145.464
140.484
126.129
101.971
80.3264
63.2656
57.8428
81.8846
204.197
163.809
149.491
142.083
137.676
135.83
131.806
129.652
120.618
111.113
97.6697
86.5758
77.0533
71.6219
63.7975
60.3874
56.273
54.6862
54.1436
53.6258
54.7877
56.142
58.9364
65.5191
72.0666
78.5873
81.7153
79.6923
75.9174
94.4841
137.988
116.712
111.197
106.675
100.87
99.2866
94.2577
100.308
115.557
122.317
127.962
130.474
129.363
120.185
110.058
103.89
96.5159
86.775
83.3671
79.3493
76.8559
65.6885
62.3498
70.2149
83.2899
104.378
133.101
166.604
152.475
66.6992
91.3159
86.4922
85.5718
77.0141
85.5035
86.5837
87.8077
90.7594
94.4736
98.4355
103.117
108.9
114.249
119.346
124.282
130.251
138.046
145.905
150.47
148.206
139.71
125.505
109.821
104.244
105.069
105.669
107.153
113.952
138.875
141.513
122.824
100.42
94.8554
108.402
116.951
118.151
123.613
132.667
120.666
104.689
84.2546
66.0726
68.8775
78.8453
103.638
119.185
128.918
129.747
128.713
128.715
121.646
107.587
89.6016
101.777
91.0368
72.2586
44.4857
46.5684
65.1726
47.3153
95.0204
170.575
139.657
145.67
153.387
153.39
147.646
136.509
123.373
109.146
96.7441
84.7398
76.3925
83.2231
99.599
110.497
116.055
119.192
121.561
121.417
119.711
114.433
105.111
95.6716
87.8853
77.2498
57.3517
39.1157
34.0788
49.0696
29.6766
32.0164
35.6414
41.2208
47.192
58.4638
71.6849
77.52
77.8452
73.0407
66.67
62.3854
62.4599
79.2464
114.111
125.611
127.038
114.571
104.238
111.905
163.727
212.699
305.878
354.053
315.721
304.523
218.603
142.61
80.2626
65.1301
90.5199
111.149
101.453
91.8006
83.7618
77.8844
74.6089
68.2565
66.2803
64.6131
68.9399
76.7164
91.3414
87.9834
107.397
145.205
138.771
154.073
249.644
299.666
294.817
248.522
268.518
248.966
226.88
239.256
282.85
339.805
368.184
208.093
175.565
226.741
197.301
164.582
136.136
117.181
96.5564
84.119
72.3941
77.2105
84.3168
98.3381
107.143
116.771
117.113
105.187
108.316
134.566
139.123
126.592
114.443
103.882
95.9047
88.6124
69.4483
45.9288
32.4043
22.8425
18.1391
22.3919
65.5097
61.8908
56.2808
46.924
46.8714
50.3172
57.5164
65.2555
71.6312
77.453
75.9416
71.603
68.0494
64.7417
65.0767
66.3736
71.5483
73.145
68.8898
56.8118
27.6612
6.74367
2.76024
2.74211
3.12613
3.87941
3.95897
4.25797
5.55791
11.5101
19.203
31.9588
29.7454
26.9694
24.6356
22.7076
19.3475
15.2287
15.1514
20.5533
33.0157
49.737
68.6378
72.9553
80.7816
97.4154
92.7981
133.482
117.792
95.6414
80.3715
69.3025
61.9749
58.2459
56.4581
54.4186
51.8185
45.7178
39.7914
33.2103
29.758
28.2804
28.0668
28.6044
30.1477
33.0797
37.6927
41.192
43.3202
49.6082
62.6335
78.2335
89.7884
101.563
116.773
108.104
126.029
106.736
156.12
150.593
136.271
99.4491
70.2129
70.7408
80.4055
85.521
99.0333
97.4949
110.928
102.331
98.0206
90.8424
86.4835
92.8452
103.715
109.418
108.061
98.4708
91.4563
79.698
83.4268
88.404
93.72
77.3064
53.4566
37.5403
43.0605
88.0354
153.725
132.112
70.5341
75.8184
93.4458
112.864
133.425
144.565
143.938
143.286
140.698
141.949
142.525
130.974
119.846
110.141
104.615
110.271
125.001
141.426
150.005
155.545
156.9
156.55
150.62
140.195
122.292
104.237
71.9072
65.4867
77.3263
116.494
162.231
200.725
179.001
184.715
189.492
196.011
202.737
208.387
211.63
212.631
211.241
204.562
195.63
176.482
158.866
141.556
127.445
112.362
105.051
92.5677
83.3227
76.4761
71.5997
71.1838
73.4432
75.8314
81.3419
85.1409
84.8525
80.3499
73.2173
80.4043
130.849
166.602
149.295
128.966
119.54
108.883
100.435
86.3086
89.6295
98.1604
108.362
122.989
129.691
133.522
132.853
128.617
117.036
106.712
97.6219
90.7238
84.3042
85.6287
86.8265
81.5461
77.9945
83.2662
95.6746
115.66
146.317
164.04
140.756
63.1765
81.8854
113.655
91.8583
95.7153
83.856
80.5592
83.6656
86.999
88.1256
88.8076
91.0148
87.5279
93.2489
97.2262
105.258
112.22
118.477
125.491
135.859
147.878
157.818
159.361
151.525
137.979
123.713
114.27
113.152
117.124
122.283
132.459
158.933
183.76
171.703
146.624
122.01
107.15
98.202
108.807
116.25
115.092
119.112
129.695
121.893
107.414
91.5229
81.9
85.0632
99.135
113.682
123.86
130.456
130.805
127.125
128.635
120.851
106.06
77.4743
93.5198
91.3217
72.1793
45.5349
48.0225
67.7858
72.3593
81.4741
97.24
121.437
178.373
145.669
144.843
148.895
149.591
144.335
134.762
122.63
110.594
98.7098
87.2332
80.7591
91.3445
100.239
107.912
112.231
116.222
117.527
117.937
115.64
109.641
101.326
91.7033
83.4783
77.2047
62.7087
53.9927
58.4356
77.8214
81.8289
80.1123
69.8111
56.9334
48.0571
46.857
47.8529
49.9931
59.2857
66.7611
68.347
66.3855
64.0478
62.1529
71.7248
97.2897
122.775
129.865
121.052
109.439
100.687
116.295
185.519
223.151
329.595
332.669
311.026
284.185
255.554
179.156
90.7719
63.1645
104.993
175.476
234.704
169.075
131.006
105.504
90.5477
83.8557
78.5553
76.3383
77.2287
83.5085
85.1551
87.9205
81.6724
73.9559
91.3389
123.336
116.144
154.733
244.281
302.355
270.727
274.815
257.572
273.658
273.656
288.978
307.62
324.913
336.232
202.702
185.481
235.636
282.343
294.316
216.367
175.498
141.099
111.387
91.0321
71.6631
59.9388
62.909
78.766
91.9983
102.597
117.772
113.803
103.657
121.676
147.692
142.272
130.125
116.209
98.2253
88.316
82.4776
71.0186
50.6731
36.1328
28.9601
31.5307
66.7968
83.0496
148.623
117.85
73.9492
58.5632
48.625
47.5735
52.1903
57.9954
64.1684
71.8816
71.3151
68.9848
58.7492
48.6531
47.2779
54.4847
61.8837
68.5407
72.2113
73.7408
65.4102
40.2745
12.3236
3.18812
2.40102
2.67826
3.61675
5.36112
7.74292
9.66469
9.81007
3.97876
2.44028
19.0704
29.3005
28.64
26.8879
25.4356
22.573
19.5346
16.1085
14.7786
16.4919
23.302
40.7194
69.9556
107.875
138.769
152.325
142.581
138.197
121.142
107.489
97.2267
87.4316
80.6384
76.0146
73.5529
72.0738
70.9274
66.1613
61.6528
53.0964
45.115
40.1953
36.3953
36.8199
37.9868
41.8084
45.8966
51.6441
61.8956
74.9404
82.3788
84.5792
80.8571
83.5591
93.8131
99.6602
86.1236
87.1659
127.128
124.366
122.24
103.108
72.1754
67.9388
78.1509
91.3602
104.457
105.067
113.346
109.075
108.634
105.711
110.914
118.237
132.26
138.909
137.984
123.765
109.363
100.246
96.7
92.9565
84.1744
67.8725
48.473
39.3872
51.1321
84.2359
83.589
75.2984
64.968
76.8186
93.0795
113.928
136.994
151.357
161.748
167.866
164.559
182.281
167.05
167.088
154.296
151.513
152.548
163.746
180.808
183.439
184.881
181.466
176.743
169.389
157.713
145.69
132.433
95.1756
90.9633
109.063
152.163
166.369
173.315
180.053
194.335
200.614
206.385
212.991
219.244
223.49
225.424
226.411
226.807
226.264
225.213
224.737
223.396
222.388
208.577
191.102
166.706
156.702
139.92
126.472
114.611
105.472
99.1969
98.7619
95.6266
91.8633
86.5231
78.9446
74.1764
78.1056
108.719
145.253
157.339
135.761
121.517
106.252
86.6248
75.4035
83.5683
99.0757
109.1
118.539
128.165
135.112
136.443
132.893
118.042
108.056
102.457
94.5527
88.5255
86.3389
93.1718
96.948
96.9346
97.904
110.257
129.78
149.36
144.945
105.16
68.4573
62.7862
80.63
99.1299
100.329
84.7058
79.2334
83.239
84.4311
80.7539
79.9741
75.3103
74.195
76.5206
75.9532
87.6086
95.3524
108.372
115.956
126.792
139.868
157.117
166.754
163.682
152.779
142.205
136.901
139.267
142.219
148.342
156.287
167.157
187.079
141.385
120.82
123.416
108.857
99.3248
106.198
115.014
111.477
114.694
117.476
125.155
116.935
109.924
105.405
110.793
118.365
126.533
131.176
134.225
129.603
128.611
126.341
118.469
96.2809
70.125
82.9974
85.1054
73.1168
50.2883
49.2027
72.2825
83.2798
87.5021
109.025
139.904
158.173
142.056
136.963
141.288
142.668
140.111
134.575
126.764
117.96
110.92
101.758
102.453
105.226
108.449
110.08
113.72
114.873
115.951
116.258
112.841
105.721
96.2762
86.2664
78.1284
74.5223
64.9235
63.2459
81.0312
98.9172
81.0061
81.0952
84.7207
63.2149
52.6097
54.2266
55.8658
53.9852
51.4746
56.4728
59.3061
60.4015
60.0935
66.1839
84.3845
106.344
118.656
112.559
108.971
101.044
97.5986
125.114
174.605
225.379
327.462
306.516
303.796
279.187
273.964
222.873
144.394
110.67
170.109
230.051
270.698
183.312
152.426
124.324
103.749
95.4609
92.9742
93.4594
97.2586
95.5789
93.061
82.9524
73.6303
62.8893
85.4023
104.313
103.653
130.374
230.784
284.791
313.015
264.75
265.422
240.092
273.121
256.262
259.772
240.217
235.431
154.202
138.659
239.816
366.245
287.932
215.754
174.156
137.916
106.893
82.6176
64.5599
55.0137
62.9557
77.5164
87.7002
99.625
104.648
102.237
98.9201
119.095
132.18
125.091
124.262
118.213
105.559
89.4866
84.6745
73.4361
49.7707
39.6282
36.6506
50.4563
82.0861
93.3253
128.442
122.041
73.3992
56.3272
47.3868
48.2619
51.6077
56.1809
63.0314
67.1932
68.0635
61.6834
50.5153
35.7353
38.5375
50.1679
61.3653
66.1377
71.9161
74.0253
69.9928
49.7989
20.6337
5.20759
2.24363
2.17904
2.50074
3.65559
4.81758
5.40376
5.30576
2.18491
2.44678
19.6656
28.293
28.2487
28.1358
27.3785
24.1106
19.9186
16.9778
15.5418
15.8693
19.3942
33.1198
58.626
87.6537
119.293
130.812
130.71
129.437
124.959
118.523
108.996
98.9068
90.111
84.3509
81.32
80.6003
80.6833
81.6598
79.2671
76.1781
70.8954
64.3888
58.5027
56.4359
56.2665
60.1219
65.8189
77.4795
85.4623
86.2966
79.1022
75.3491
71.6864
72.7221
75.0209
81.9869
76.9388
105.796
111.644
115.955
116.597
118.088
75.5721
67.3117
73.2923
89.5989
98.7173
110.23
117.003
114.351
114.498
112.662
114.345
124.072
139.544
154.595
154.535
139.147
115.21
99.4574
92.907
81.1407
67.2324
55.9862
45.6245
43.6749
65.5091
89.0948
76.9497
74.5871
69.821
74.1241
88.938
107.216
125.808
152.022
166.651
184.473
190.173
200.223
190.135
191.603
198.409
196.846
203.53
219.333
218.034
215.943
208.628
200.184
188.76
178.117
164.552
150.826
120.835
101.559
113.052
139.063
160.011
169.624
182.921
196.808
208.755
215.522
219.686
222.994
223.619
220.626
216.173
212.712
211.687
213.328
215.219
219.565
225.442
231.962
239.59
245.378
233.295
206.695
191.84
169.214
153.981
141.204
129.671
119.706
114.147
110.688
103.998
87.4964
84.4824
103.233
133.129
155.708
161.708
138.801
120.99
94.0513
68.0107
59.0029
68.238
91.2689
106.433
110.189
121.063
130.689
136.804
136.302
126.834
115.261
109.478
102.925
94.3374
89.07
92.5302
98.9332
101.288
105.376
107.373
120.681
122.717
104.934
81.8711
64.3509
71.6927
88.9618
102.948
101.567
84.5953
79.8903
79.0096
77.6153
74.3693
68.9409
68.0295
66.8959
63.6817
66.6328
64.3716
73.2502
86.1424
91.6098
111.853
126.535
145.451
163.653
172.034
167.777
159.831
159.116
165.617
170.7
163.263
153.537
154.012
161.267
121.429
114.13
118.596
102.47
96.0997
100.565
113.911
108.767
109.568
112.788
121.889
121.153
126.517
128.069
132.37
136.368
138.949
139.713
135.715
131.438
129.03
124.404
116.543
92.6867
60.8109
67.5286
79.5561
74.2021
54.7652
47.6722
72.1263
85.7231
82.2621
99.2381
118.543
125.014
140.586
128.204
130.102
134.291
134.494
132.056
129.558
126.571
123.151
121.107
118.891
118.585
115.667
115.21
114.719
113.957
114.443
113.24
108.424
99.9388
89.815
80.4681
72.5678
68.7757
63.2439
56.5756
77.4997
89.27
82.0139
78.3169
81.1554
57.9647
50.5658
56.4861
66.0745
66.5913
61.2363
57.4577
57.9478
59.1902
65.4167
79.4085
91.714
104.947
101.661
101.073
96.5442
90.2549
94.1916
128.458
163.491
215.716
308.849
308.515
289.007
280.783
265.068
262.02
232.431
211.771
246.138
269.489
234.826
169.314
143.675
124.738
112.1
103.743
98.6304
99.1238
97.7223
95.8821
85.2101
73.4395
54.3362
53.4334
75.5317
89.5046
86.9134
120.119
185.569
266.901
294.085
331.849
286.004
270.889
214.463
196.626
185.77
177.295
164.514
152.63
211.924
309.838
369.019
230.124
180.643
147.848
120.448
99.5734
83.7858
70.5873
64.9103
68.8825
76.6858
85.0483
89.6409
96.5155
92.95
85.4466
106.046
122.175
117.374
121.262
128.884
122.21
108.54
94.652
68.2775
50.4805
43.9384
42.3771
60.6234
87.4122
102.381
118.491
103.793
67.0285
50.9668
46.4928
46.5672
49.4205
54.4181
59.3062
63.2044
65.2264
63.0717
54.4818
49.6376
48.8405
58.0177
61.6924
67.16
70.9186
74.0713
69.507
54.9006
29.279
9.08683
2.57821
1.97185
1.99847
2.33585
2.88965
3.28894
3.21978
1.89718
2.31282
18.5091
24.4325
27.228
27.7133
29.011
27.5519
23.4263
19.5999
17.6239
17.621
21.398
33.4055
51.5262
67.4398
80.3796
84.3929
93.1631
102.934
113.056
115.185
109.09
98.1939
89.2091
83.4869
80.7437
80.7004
84.2767
86.6407
90.9176
91.4047
89.947
88.6311
84.436
83.5168
82.367
85.5508
88.9737
92.8856
88.1133
78.5425
73.7138
77.8477
75.3299
79.367
73.3062
80.4741
92.5805
104.804
110.585
114.224
113.754
114.82
86.4861
66.5915
69.9222
83.5694
96.7011
105.205
112.2
110.109
107.513
106.666
106.557
115.166
132.123
142.807
155.594
165.183
128.618
96.1278
78.6589
66.127
57.9869
51.6291
48.7556
58.688
82.273
99.7765
78.9409
75.1933
70.9001
72.5669
80.783
93.3597
110.366
133.203
155.977
195.007
202.177
206.296
209.376
216.274
214.917
225.235
233.005
237.577
234.603
222.321
211.807
197.352
184.71
165.114
141.391
114.16
106.357
105.205
101.863
110.824
130.991
153.492
176.416
199.144
215.338
224.133
227.132
225.022
218.013
208.343
202.774
200.921
202.137
204.154
208.659
212.414
218.985
227.546
236.683
246.321
250.8
251.239
245.15
235.003
213.889
194.198
185.416
165.657
145.96
126.938
111.998
106.767
115.004
133.064
151.338
162.322
157.695
132.271
112.602
79.3687
54.7191
44.6571
52.1974
82.8241
97.8024
103.437
107.855
120.201
131.61
137.527
135.411
124.885
120.209
116.534
108.211
98.1439
93.0488
90.1954
95.1064
94.364
95.2161
92.327
90.6274
81.4728
67.5386
73.8092
80.4069
97.1417
105.117
100.046
86.1719
79.6712
76.6855
71.3085
64.235
60.189
57.8527
56.0427
61.3649
57.2687
58.1514
56.6898
56.9075
71.5125
78.2777
89.8029
125.424
152.58
173.108
179.845
178.91
177.823
177.314
173.904
163.357
148.938
137.921
136.412
112.639
106.488
109.158
98.0708
92.9154
94.6491
104.252
111.228
106.708
114.489
116.401
129.074
137.461
142.61
145.834
147.573
147.909
143.532
138.96
132.7
129.841
125.505
111.337
84.4131
51.6612
54.306
71.8785
74.5804
60.6218
47.109
64.5852
81.3661
68.3797
70.2414
80.3059
85.7418
112.458
135.294
125.602
125.554
127.005
128.638
129.259
129.702
130.544
129.502
129.291
125.37
121.64
119.901
116.14
114.847
113.807
110.745
103.763
93.6946
83.3678
74.4711
67.9476
65.0901
62.1367
52.986
59.0071
76.3602
67.8857
69.3169
67.684
49.6239
49.7658
57.8345
67.4698
74.9774
74.8422
71.0321
70.096
72.6147
78.7871
85.3939
90.9101
90.8866
91.6641
90.3493
87.4205
84.7412
94.7005
128.604
154.06
193.595
271.319
284.989
262.949
241.768
247.606
246.14
253.199
249.375
249.763
226.152
179.93
136.723
120.606
106.844
97.9087
91.6818
87.9736
84.5447
82.2221
75.7292
64.7897
50.3794
45.2339
50.2368
71.9712
72.2052
76.839
96.4174
149.942
223.649
296.77
315.797
336.843
275.594
271.35
249.395
249.233
252.853
240.502
237.81
284.21
333.002
258.884
168.66
144.262
124.375
105.538
89.9303
78.7193
71.2875
69.154
73.496
79.8864
81.9223
83.9761
87.739
81.0106
71.6916
92.821
114.683
113.053
113.79
120.85
123.387
111.206
87.3017
66.1955
56.0326
49.834
53.2867
81.8957
103.079
115.367
117.96
95.0255
59.1797
48.0103
43.702
43.6826
47.2093
51.737
56.1347
60.9093
65.058
65.1519
66.7659
64.5383
68.4284
68.3496
69.9642
69.9359
72.4888
71.7009
67.1519
54.0067
32.7467
12.0136
3.22116
1.93105
1.87548
1.93136
2.16725
2.2852
2.16334
1.71572
2.18026
17.5812
22.0305
26.1144
27.3817
29.4588
31.225
30.5616
28.9791
27.2128
27.4475
30.9208
38.3204
46.0226
51.0706
52.0578
51.6608
52.2497
58.1554
72.8016
93.1562
103.691
100.383
93.4311
87.403
83.7651
84.877
84.6869
89.441
91.7744
95.6872
98.5366
99.6127
98.1106
96.5923
95.0808
93.904
92.4345
87.3116
75.9864
69.9222
68.2501
73.5913
71.3023
79.4768
77.3466
85.5569
83.4835
92.2118
100.508
114.339
111.85
112.126
112.715
75.4819
70.0576
78.0725
87.8069
98.7743
99.8724
99.6996
96.1661
90.9879
88.7398
91.3691
105.351
113.84
125.879
140.439
154.948
126.379
94.0293
74.4724
65.6845
62.6781
66.6037
81.8499
95.884
92.6149
79.5689
75.9377
67.6628
63.7325
66.8898
76.5563
89.7073
108.885
130.58
173.087
190.744
207.175
209.666
216.201
221.357
217.841
214.022
213.622
209.162
205.344
178.188
163.245
138.73
118.718
108.507
97.9501
88.6377
89.0297
75.2269
73.5191
77.8708
109.734
148.337
179.937
205.229
219.689
222.881
216.733
205.361
196.921
195.192
198.363
203.04
208.706
213.48
220.17
225.693
232.901
240.542
247.227
251.071
252.708
247.099
240.233
227.038
212.302
195.249
176.691
159.258
145.431
138.061
138.357
144.298
152.678
158.541
157.797
146.044
119.382
84.6767
59.5824
43.7855
38.0135
45.1293
75.3201
91.0759
93.828
93.2686
101.398
119.542
132.001
138.096
133.481
130.687
132.338
129.894
121.858
109.66
98.5485
91.3631
86.8114
82.1083
80.1492
73.92
71.4444
76.6269
79.9294
90.5449
102.498
102.98
93.7279
84.7077
79.1221
74.6858
67.9141
60.9979
55.4312
51.8613
54.8311
53.0946
57.5416
57.0009
49.5241
48.6956
47.695
53.3062
66.5276
83.6498
121.394
163.045
180.772
187.624
188.482
185.833
176.896
162.334
148.22
134.122
124.529
111.95
107.884
103.886
98.397
98.4991
93.8499
97.1056
104.492
113.258
119.093
128.608
135.69
141.734
148.636
151.423
152.6
149.786
146.1
141.287
135.736
135.3
124.68
107.098
74.5523
44.7589
45.7531
63.7222
73.9767
66.8856
54.4483
55.0776
72.4
60.4506
54.7404
57.9167
66.1587
84.8899
108.926
136.091
126.85
124.206
123.926
126.698
129.942
131.936
133.399
132.557
128.613
126.99
121.91
119.724
116.056
113.109
106.167
97.2131
86.1566
76.6554
69.1405
63.4203
61.4076
61.9298
56.7741
52.9995
61.211
55.812
54.744
51.2239
45.2423
51.0746
60.9736
68.5435
77.0122
80.4911
79.3571
79.3085
79.8949
80.2102
84.0339
83.6749
86.1071
86.249
85.9629
84.2957
79.2407
90.5125
130.933
147.724
169.563
214.806
265.93
284.383
263.973
227.651
217.857
210.388
203.13
185.785
157.656
122.797
95.9371
81.7791
70.541
63.4582
57.8756
54.9433
52.0036
49.8303
46.7385
43.2278
40.9033
42.3188
53.8086
65.7989
63.5845
66.5414
86.4974
111.276
158.704
211.963
268.043
278.039
298.326
279.994
297.051
326.708
360.517
344.856
330.38
304.998
227.309
165.064
127.174
113.935
102.155
91.1628
83.8599
79.7817
78.8716
82.1242
85.3382
84.0905
80.9345
80.0928
78.1234
68.3438
58.5869
77.3039
105.631
113.92
112.655
111.212
106.09
97.1171
86.7901
77.5061
72.643
78.0541
103.454
116.814
123.208
126.037
116.614
90.6411
53.3405
43.588
40.3521
41.1246
44.1945
49.3179
55.0208
60.5638
65.0531
70.8285
71.683
74.6636
73.1838
72.6447
71.7183
72.9891
71.7198
69.5205
62.0028
49.836
30.5274
10.5393
2.7406
1.90347
1.84624
1.84662
1.87963
1.90552
1.78295
1.58566
2.06344
16.2327
18.8755
24.3561
27.1516
28.1501
31.1237
34.1043
36.8211
39.173
41.1331
42.181
42.6517
42.2045
40.8869
38.0978
35.975
33.3952
32.7489
36.2689
47.3708
67.9196
87.0601
97.5787
96.3153
93.7316
88.5286
88.52
87.0079
89.5937
91.2363
93.0437
96.118
95.3099
93.6554
89.1757
85.2412
79.1014
72.0883
64.1768
61.3823
58.6199
58.2364
55.5211
55.6662
54.8256
59.9876
60.385
68.572
71.8205
99.4916
108.959
106.893
108.895
104.947
82.2605
78.2791
80.1272
87.071
90.2897
86.5277
83.8268
78.5409
74.0835
73.9132
83.5206
86.6883
92.6852
101.376
112.244
125.296
134.835
115.162
101.726
93.8651
98.7065
104.711
92.4663
81.2221
75.0954
69.3667
61.9488
56.601
56.7277
59.444
67.1227
81.3975
103.048
128.397
172.119
193.284
206.678
212.265
211.96
210.886
208.044
207.588
196.107
200.54
170.628
159.165
132.379
113.131
96.2659
89.6195
74.3024
72.2262
61.2381
56.46
55.0715
59.9717
83.4718
136.682
171.406
195.432
203.858
200.719
194.109
191.294
194.503
200.339
208.466
215.716
223.57
230.209
238.283
245.498
252.293
260.036
259.813
263.293
257.726
252.679
241.953
227.053
212.501
196.742
183.933
174.303
167.449
162.734
159.118
155.343
150.046
141.137
122.381
84.9776
67.2615
56.1471
51.9522
56.0916
68.0338
91.5229
94.5796
91.6681
86.7161
83.2966
96.5707
115.934
131.421
137.217
137.91
140.075
140.306
140.164
138.832
125.126
112.786
99.6539
87.2392
87.7049
81.2844
86.2092
84.8491
89.623
96.7538
101.323
95.534
85.5325
79.1606
74.2872
71.7245
70.1144
63.9942
64.3025
62.8244
59.0732
58.4405
59.2832
54.9726
56.4609
46.6019
40.3935
41.6852
45.6085
57.4447
85.0508
131.742
154.328
186.817
193.174
191.671
184.027
168.758
151.612
130.361
123.086
121.991
117.144
109.926
103.976
103.339
101.436
96.2807
98.0965
104.2
112.4
123.148
131.266
139.438
146.465
150.95
152.392
152.368
151.153
149.253
142.67
136.587
121.727
101.851
65.1545
41.9905
39.1423
52.593
68.6442
72.977
60.1581
53.6013
59.4466
55.8341
56.205
59.1138
66.0062
75.0735
90.5696
109.164
136.882
129.433
126.196
128.909
131.218
136.089
135.847
136.132
135.436
131.769
129.187
124.438
118.365
110.968
100.357
89.2925
79.0852
71.114
65.7757
60.4928
58.3243
60.6825
59.8527
55.2257
52.7054
46.6157
41.714
38.5137
38.0744
47.8832
59.8113
70.3155
79.1477
84.5571
87.5066
85.0987
85.5143
85.7344
85.7548
86.5936
87.5978
86.724
85.2399
78.1515
74.9938
90.4682
127.079
144.341
158.799
176.896
197.709
225.708
259.199
278.218
259.492
229.489
196.437
161.795
130.341
103.117
84.1087
71.452
62.0646
55.2796
50.0363
46.2891
44.2055
42.7605
41.9679
41.8105
44.9629
49.6811
58.5588
64.874
57.8732
59.6452
73.3498
93.5602
112.05
140.776
167.512
205.857
213.898
234.83
246.727
338.874
312.409
312.976
255.187
193.776
145.423
114.875
94.6742
86.8929
80.1859
76.9377
76.8038
79.5147
84.3303
87.1537
86.8481
83.5858
80.5364
76.7679
70.0936
58.084
47.7716
60.2548
93.9043
117.801
128.279
133.387
134.845
131.79
134.468
139.897
140.133
137.705
132.292
128.541
124.613
117.163
100.772
67.9459
44.5317
38.603
36.3125
37.5283
41.6303
47.996
55.4151
62.0066
69.0551
73.0419
76.54
77.2975
77.2365
76.2751
75.8395
72.8827
69.8226
63.9389
55.4248
42.5047
23.548
6.48352
2.19765
1.88058
1.85524
1.82635
1.80121
1.73816
1.62593
1.48967
1.98547
14.4063
16.7365
22.2004
26.5523
28.572
30.0262
32.052
34.9466
37.1433
38.6356
39.0199
38.2731
37.0789
35.9184
34.4817
33.4733
31.6422
29.5703
26.8725
25.9022
30.4974
44.4868
69.1495
88.0226
94.7316
96.2376
92.497
91.1913
89.1409
86.4961
84.621
83.395
80.3265
79.2009
73.8411
70.0895
64.1157
60.7443
57.8363
56.269
55.1556
55.7819
54.1519
56.0193
55.3202
59.0701
61.0228
66.196
66.5128
72.15
103.718
101.25
103.026
107.777
108.46
102.775
90.5928
89.5043
84.3162
79.794
77.3897
75.3927
75.7268
80.0956
80.9753
82.4847
82.671
82.9857
83.6447
85.6672
87.9542
90.7292
93.0044
89.2476
84.0589
76.9221
71.1679
66.6264
64.5773
64.2544
63.6171
62.6781
61.3141
56.8051
55.41
58.9453
72.8413
95.0329
127.739
162.321
191.248
205.859
206.462
207.801
206.259
206.112
210.061
206.064
196.7
178.249
163.104
145.627
115.763
105.153
82.1882
73.9559
63.1415
57.529
52.4561
47.8602
47.1469
59.5781
101.014
149.559
172.984
181.048
183.589
186.809
192.42
200.098
208.362
217.76
226.073
234.897
242.485
251.745
258.229
265.286
266.467
267.685
263.118
257.989
247.923
237.175
225.976
213.845
203.181
192.17
181.268
169.446
155.976
141.86
127.902
114.04
96.7215
81.031
80.6055
85.5415
94.372
103.711
110.803
112.12
108.559
100.148
89.6623
80.3077
79.1605
92.8244
116.455
129.822
135.942
140.539
143.035
144.999
145.075
145.808
144.496
126.57
112.181
104.424
96.8325
97.8483
94.746
91.5736
88.2267
84.6288
80.9064
72.927
68.5685
68.0379
69.8443
74.2433
75.6149
80.4929
74.5769
72.5773
69.5338
62.4287
63.4999
59.512
50.3346
43.0658
37.3333
38.2141
43.7469
59.8748
90.2542
131.073
143.031
164.827
171.319
164.731
143.557
132.117
124.782
118.779
119.453
118.326
109.991
100.725
105.815
101.777
98.8765
98.0684
103.754
111.021
121.854
134.278
143.687
152.468
161.943
164.497
165.783
162.75
157.502
146.722
132.67
117.388
100.487
64.0039
41.48
36.5614
41.2435
56.9855
70.966
73.5118
65.5449
64.4732
64.9404
67.4564
68.71
69.5975
72.9432
81.105
90.5271
111.537
126.899
138.731
143.335
149.915
152.816
155.876
155.884
151.165
146.205
137.598
129.463
118.853
107.617
94.6251
83.5337
73.8995
67.9374
64.0907
60.1865
55.3091
52.2959
49.7956
51.0685
45.7274
36.3965
30.5952
29.7649
32.1417
43.3844
53.6928
66.362
75.0177
83.4401
87.2138
85.041
88.3912
86.6271
86.0934
85.8957
82.6283
79.9338
74.8942
72.0078
71.8672
85.0135
122.814
146.185
160.407
165.851
165.539
170.701
185.621
211.451
219.884
218.972
208.086
181.937
147.473
119.512
98.4222
82.7068
71.5493
63.1527
57.6703
54.147
52.8147
53.1129
54.4376
56.1985
59.5935
62.4736
66.973
67.0598
60.805
56.1217
65.6955
77.8701
92.6634
104.319
118.424
125.903
138.616
153.299
178.103
269.717
246.511
235.544
178.427
135.921
105.038
83.3421
69.0552
62.4794
59.2501
61.2195
67.5591
75.7064
82.8727
87.4095
87.2137
85.4716
80.3735
73.2554
64.0122
51.5162
41.7245
46.4128
74.243
113.333
132.638
151.046
165.671
175.046
176.992
170.644
161.63
144.074
125.268
110.135
95.9133
80.485
63.2704
48.1175
36.8795
33.2873
33.3067
36.0052
41.7535
48.3169
56.7792
64
71.8341
76.8505
79.4393
80.3879
79.9246
78.7933
75.7625
71.7329
65.1167
56.5927
45.7719
31.491
11.2486
2.68633
1.91102
1.89578
1.87368
1.83541
1.77963
1.69751
1.57837
1.44552
1.8871
9.51287
17.7132
24.6552
31.4376
36.9981
40.3448
42.3424
44.0271
45.3401
46.4422
46.5234
46.6557
46.4831
46.3206
45.5267
43.9825
41.0853
38.4277
35.4288
33.6972
29.7217
29.5573
36.2102
56.7297
90.6576
106.894
102.548
101.28
101.401
97.6916
89.6693
84.7541
78.4152
75.7402
73.9108
71.0935
68.9148
67.2794
65.6499
63.7058
65.3472
61.5359
64.3024
63.1233
61.5627
63.8882
62.1006
65.4496
62.5853
68.3321
91.1065
107.857
113.067
120.493
127.021
134.101
138.333
141.711
143.416
142.568
141.271
139.073
136.955
134.107
131.112
127.287
122.382
117.963
112.488
109.272
106.332
105.444
104.09
97.1044
90.7714
83.2218
78.0605
72.5766
70.5824
68.0062
65.4035
61.1717
58.3746
55.1252
57.0143
64.4563
78.7241
85.0464
93.4368
111.374
138.491
142.888
150.637
159.797
161.023
175.106
175.582
188.643
181.579
174.915
167.381
159.052
153.009
144.239
134.65
105.334
99.4505
88.7292
77.3755
75.1573
70.7753
67.6051
64.4276
70.1468
100.711
120.341
122.723
127.218
138.104
152.943
157.119
158.973
159.99
159.395
158.389
156.084
152.34
150.504
145.813
144.602
143.375
144.361
143.587
144.745
144.973
144.201
144.79
144.648
144.87
144.369
143.429
141.002
136.346
128.863
117.281
108.097
104.242
102.914
102.944
103.909
106.366
106.089
104.525
100.306
94.5442
88.5599
76.9593
84.4992
103.127
124.746
130.795
132.157
131.082
129.188
128.622
129.59
134.165
135.775
123.124
122.318
113.486
117.921
110.334
106.416
101.611
101.154
98.9176
100.074
96.5206
94.2704
93.7926
92.8763
94.8416
90.6554
94.8238
79.5835
70.998
74.5296
70.9127
69.0295
62.8616
52.4398
46.5356
45.0392
45.6388
50.2114
64.8103
85.9431
107.672
115.366
130.318
135.172
142.669
141.647
142.959
149.962
147.847
148.033
146.974
144.376
139.739
147.806
144.589
142.723
137.56
136.913
137.849
136.409
136.439
135.314
137.293
137.166
138.171
136.076
134.506
132.314
125.929
127.709
118.985
73.8829
54.7041
46.682
43.1354
46.5821
57.553
69.0575
75.8273
81.4611
82.108
78.5586
78.2589
73.5828
76.0303
74.2811
83.2825
82.7773
92.6839
112.75
109.96
141.105
142.245
144.673
142.304
142.648
140.835
137.098
133.967
128.921
122.684
115.404
105.486
91.7684
73.5268
52.4397
35.9501
29.0339
31.2175
30.7397
33.1198
36.7824
29.3024
27.7291
28.6486
31.0154
35.7086
39.9415
47.3337
53.5678
58.3127
63.3679
63.3333
64.8954
64.436
66.8682
65.8384
69.2897
69.5888
74.5734
76.5292
79.8741
86.5658
118.058
140.616
141.53
139.94
130.937
120.064
107.807
101.987
99.8732
107.439
113.923
116.371
113.227
107.301
101.473
97.6335
95.649
95.3285
96.5505
97.4547
100.446
101.371
106.849
104.141
110.834
109.988
116.036
115.338
103.594
84.0017
74.5635
76.044
73.6735
74.6759
69.9828
66.9977
62.9507
70.3581
72.6044
162.288
94.1999
115.774
102.108
89.7647
77.589
67.7571
60.9814
58.2106
56.8182
58.8368
62.762
66.3579
69.9557
71.3983
73.2425
73.6128
74.93
75.3281
74.755
68.3912
61.6687
59.0035
67.0241
90.8703
78.6016
70.715
82.8427
102.675
119.226
130.249
132.042
127.429
119.424
107.684
93.911
82.6135
74.4548
67.5696
57.7033
53.3559
51.9816
53.2728
56.7065
59.2376
65.4734
66.6662
73.5869
70.9062
74.1227
70.4847
68.9234
67.4479
65.7702
59.9321
51.1493
36.8348
20.2312
7.75718
3.06028
2.80009
2.78257
2.85687
2.81453
2.77653
2.69531
2.47095
2.26471
1.9686
1.70854
)
;
boundaryField
{
wand
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
|
|
e77eae330c2d7484453f766b6af58355f37cf250
|
2bc4c97e10261e63ff843b5032d2abd5bab27233
|
/Code/utilities/AStarSearch.cpp
|
e7b496c755b5e4fbeb72619f86f0f0dac910e09f
|
[] |
no_license
|
rcame/IndividualProject
|
0d9427f08a2b884ec75c6da393ce1a35d4cd6c77
|
48b465b22617e2754b79912e63f48f7eb914fb20
|
refs/heads/master
| 2021-01-21T13:29:21.006027
| 2016-04-29T12:14:27
| 2016-04-29T12:14:27
| 45,307,703
| 0
| 1
| null | 2015-11-01T19:47:54
| 2015-10-31T15:48:53
|
CMake
|
UTF-8
|
C++
| false
| false
| 4,404
|
cpp
|
AStarSearch.cpp
|
//
// Created by richard on 12/03/16.
//
#include "AStarSearch.h"
AStarSearch::AStarSearch(int **terrain) {
this-> terrain = terrain;
}
shared_ptr<TerrainNode> AStarSearch::aStarSearch(int startX, int startY, int endX,
int endY, int* cantTraverse, int cantTraverseSize) {
vector<shared_ptr<TerrainNode>> unExpNodes;
expNodes.clear();
shared_ptr<TerrainNode> curNode(NULL);
shared_ptr<TerrainNode> temp(new TerrainNode(startX,startY));
unExpNodes.push_back(temp);
int counter = 0;
while(!unExpNodes.empty()){
//Finds the best node in the vector and then removes it
int bestNode = findBestNode(unExpNodes, endX, endY, curNode);
curNode = shared_ptr<TerrainNode>(new TerrainNode(unExpNodes[bestNode]->getX(), unExpNodes[bestNode]->getY(), curNode));
unExpNodes.erase(unExpNodes.begin()+bestNode);
expNodes.push_back(curNode);
counter++;
if(curNode->getX() == endX && curNode->getY() == endY){
break;
}
int potentialMoves[4][2] = {
{curNode->getX()-1, curNode->getY()},
{curNode->getX()+1, curNode->getY()},
{curNode->getX(), curNode->getY()-1},
{curNode->getX(), curNode->getY()+1}
};
for(int i = 0; i < 4; i++) {
bool createNode = false;
if(cantTraverse != NULL){
for(int j = 0; j < cantTraverseSize; j++){
if(terrain[potentialMoves[i][0]]
[potentialMoves[i][1]] == cantTraverse[i]){
createNode = false;
break;
} else {
createNode = true;
}
}
} else {
createNode = true;
}
if(createNode){
shared_ptr<TerrainNode> checkNode(
new TerrainNode(potentialMoves[i][0],
potentialMoves[i][1],
curNode));
bool foundUnexp = false;
bool foundExp = false;
for (int j = 0; j < unExpNodes.size(); j++) {
if (unExpNodes[j]->getX() == potentialMoves[i][0] &&
unExpNodes[j]->getY() == potentialMoves[i][1]) {
foundUnexp = true;
break;
}
}
for (int j = 0; j < expNodes.size(); j++) {
if (expNodes[j]->getX() == potentialMoves[i][0] &&
expNodes[j]->getY() == potentialMoves[i][1]) {
foundExp = true;
break;
}
}
if (!foundExp && !foundUnexp) {
unExpNodes.push_back(checkNode);
}
}
}
}
return curNode;
}
int AStarSearch::findBestNode(vector<shared_ptr<TerrainNode>> unExpNodes, int endX,
int endY, shared_ptr<TerrainNode> curNode) {
double closest = INT32_MAX;
int place = 0;
double aStar;
for(int i = 0; i < unExpNodes.size(); i++){
int x = unExpNodes[i]->getX();
int y = unExpNodes[i]->getY();
double manDistance = abs(x - endX) + abs(y - endY);
if(terrain[x][y] == Water_Ocean) {
manDistance += 1;
} else if(terrain[x][y] == Stone_Gray_VeryLight) {
manDistance += 0.9;
} else if(terrain[x][y] == Stone_Gray_Light || terrain[x][y] == Stone_Gray_Medium) {
manDistance += 0.8;
} else if(terrain[x][y] == Stone_Gray_Dark || terrain[x][y] == Stone_Gray_VeryDark) {
manDistance += 0.7;
} else if(terrain[x][y] == SandDark || terrain[x][y] == SandLight){
manDistance += 0.5;
} else if(terrain[x][y] == Dirt_DirtGravel || terrain[x][y] == Dirt_Dirt
|| terrain[x][y] == Dirt_Gravel){
manDistance += 0.3;
}
if(curNode == NULL) {
aStar = manDistance + 0;
} else {
aStar = manDistance + curNode->getDistFromStart() + 1;
}
if(aStar < closest){
closest = aStar;
place = i;
}
}
return place;
}
|
c5ca26a0edd1ef7de4291992ef093f7992fa7d92
|
1e0c5f921640e1d318a67174d2bdc52cf6d26034
|
/CoreLibrary/linux/ThreadLinux.cpp
|
d2ddb4a0a142f44079800bf8c0ad442492413f93
|
[] |
no_license
|
chaabaj/CPPLibrary
|
6463ad8500c0e799524fbbcc66d56babe0ed25af
|
b7150aaa364c421c047cc99fabf12643b83e8570
|
refs/heads/master
| 2016-08-04T10:01:05.204468
| 2014-03-24T20:43:33
| 2014-03-24T20:43:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,424
|
cpp
|
ThreadLinux.cpp
|
#include <cstring>
#include <ctime>
#include <climits>
#include <cerrno>
#include "CoreLibrary/Thread/AThreadException.hpp"
#include "CoreLibrary/Thread/linux/ThreadLinux.h"
ThreadLinux::ThreadLinux()
{
std::memset(&_thread, 0, sizeof(pthread_t));
}
ThreadLinux::~ThreadLinux()
{
}
bool ThreadLinux::waitThread(long int time)
{
struct timespec timed;
int error;
if (time == LONG_MAX)
{
error = pthread_join(_thread, NULL);
}
else
{
timed.tv_nsec = 0;
timed.tv_sec = std::time(NULL) + time;
error = pthread_timedjoin_np(_thread, NULL, &timed);
}
if (error != 0)
{
switch (error)
{
case ETIMEDOUT:
return (false);
default:
throw tekLib::AThreadException(strerror(error));
}
}
return (true);
}
bool ThreadLinux::startThread(ptr pptr, void *data)
{
_ptr = pptr;
_data = data;
int error = pthread_create(&_thread, NULL, &proxy, this);
if (error != 0)
throw tekLib::AThreadException(strerror(error));
}
bool ThreadLinux::isRunning() const
{
int error = pthread_tryjoin_np(_thread, NULL);
if (error != 0)
{
switch (error)
{
case EBUSY:
return (true);
default:
throw tekLib::AThreadException(strerror(error));
}
}
return (false);
}
void *ThreadLinux::proxy(void *data)
{
ThreadLinux *thread;
thread = reinterpret_cast<ThreadLinux *>(data);
thread->_ptr(thread->_data);
}
|
e9169f21c13c268fec0f718298a1e4647b71c436
|
197cc77bc27f7178dccfe45491e75dd5a5b6d1a0
|
/src/Primitive.h
|
37b09950146b559c1ddaacfd7b44d46b67e5a575
|
[] |
no_license
|
RickyBoyd/cg-raytracer
|
0264ada7f1e41af5c250ad1692aeecc25536cc65
|
37a9289ed0655d00125c8df2ef61ef06fe6d4619
|
refs/heads/master
| 2021-06-12T18:26:28.543929
| 2017-05-04T13:03:39
| 2017-05-04T13:03:39
| 80,721,593
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 769
|
h
|
Primitive.h
|
#pragma once
#include <glm/glm.hpp>
struct Intersection
{
glm::vec3 position;
float distance;
int index;
glm::vec3 normal;
float u, v; // Barycentric coordinates
};
class Primitive
{
public:
float reflectivity_;
float refractive_index_;
virtual ~Primitive() = default;
virtual glm::vec3 GetAmbientColour(const Intersection& i) = 0;
virtual glm::vec3 GetDiffuseColour(const Intersection& i) = 0;
virtual glm::vec3 GetSpecularColour(const Intersection& i) = 0;
virtual float GetSpecularExponent(const Intersection& i) = 0;
virtual float GetSpecularIntensity(const Intersection& i) = 0;
virtual void Intersect(glm::vec3 start, glm::vec3 dir, Intersection &intersection, int i) = 0;
protected:
Primitive(float reflectivity_, float refractive_index_);
};
|
c7a1f17043f7fb789bd3c7024a94e6559bf6097d
|
6657a3d37192ba684d44939e50d822477bd80d5f
|
/EliCrane Level 4 HW Submission/4.3/Exercise1/Exercise1/Exercise1.cpp
|
179d9b4d9cfaa4421e04fc532d8e3560a7f35695
|
[] |
no_license
|
eli-crane-89/CPP_Advanced
|
801fa7dda29f885f651fc108a4ca04ff2847b83a
|
86d086a1b2ff0d206e509ede2d192329186e3dc5
|
refs/heads/master
| 2021-09-14T21:12:20.154826
| 2018-05-19T22:19:06
| 2018-05-19T22:19:06
| 124,994,555
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 5,335
|
cpp
|
Exercise1.cpp
|
#include <random>
#include <iostream>
#include "RandomFunction.hpp"
template<typename T>
void printVec(std::vector<T> v) {
for (auto it = v.begin(); it != v.end(); it++) {
std::cout << *it << " ";
}
std::cout << std::endl;
}
int main()
{
// Generate uniform random variates in interval [A, B]
double A = 0.0;
double B = 1.0;
std::uniform_real_distribution<double> dist(A, B);
int nTrials = 30;
//a)
// Choose the engine
std::default_random_engine eng;
std::minstd_rand lce_eng(1729);
std::mt19937 mt_eng(1729);
std::mt19937_64 mt64_eng(1729);
std::cout << "uniform real distribution:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << dist(eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "linear congruential engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << dist(lce_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << dist(mt_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt64 engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << dist(mt64_eng) << ", ";
}
std::cout << "end\n\n";
//b)
std::cout << "Bernouilli:\n\n" << std::endl;
std::bernoulli_distribution bern_dist(.5);
std::cout << "uniform real distribution:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << bern_dist(eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "linear congruential engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << bern_dist(lce_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << bern_dist(mt_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt64 engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << bern_dist(mt64_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "Normal:\n\n" << std::endl;
std::normal_distribution<double> nm_dist(5.0, 2.0);
std::cout << "uniform real distribution:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << nm_dist(eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "linear congruential engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << nm_dist(lce_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << bern_dist(mt_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt64 engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << bern_dist(mt64_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "Chi-Squared:\n\n" << std::endl;
std::chi_squared_distribution<double> chi_dist(3.0);
std::cout << "uniform real distribution:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << chi_dist(eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "linear congruential engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << chi_dist(lce_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << chi_dist(mt_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt64 engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << chi_dist(mt64_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "cauchy_distribution:\n\n" << std::endl;
std::cauchy_distribution<double> cauchy_dist(5.0, 1.0);
std::cout << "uniform real distribution:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << cauchy_dist(eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "linear congruential engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << cauchy_dist(lce_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << cauchy_dist(mt_eng) << ", ";
}
std::cout << "end\n\n";
std::cout << "mt64 engine:\n";
// Produce a number of uniform variates
for (int i = 1; i <= nTrials; ++i)
{
std::cout << cauchy_dist(mt64_eng) << ", ";
}
std::cout << "end\n\n";
//c)
std::cout << "\nGeneric Function:\n\n";
std::cout << "cauchy:\n";
//Bind to function
printVec<double>(GenericNumberGeneration<double>(cauchy_dist, mt64_eng, 100));
std::cout << "Bernouill:\n";
//Bind to function
printVec<double>(GenericNumberGeneration<double>(bern_dist,mt_eng, 10 ));
std::cout << "Normal:\n";
//Bind to function
printVec<double>(GenericNumberGeneration<double>(nm_dist, lce_eng, 10));
std::cout << "Chi:\n";
//Bind to function
printVec<double>(GenericNumberGeneration<double>(chi_dist, mt64_eng, 10));
return 0;
}
|
b2041bb028748e6e0183bd60858cbe6ac7d7ae7b
|
fb4c7407f26c57a0151ce49b67d40e404ea069f7
|
/week1/10.cpp
|
7bc5b6f5a3121c9140fac962b808115807d4f941
|
[] |
no_license
|
yudeeeth/Pdfquestions
|
1a6539e55824f961207818961844ef77d4c1437b
|
818a1ee50c6406ec62a13bbefc24ba329c54e881
|
refs/heads/master
| 2023-05-09T16:40:08.875451
| 2021-06-05T11:19:35
| 2021-06-05T11:19:35
| 352,121,601
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 347
|
cpp
|
10.cpp
|
#include<bits/stdc++.h>
using namespace std;
string reverseWord(string str){
int start,end;
start = 0;
end = str.size()-1;
char temp;
while(start<end){
temp = str[start];
str[start] =str[end];
str[end] = temp;
start++;
end--;
}
return str;
//Your code here
}
int main(){
}
|
7024d26dc027cb37d0567c6751bf41aff0d6c654
|
7d58240e3fd0a9ba58a7da5008e7ce96a9b205cd
|
/ResourceAware/resInfoMonitor.cpp
|
d3df5bc3690530746d0ec843875873f6f3520295
|
[] |
no_license
|
chentaogithub/ResEneAwareOpt
|
af1456b74af23d137ec15c22f09be28dd9c3707b
|
3f6a97171fd28c51d74237d1ecd8fb602b0b4c0e
|
refs/heads/master
| 2021-02-04T14:14:10.013090
| 2020-03-25T08:58:56
| 2020-03-25T08:58:56
| 243,673,866
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,232
|
cpp
|
resInfoMonitor.cpp
|
//
// Created by lynne on 2/27/20.
//
#include <iostream>
#include <dirent.h>
#include <climits>
#include "resInfoCollection.h"
using namespace std;
using namespace RESOURCE_INFO;
struct ResInfoSchema{
SysTimeInfo sysTimeInfo;
SysMemInfo sysMemInfo;
SysDiskInfo sysDiskInfo;
SysNetInfo sysNetInfo;
SysProcInfo sysProcInfo;
SysNetConnInfo sysNetConnInfo;
};
void getResInfo(ResourceInfo& stat){
//ResourceInfo stat;
//cpu利用率
cout << "cpu_use:" << stat.GetCpuUsage() << endl;
//unsigned long cpuTime,idleTime;
cout << "cpuTime:" << stat.sysTimeInfo.cpuTime << endl;
cout << "idleTime:" << stat.sysTimeInfo.idleTime << endl;
cout << "cpuUsage:" << stat.sysTimeInfo.cpuUsage << endl;
//内存
SysMemInfo meminfo;
stat.GetMemInfo(meminfo);
cout << "meminfo:" << endl;
cout << "\ttotal:" << meminfo.total << "M" << endl;
cout << "\tfree:" << meminfo.free << "M" << endl;
cout << "\t" << ((double) (meminfo.total - meminfo.free)) * 100 / meminfo.total << endl;
//磁盘
vector <SysDiskInfo> vdiskinfo;
unsigned long disktotal, diskavail;
stat.GetDiskInfo(vdiskinfo, disktotal, diskavail);
cout << "diskinfo:" << endl;
cout << "\ttotal:" << disktotal << "M" << endl;
cout << "\tfree:" << diskavail << "M" << endl;
cout << "\t" << ((double) (disktotal - diskavail)) * 100 / disktotal << endl;
vector<SysDiskInfo>::iterator itdisk = vdiskinfo.begin();
cout << endl;
for (; itdisk != vdiskinfo.end(); ++itdisk) {
cout << "\tname:" << itdisk->name << endl;
cout << "\ttotal:" << itdisk->total << "M" << endl;
cout << "\tfree:" << itdisk->free << "M" << endl;
cout << endl;
}
//NET信息
SysNetInfo netinfo = stat.GetNetInfo();
cout << "netinfo:" << endl;
cout << "\trecv:" << netinfo.recv << "kb" << endl;
cout << "\tsend:" << netinfo.send << "kb" << endl;
cout << "\ttotal:" << netinfo.total << "kb" << endl;
//进程process资源信息
vector <SysProcInfo> procinfo;
stat.GetProcInfo(procinfo);
cout << "procinfo:" << endl;
vector<SysProcInfo>::iterator itproc = procinfo.begin();
for (; itproc != procinfo.end(); ++itproc) {
cout << "\tname:" << itproc->name << endl;
cout << "\tpid:" << itproc->pid << endl;
cout << "\tmem:" << itproc->mem << "Kb" << endl;
cout << "\tcpu:" << itproc->cpu << endl;
cout << endl;
}
//连接信息
vector <SysNetConnInfo> netConnInfo;
stat.GetNetConnectionInfo(netConnInfo);
vector<SysNetConnInfo>::iterator itconn = netConnInfo.begin();
cout << "netinfo:" << endl;
for (; itconn != netConnInfo.end(); ++itconn) {
cout << "\tid:" << itconn->id << endl;
cout << "\tprotocol:" << itconn->protocol << endl;
cout << "\tlocalAddr:" << itconn->localAddr << ":" << itconn->localPort << endl;
cout << "\tremoteAddr:" << itconn->remoteAddr << ":" << itconn->remotePort << endl;
cout << "\tstate:" << itconn->state << endl;
cout << endl;
}
}
int monitor(int time,int& flag) {
ResourceInfo stat;
while (flag) {
sleep(time);
getResInfo(stat);
}
}
|
0ebe00839f4aaf5d897a9903ff4ba618123a09b4
|
84e124f86b33a62d67f40feba6e4ecd71a60a80a
|
/InsertionSort.h
|
18ef8d8acc84c5a17b2f2ec99bb51729e4bc2985
|
[] |
no_license
|
Bai-BaiBai/Algorithm
|
8e087d2d0db28d4e6f41d300e1c220b56eb70fc2
|
7636928ed5d958fbf52158073d4cca2889f6d256
|
refs/heads/master
| 2020-05-24T16:29:04.374544
| 2020-01-03T14:56:48
| 2020-01-03T14:56:48
| 187,358,838
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,021
|
h
|
InsertionSort.h
|
//
// Created by BaiZehong on 2019/5/8.
//
#ifndef ALGORITHM_INSERTIONSORT_H
#define ALGORITHM_INSERTIONSORT_H
#include <iostream>
using namespace std;
/**
* 插入排序
*/
namespace InsertionSort{
template <typename T>
void insertionSort(T arr[], int n){
for (int i = 1; i < n; ++i) {
T e = arr[i];//存放每一次内层循环要插入的元素
int j;//保存元素e应该插入的位置
for (j = i; j > 0 && e < arr[j-1]; j--) {//元素和前一个比,如果小于就将前一个元素向后移
arr[j] = arr[j-1];
}
arr[j] = e;
}
return;
}
template <typename T>
void insertionSort(T arr[], int l, int r){
for (int i = l+1; i <= r; ++i) {
T e = arr[i];
int j;
for (j = i; j > l && e < arr[j-1]; j--) {
arr[j] = arr[j-1];
}
arr[j] = e;
}
return;
}
}
#endif //ALGORITHM_INSERTIONSORT_H
|
45e4f5e26a1993cbfb449ebe6080c3d7d92c0266
|
4d96e1fb172b878ef898ce7771125c98c880234a
|
/rclst.cpp
|
063f8788e1d4e29e4d236727763dda9ed477be89
|
[] |
no_license
|
evgenykol/otus_cpp_16
|
0f539b0bcaeac28bb12685ede32133994f614e27
|
c8b79609bb895d4a568b81800e039cc1e378719f
|
refs/heads/master
| 2020-03-17T03:43:30.902153
| 2018-09-15T20:58:06
| 2018-09-15T20:58:06
| 133,247,881
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,650
|
cpp
|
rclst.cpp
|
#include <iostream>
#include <vector>
#include <fstream>
#include <dlib/rand.h>
#include "version.h"
#include "rlib.h"
using namespace dlib;
int main(int argc, char* argv[])
{
try
{
std::vector<sample_type> samples;
std::vector<sample_type> initial_centers;
std::vector<double> labels;
//console input
int nclusters;
std::string modelfname;
if ((argc > 1) &&
(!strncmp(argv[1], "-v", 2) || !strncmp(argv[1], "--version", 9)))
{
std::cout << "version " << version() << std::endl;
return 0;
}
else if (argc == 3)
{
nclusters = atoi(argv[1]);
modelfname = argv[2];
if(nclusters < 3)
{
std::cout << "enter more clusters! \n";
return 1;
}
std::cout << "rclst num clusters: " << nclusters << ", model file name: " << modelfname << std::endl;
}
else
{
std::cerr << "Usage: rclst <nclusters> <modelfname>\n";
return 1;
}
//stdin data parsing
std::string line;
//freopen("dataset.csv", "rt", stdin);
while(std::getline(std::cin, line))
{
input_string_to_samples(line, samples);
}
std::cout << "Parsing sucessfull!\n";
//clusterization & saving clusters to files
kcentroid<linear_kernel_type> kc(linear_kernel_type(), 0.01, 8);
kkmeans<linear_kernel_type> test(kc);
test.set_number_of_centers(nclusters);
pick_initial_centers(nclusters, initial_centers, samples, test.get_kernel());
find_clusters_using_kmeans(samples, initial_centers);
test.train(samples, initial_centers);
std::vector<std::ofstream> ofs;
ofs.reserve(nclusters);
for(int i = 0; i < nclusters; ++i)
{
ofs.push_back(std::ofstream(modelfname + "." + std::to_string(i)));
}
labels.reserve(samples.size());
for(auto &s : samples)
{
auto cluster = test(s);
labels.push_back(cluster);
ofs[cluster] << sample_to_string(s) << "\n";
}
for(auto &of : ofs)
{
of.close();
}
//file with number of clusters
std::ofstream of_num(modelfname + ".num");
of_num << nclusters << "\n";
of_num.close();
std::cout << "Clusterization sucsessful! ";
std::cout << "(samples: " << samples.size() << ", lables: " << labels.size() << ", clusters: " << initial_centers.size() << ")\n";
//decision function generating
ovo_trainer_type ovo_trainer;
krr_trainer<linear_kernel_type> krr_lin_trainer;
ovo_trainer.set_trainer(krr_lin_trainer);
ovo_df_type df = ovo_trainer.train(samples, labels);
std::cout << "predicted label: "<< df(samples[0]) << ", true label: "<< labels[0] << std::endl;
std::cout << "predicted label: "<< df(samples[100]) << ", true label: "<< labels[100] << std::endl;
std::cout << "predicted label: "<< df(samples[3333]) << ", true label: "<< labels[3333] << std::endl;
std::cout << "predicted label: "<< df(samples[22222]) << ", true label: "<< labels[22222] << std::endl;
std::cout << "Training sucsessful! \n";
//decision function serializing
serialize(modelfname + ".df") << df;
std::cout << "Serializing sucsessful! \n";
}
catch (std::exception& e)
{
std::cerr << "Exception: " << e.what() << "\n";
}
return 0;
}
|
6a4722afa13561b3966e3fa7431ff658d3ce18a2
|
e583a8f85ce903df675db46e783719354bc608fb
|
/others/fisher-yates-shuffle/code/fisher-yates-shuffle.hpp
|
2a759542c78a7e066abef1c522bd7f8b4140e49c
|
[] |
no_license
|
h-hg/data-structure-and-algorithm
|
4b2da6f896279f7cc89d5098602ee4f03db233a9
|
8ec31f6c77c71c9948a65ba6fee41e09ae239f84
|
refs/heads/master
| 2022-06-27T08:31:10.894936
| 2022-06-10T01:55:15
| 2022-06-10T01:55:15
| 249,697,468
| 5
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 489
|
hpp
|
fisher-yates-shuffle.hpp
|
#ifndef _FISHER_YATES_SHUFFLE_H
#define _FISHER_YATES_SHUFFLE_H
#include <algorithm>
#include <ctime>
#include <cstdlib>
static auto _ = []() {
srand(time(0));
};
// return random number in [minVal, maxVal]
int random(int minVal, int maxVal) {
return rand() % (maxVal - minVal + 1) + minVal;
}
template <typename RAIter>
void shuffle(RAIter begin, RAIter end) {
for(--end; end != begin; --end) {
int k = random(0, end - begin);
std::swap(*(begin + k), *end);
}
}
#endif
|
db6c06daec7eca2e14fa8c5e6a7cd8823e7a5159
|
24679881f8ad5af84c76b77753f0670313686a0e
|
/src/EmyChat/node_names.cpp
|
04319d364d11cdc310358c31bb703a38ee337203
|
[
"MIT"
] |
permissive
|
beegee-tokyo/Emy-Chat
|
8ceeb2f4dca2a48a93b17336cf4ada27e01fb12b
|
8bb4e2e7b8e4801b469cad5ad1aa1f0429fb42c7
|
refs/heads/master
| 2021-02-10T00:44:58.508878
| 2020-03-12T07:14:44
| 2020-03-12T07:14:44
| 244,339,218
| 4
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,006
|
cpp
|
node_names.cpp
|
#include "main.h"
/** The list with all known names */
namesList *namesMap;
/** Index to the first free name entry */
int namesListIndex = 0;
/** Max number of nodes in the list */
int _numOfNames = 0;
/**
* Initialize list of node names
* @param numOfNames
* max number of node names
*/
void initNodeNames(int numOfNames)
{
_numOfNames = numOfNames;
// Prepare empty names map
namesMap = (namesList *)malloc(numOfNames * sizeof(namesList));
if (namesMap == NULL)
{
myLog_e("Could not allocate memory for names map");
}
else
{
myLog_d("Memory for names map is allocated");
}
memset(namesMap, 0, numOfNames * sizeof(namesList));
}
/**
* Add the name of a node with its nodeID
* @param nodeID
* Node ID
* @param nodeName
* Node name (char [17] max, larger will be discarded)
*/
void addNodeName(uint32_t nodeID, char *nodeName)
{
for (int idx = 0; idx < namesListIndex; idx++)
{
if (namesMap[idx].nodeId == nodeID)
{
// Found the node already in the list, update the name
snprintf(namesMap[idx].name, 17, "%s", nodeName);
return;
}
}
if (namesListIndex == _numOfNames)
{
// Names list is full
myLog_e("Names map is already full %d", namesListIndex);
return;
}
namesMap[namesListIndex].nodeId = nodeID;
snprintf(namesMap[namesListIndex].name, 17, "%s", nodeName);
namesListIndex++;
}
/**
* Get the name of a node
* @param nodeID
* Node ID
* @return char *
* Pointer to the nodes name or null if no name was found
*/
char *getNodeName(uint32_t nodeID)
{
for (int idx = 0; idx < _numOfNames; idx++)
{
if (namesMap[idx].nodeId == nodeID)
{
// Found the node in the list, return pointer to the name
return namesMap[idx].name;
}
}
myLog_w("Didn't find the name in the list");
return NULL;
}
/**
* Get the id of a node by its name
* @param nodeName
* Node name
* @return nodeId
* NodeID belonging to node name or 0 if not found
*/
uint32_t getNodeIdFromName(char *nodeName)
{
for (int idx = 0; idx < _numOfNames; idx++)
{
if (strcmp(namesMap[idx].name, nodeName) == 0)
{
// Found the node in the list, return pointer to the name
return namesMap[idx].nodeId;
}
}
myLog_w("Didn't find the nodeID in the list");
return 0;
}
/**
* Get node name by index
* @param index
* Index of request
* @return char *
* Pointer to namesList entry or NULL if end of list
*/
namesList *getNodeNameByIndex(uint8_t index)
{
if (namesMap[index].name[0] != 0)
{
return &namesMap[index];
}
return NULL;
}
/**
* Delete node name by node ID
* @param nodeId
* nodeID to be deleted
*/
void deleteNodeName(uint32_t nodeId)
{
for (int idx = 0; idx < namesListIndex; idx++)
{
if (namesMap[idx].nodeId == nodeId)
{
myLog_d("Found name entry for %08X", nodeId);
// Found the node in the list,
// delete it by copying following names on top of it
memcpy(&namesMap[idx], &namesMap[idx + 1],
sizeof(namesList) * (_numOfNames - idx - 1));
namesListIndex--;
return;
}
}
}
|
7522f5a62f4d02d07727e3eb1ffe57614d1ffadb
|
4db165b7859b4db00b3a6bbe174ad286f9b23813
|
/C++ Tasks/A10P3/A10P3/City.cpp
|
5d3ca4f60760087bff5299c852287b8d39ca968f
|
[] |
no_license
|
osobiehl/C-and-C-
|
1461d947fe5375cf05d546699e76b5deb9fc20b9
|
69a934a62052ca8541339eaa5092a697e8205c87
|
refs/heads/master
| 2022-12-16T11:33:15.357872
| 2020-09-10T14:44:59
| 2020-09-10T14:44:59
| 294,438,857
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 757
|
cpp
|
City.cpp
|
/*
CH-230-A
a10 p3.[c or cpp or h]
Jose Biehl
j.biehl@jacobs-university.de
*/
using namespace std;
#include <iostream>
#include "City.h"
void City::setName(string& newname){
name = newname;
}
void City::setInhabitants(long int& newinhabitants){
inhabitants = newinhabitants;
}
void City::setMayor(string& newmayor){
mayor = newmayor;
}
void City::setArea(long double& newarea){
area = newarea;
}
string City::getName(){
return name;
}
long int City::getInhabitants(){
return inhabitants;
}
string City::getMayor(){
return name;
}
long double City::getArea(){
return area;
}
void City::print(){
cout<<"name: "<<name<<"\n population: "<<inhabitants<<"\n mayor: "<<mayor<<endl;
cout<<"area: "<<area<<endl;
}
|
92f8d0499f373adc23a5e4d436866302beb44e30
|
c19e2b7d95394bf491ff9c3ab6c9516ebc3903df
|
/extras/attic/src/sensors/opticalflow/lpf_opticalflow.hpp
|
1da77811bf377c1f5f857a4fab37bfb73a414ec2
|
[
"MIT"
] |
permissive
|
nobelmanaye/Hackflight
|
66268d9a980160b10855c9d7c889ba1747527e2d
|
17d2bf7c769ae05e21d857335f5c11868e3db39e
|
refs/heads/master
| 2023-05-04T02:28:28.614423
| 2021-05-20T20:25:37
| 2021-05-20T20:25:37
| 369,320,938
| 0
| 1
|
MIT
| 2021-05-20T20:25:38
| 2021-05-20T19:46:06
|
Java
|
UTF-8
|
C++
| false
| false
| 3,079
|
hpp
|
lpf_opticalflow.hpp
|
/*
Support for PMW3901 optical-flow sensor with low-pass filter
Copyright (c) 2018 Simon D. Levy
This file is part of Hackflight.
Hackflight is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Hackflight is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Hackflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <cmath>
#include <math.h>
#include <PMW3901.h>
#include "sensor.hpp"
#include "filters.hpp"
namespace hf {
class OpticalFlow : public Sensor {
private:
static constexpr float UPDATE_PERIOD = .01f;
static const uint8_t LPF_SIZE = 64;
// Use digital pin 10 for chip select
PMW3901 _flowSensor = PMW3901(10);
// Use low-pass filters for smoothing
LowPassFilter _lpf_x = LowPassFilter(LPF_SIZE);
LowPassFilter _lpf_y = LowPassFilter(LPF_SIZE);
// Track elapsed time for periodic readiness
float _previousTime = 0;
float _deltaTime = 0;
protected:
virtual void modifyState(state_t & state, float time) override
{
// Avoid time blips
if (_deltaTime > 0.02) return;
// Read sensor
int16_t dpixelx=0, dpixely=0;
_flowSensor.readMotionCount(&dpixelx, &dpixely);
// Scale readings by altitude, then low-pass filter them to get velocity
state.inertialVel[0] = _lpf_y.update(dpixely * state.location[2] * _deltaTime);
state.inertialVel[1] = _lpf_x.update(-dpixelx * state.location[2] * _deltaTime);
// Integrate velocity to get position
state.location[0] += state.inertialVel[0];
state.location[1] += state.inertialVel[1];
}
virtual bool ready(float time) override
{
_deltaTime = time - _previousTime;
bool result = _deltaTime > UPDATE_PERIOD;
if (result) {
_previousTime = time;
}
return result;
}
public:
void begin(void)
{
if (!_flowSensor.begin()) {
while (true) {
Serial.println("Initialization of the flow sensor failed");
delay(500);
}
}
_lpf_x.begin();
_lpf_y.begin();
_previousTime = 0;
}
}; // class OpticalFlow
} // namespace hf
|
488c2a153428ef6ab58e02495e2e8e1bcb590339
|
db5219feafd31f3b782e6ef0cbb3865ddf594f1c
|
/Files/Functions_pointers.cpp
|
196922edb7541671cea8b4013b1c8edb74417b53
|
[
"Apache-2.0"
] |
permissive
|
Ninosauleo/tutorialC-
|
cab397716cd5ac4b65ed0c8ea687b21eee59ffbb
|
fd76ff79bb80da78649d0e3da31966c24bc8063d
|
refs/heads/master
| 2021-07-14T22:42:14.547036
| 2020-07-15T12:48:53
| 2020-07-15T12:48:53
| 84,781,743
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,040
|
cpp
|
Functions_pointers.cpp
|
#include <iostream>
using namespace std;
//void multiplyBy(int &, int);
int * multiplyBy(int *, int);
void multiplyArrayBy(int *, int, int);
int main()
{
/*
int a = 10;
int *b = multiplyBy(&a, 5);
*b = 999;
cout << a << endl;
cout << *b << endl;
*/
int array[10];
//cout << sizeof(array)/sizeof(array[0]) << endl; //used to get the real size of the array
for (int i = 0; i < sizeof(array)/sizeof(array[0]); i++)
{
array[i] = i;
// cout << "array [" << i << "] = " << array[i] << endl;
}
multiplyArrayBy(&array[0], 5, sizeof(array)/sizeof(array[0])); // &array[0] == array
for (int i = 0; i < sizeof(array)/sizeof(array[0]); i++)
{
cout << "array [" << i << "] = " << array[i] << endl;
}
return 0;
}
int * multiplyBy(int * var, int amount)
{
//int * var = &a;
*var = *var * amount;
return var;
}
void multiplyArrayBy(int *array, int amount, int sizeOfArray)
{
while(sizeOfArray--)
array[sizeOfArray] *= amount;
}
|
c910e95495aa3a678c05d82b6387233c5080cac5
|
5e64f5acb358b5400647ca97203ec58e58d38730
|
/main.cpp
|
11dfb79f8b6387c45b83ea204c5b2d0c66413117
|
[] |
no_license
|
yuliyacz/oop-examples
|
c88b898570c7e700cd1d075a8057f04ec729ade1
|
b9757efccc8d78c14b68feefa4f94b9cd3eb713d
|
refs/heads/master
| 2021-06-11T14:15:28.659916
| 2016-12-05T17:21:44
| 2016-12-05T17:21:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,977
|
cpp
|
main.cpp
|
#include <iostream>
#include <vector>
#include <fstream>
#include <limits>
#include "Room.h"
#include "Person.h"
#include "Reservation.h"
#include "Date.h"
#include "Hotel.h"
#include "priklady/Student.h"
#include "priklady/Cislo.h"
#include "priklady/GumovePole.h"
using namespace std;
int main() {
//Hotel reservation system
//tvorba pokoju v hotelu
Hotel hotel;
hotel.createRooms();
//nacteni ze souboru
vector<Reservation> reservations = hotel.reservationsToVector();
vector<Person> guests = hotel.guestsToVector();
vector<Room> rooms = hotel.roomsToVector();
//vypis hlavniho menu
hotel.mainMenu();
int kategorie;
while (true) {
while (true) {
cin >> kategorie;
if (kategorie>0 && kategorie<8) { break;}
else {
//cout << "Zadejte cislo od 1 do 7\n";
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(), '\n');
}
}
switch (kategorie) {
case 1: {
//nova rezervace
hotel.createReservation(reservations, guests);
hotel.mainMenu();
break;
}
case 2: {
//vypis vsech rezervaci
hotel.getAllReservations(reservations);
hotel.reservationMenu(reservations);
break;
}
case 3: {
//vypis vsech hostu
hotel.getAllGuests(guests);
hotel.guestsMenu(guests);
break;
}
case 4: {
//vyhledavani
hotel.reservationFindMenu(reservations);
break;
}
case 5: {
int k = hotel.guestFindMenu(guests);
break;
}
case 6: {
int den, mesic, rok;
bool valid = false;
Date start, end;
while (!valid) {
do {
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
std::cout << "\n\nZadejte data nastehovani a odstehovani\n";
std::cout << "Checkin (ve tvaru dd mm yyyy): ";
std::cin >> den >> mesic >> rok;
} while (std::cin.fail());
start.setDate(den, mesic, rok);
valid = start.validDate();
}
valid = false;
while (!valid) {
do {
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
std::cout << "Checkout (ve tvaru dd mm yyyy): ";
std::cin >> den >> mesic >> rok;
} while (std::cin.fail());
end.setDate(den, mesic, rok);
valid = end.validDate();
}
hotel.checkAvailability(reservations, start, end, false);
break;
}
case 7: {
hotel.guestsToFile(guests);
hotel.reservationsToFile(reservations);
return 0;
}
}
}
/*
//Student
Student student("Julie");
for (int i = 0; i<30; i++) {
int r = rand() %50 +1;
student.zapisPredmetu(r);
}
cout << "\n";
student.zapocet(19);
student.zkouska(19, 5);
student.zkouska(19, 2);
student.zapocet(16);
student.zapocet(43);
student.zapocet(33);
student.zkouska(33, 1);
student.zapocet(13);
student.zkouska(16, 4);
student.splnenePredmety();
//cout << "\n" << student.prumer() << "\n";
student.vypsatSeznamPredmetu();
Student *s = new Student("Novy");
s->setName("MyName");
s->getName();
Student student1;
vector<Student> students;
students.push_back(student);
students.push_back(*s);
students.push_back(student1);
student.save(students);
*/
/*
//Cislo - Cele, Realne, Komplexni
Realne realne(4.5), realne1(78.29), realne2;
Komplexni cislo(8.34, -77), cislo1(-32, 7.3);
Komplexni cislo3 = cislo+cislo1;
(cislo*cislo).vypisCisla();
cislo3.vypisCisla();
(realne-realne1).vypisCisla();
(realne*realne1).vypisCisla();
(realne/realne1).vypisCisla();
realne2=realne;
realne2.vypisCisla();
cislo3 = cislo1;
cislo3.vypisCisla();
Cele cele(15), cele1, cele2(73);
cele2 -= cele;
(cele2*cele).vypisCisla();
Komplexni komplexni(1.11, 10), komplexni1(7, 3);
//komplexni1 *= komplexni;
komplexni1 = komplexni*komplexni1;
komplexni1.vypisCisla();
*/
/*
//Gumove pole
GumovePole<int> pole(5);
for (int i=0; i<18; i++) {
pole[i] = i+1;
}
pole.vypis();
*
return 0;*/
}
|
ee9aa027b492fd73d5bc14f1ee151c092838ddf7
|
e65a4dbfbfb0e54e59787ba7741efee12f7687f3
|
/devel/electron23/files/patch-services_device_hid_hid__service.cc
|
0830326cab3c5a733628dded393625e0ea7fb059
|
[
"BSD-2-Clause",
"BSD-3-Clause"
] |
permissive
|
freebsd/freebsd-ports
|
86f2e89d43913412c4f6b2be3e255bc0945eac12
|
605a2983f245ac63f5420e023e7dce56898ad801
|
refs/heads/main
| 2023-08-30T21:46:28.720924
| 2023-08-30T19:33:44
| 2023-08-30T19:33:44
| 1,803,961
| 916
| 918
|
NOASSERTION
| 2023-09-08T04:06:26
| 2011-05-26T11:15:35
| null |
UTF-8
|
C++
| false
| false
| 1,012
|
cc
|
patch-services_device_hid_hid__service.cc
|
--- services/device/hid/hid_service.cc.orig 2022-11-30 08:12:58 UTC
+++ services/device/hid/hid_service.cc
@@ -20,6 +20,10 @@
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV)
#include "services/device/hid/hid_service_linux.h"
+#elif BUILDFLAG(IS_OPENBSD)
+#include "services/device/hid/hid_service_fido.h"
+#elif BUILDFLAG(IS_FREEBSD)
+#include "services/device/hid/hid_service_freebsd.h"
#elif BUILDFLAG(IS_MAC)
#include "services/device/hid/hid_service_mac.h"
#elif BUILDFLAG(IS_WIN)
@@ -68,6 +72,10 @@ constexpr base::TaskTraits HidService::kBlockingTaskTr
std::unique_ptr<HidService> HidService::Create() {
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(USE_UDEV)
return std::make_unique<HidServiceLinux>();
+#elif BUILDFLAG(IS_OPENBSD)
+ return std::make_unique<HidServiceFido>();
+#elif BUILDFLAG(IS_FREEBSD)
+ return std::make_unique<HidServiceFreeBSD>();
#elif BUILDFLAG(IS_MAC)
return std::make_unique<HidServiceMac>();
#elif BUILDFLAG(IS_WIN)
|
0ce50fd9691fcc13e7eb4ead994fa4d8baab026e
|
0224a30ff811a65e452a32143ed1d7a73aebc3be
|
/src/checkpoints.h
|
c9bdefa19a098d6eabe0fdf8d988f81781985534
|
[
"MIT"
] |
permissive
|
xiaolin1579/TDC
|
893667bfd0bc83e43cb11b0e7a03eb41572837c2
|
c5aadc1676cc9bdb7e558500c55944d3a78fb8be
|
refs/heads/TDC
| 2022-10-06T09:07:45.172219
| 2020-05-30T04:58:52
| 2020-05-30T04:58:52
| 267,499,071
| 0
| 0
|
MIT
| 2020-05-28T10:51:14
| 2020-05-28T05:12:24
| null |
UTF-8
|
C++
| false
| false
| 1,563
|
h
|
checkpoints.h
|
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_CHECKPOINT_H
#define BITCOIN_CHECKPOINT_H
#include <map>
class uint256;
class CBlockIndex;
/** Block-chain checkpoints are compiled-in sanity checks. Block-chain чекпоинты компилируются для санитарной проверки
* They are updated every release or three. Они обновляются каждый релиз или третий
*/
namespace Checkpoints
{
// Returns true if block passes checkpoint checks Возвращает истину, если блок проходит контрольную точку проверки
bool CheckBlock(int nHeight, const uint256& hash);
// Return conservative estimate of total number of blocks, 0 if unknown Возвращает консервативную оценку общего числа блоков, 0, если неизвестно
int GetTotalBlocksEstimate();
// Returns last CBlockIndex* in mapBlockIndex that is a checkpoint Возвращает последний CBlockIndex* в mapBlockIndex, который является чекпинтом
CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex);
double GuessVerificationProgress(CBlockIndex *pindex);
extern bool fEnabled;
}
#endif
|
fd475137b5c0e9dc9cabc8d8295b3d1de063b020
|
3c3b2f787577c78a022c473456caeab85f678de8
|
/main.cc
|
0a20a245c9979c08de3f4955d05e3a2c21e84af7
|
[] |
no_license
|
Brubrobra/commentCounter
|
1238e121c73f7b357921c6cdba604d1659b28a05
|
632dfc01670042e910334580fb291d0ac4d15d53
|
refs/heads/master
| 2020-08-22T13:01:37.618959
| 2019-10-21T03:10:41
| 2019-10-21T03:10:41
| 216,400,218
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 3,295
|
cc
|
main.cc
|
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include <vector>
#include "utils.h"
using namespace std;
int main(int argc, char* argv[]){
string fileToRead;/* the name of file to read */
if(argc < 2){
cout<< "ERROR: expecting a file name" << endl;
exit(1);/* no input provided, error */
}else{
stringstream ss(argv [1]);/* take in the file name from ocmmand line args */
fileToRead = ss.str();
}
ifstream file{fileToRead};
string line; /*a single line we read */
int totalLines = 0; /* total Lines of code */
int lastBlockStart = 0; /* the last line where a block comment start */
int totalTodos = 0;
int totalBlocks = 0;
int totalComments = 0;
int singleComments = 0;/*single comments means comments that are not trailing */
int blockComments = 0;
/*get the extension of the file we are checking */
string extension = getExtension(fileToRead);
/*syntaxCode determines which comment syntax to follow based on file surfix */
int syntaxCode;
string commentMark;
string blockStartMark;
string blockEndMark;
string todo = "TODO";
vector<int> comments;
setMarkers(extension, syntaxCode, blockStartMark, blockEndMark, commentMark);
/*a syntax code 0 means there is no separate syntax for single/block comments */
/*a syntax code 1 means there are separate formats for single/block comments*/
/* in this loop we parse the file line by line*/
while(getline(file,line)){
//cout << line << endl;
totalLines ++;
if(isEmpty(line))continue;
if(syntaxCode == 0){
if(!tooShort(line, commentMark)){
if(findMarker(line, commentMark)){
totalComments ++;
if(separateComment(line, commentMark)){
comments.emplace_back(totalLines);
}
if(!tooShort(line, todo)){
if(findMarker(line,todo)){
totalTodos ++;
}
}
}
}
}else{/* syntaxCode == 1 */
if(!tooShort(line, blockStartMark)){
if(findMarker(line,blockStartMark)){
totalBlocks ++;
lastBlockStart = totalLines;
}
}
if(!tooShort(line,blockEndMark)){
if(findMarker(line,blockEndMark)){
int blockLines = totalLines - lastBlockStart + 1;
totalComments += blockLines;
blockComments += blockLines;
}
}
if(!tooShort(line, commentMark)){
if(findMarker(line, commentMark)){
totalComments += 1;
singleComments += 1;
}
}
}
}
if(syntaxCode == 0){// we get to deal with vector<int> comments
int size = comments.size();
int acc = 1;
for (int i = 0; i < size -1; i ++){
if(comments.at(i+1)-comments.at(i)==1){
acc ++;
}else{
if(acc > 1){
/*we have more than one line of non-trailing comments which counts as a block*/
totalBlocks ++;
blockComments += acc;
acc = 1;
}
}
}
if(acc > 1){
totalBlocks ++;
blockComments += acc;
}
singleComments = totalComments - blockComments;
}
cout << "Total # of lines: " << totalLines << endl;
cout << "Total # of comment lines: " << totalComments << endl;
cout << "Total # of single line comments: " <<singleComments << endl;
cout << "Total # of comment lines within block comments: " << blockComments << endl;
cout << "Total # of block line comments: " << totalBlocks << endl;
cout << "Total # of TODO's: " <<totalTodos << endl;
}
|
34e5b2b08fd03de826290e35c7ee0d8e226d3a39
|
fa224b83a4f2bf1f969233a5f0ea7547ca8abde4
|
/namename4.cpp
|
d9023fde2d229d3c6843e0679c58a8fcb7e4510a
|
[] |
no_license
|
stamhoffman/coursera
|
b54af6b9e518a9a1e84a04ab7cf61b7a8a2caa21
|
3eda5219488c28310e1b50a346b1ac4180b15f70
|
refs/heads/master
| 2020-12-12T16:35:08.122022
| 2020-01-15T21:33:16
| 2020-01-15T21:33:16
| 234,176,049
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 4,491
|
cpp
|
namename4.cpp
|
//#include <algorithm>
//#include <fstream>
//#include <iostream>
//#include <iterator>
//#include <map>
//#include <set>
//#include <string>
//#include <vector>
// using namespace std;
// class Person {
// public:
// Person(std::string first_name, std::string last_name, int year) {
// data[year]["first_name"] = first_name;
// data[year]["last_name"] = last_name;
// }
// void ChangeFirstName(int year, const string &first_name) {
// if (data.size() == 0) return;
// data[year]["first_name"] = first_name;
// }
// void ChangeLastName(int year, const string &last_name) {
// if (data.size() == 0) return;
// data[year]["last_name"] = last_name;
// }
// std::string GetFullName(int year) const {
// if (data.size() == 0 || year < data.begin()->first) {
// return "No person";
// }
// std::string last;
// std::string first;
// for (auto unit : data) {
// if (unit.first > year) {
// break;
// }
// if (unit.second["last_name"].size() != 0) {
// last = unit.second["last_name"];
// }
// if (unit.second["first_name"].size() != 0) {
// first = unit.second["first_name"];
// }
// }
// if (last.size() == 0) {
// last = "with unknown last name";
// }
// if (first.size() == 0) {
// first = "with unknown first name";
// first.swap(last);
// }
// return first + " " + last;
// }
// string GetFullNameWithHistory(int year) const {
// // получить все имена и фамилии по состоянию на конец года year
// if (data.size() == 0 || year < data.begin()->first) {
// return "No person";
// }
// std::string last;
// std::string first;
// for (auto unit : data) {
// if (unit.first > year) {
// break;
// }
// if (unit.second["last_name"].size() != 0) {
// last = unit.second["last_name"];
// }
// if (unit.second["first_name"].size() != 0) {
// first = unit.second["first_name"];
// }
// }
// std::vector<std::string> a;
// std::vector<std::string> b;
// for (auto unit : data) {
// if (unit.first > year) {
// break;
// }
// if (unit.second["last_name"].size() != 0) {
// a.push_back(unit.second["last_name"]);
// }
// if (unit.second["first_name"].size() != 0) {
// b.push_back(unit.second["first_name"]);
// }
// }
// if (a.size() > 0) a.pop_back();
// if (b.size() > 0) b.pop_back();
// auto itra = std::unique(a.begin(), a.end());
// a.resize(itra - a.begin());
// auto itrb = std::unique(b.begin(), b.end());
// b.resize(itrb - b.begin());
// if (a.size() == 1 && (*a.begin() == last)) {
// a.pop_back();
// }
// if (b.size() == 1 && (*b.begin() == first)) {
// b.pop_back();
// }
// if (a.size() > 1 && (*(a.end() - 1) == last)) {
// a.pop_back();
// }
// if (b.size() > 1 && (*(b.end() - 1) == first)) {
// b.pop_back();
// }
// std::string pred_first;
// std::string pred_last;
// pred_last.clear();
// pred_first.clear();
// for (auto unit : a) {
// pred_last.insert(0, unit + ", ");
// }
// for (auto unit : b) {
// pred_first.insert(0, unit + ", ");
// }
// if (pred_last.size() != 0) {
// pred_last.erase(pred_last.end() - 1);
// pred_last.erase(pred_last.end() - 1);
// pred_last.insert(0, " (");
// pred_last.append(")");
// }
// if (pred_first.size() != 0) {
// pred_first.erase(pred_first.end() - 1);
// pred_first.erase(pred_first.end() - 1);
// pred_first.insert(0, " (");
// pred_first.append(")");
// }
// if (last.size() == 0) {
// last = "with unknown last name";
// }
// if (first.size() == 0) {
// first = "with unknown first name";
// first.swap(last);
// pred_first.swap(pred_last);
// }
// return first + pred_first + " " + last + pred_last;
// }
// private:
// std::map<int, std::map<std::string, std::string>> data;
//};
//// int main() {
//// Person person("Polina", "Sergeeva", 1960);
//// for (int year : {1959, 1960}) {
//// cout << person.GetFullNameWithHistory(year) << endl;
//// }
//// person.ChangeFirstName(1965, "Appolinaria");
//// person.ChangeLastName(1967, "Ivanova");
//// for (int year : {1965, 1967}) {
//// cout << person.GetFullNameWithHistory(year) << endl;
//// }
//// return 0;
////}
|
2d554ab72789bfd771037567811eb0364b804b12
|
88dc4ff0c8427ae59f5c4f5e2a3572e7e1316951
|
/TetriusClone/BitMapObject.cpp
|
e915ef9fea48572f1d60e32c14ce0f2199b80a96
|
[] |
no_license
|
Ethoe/Cpptris
|
596398fdf036be7d73aa4f84818bc3f704436b58
|
34e66d3458c82a610dec4c62f6dca98d010a5ba0
|
refs/heads/master
| 2021-01-13T18:12:28.590980
| 2020-02-24T23:47:40
| 2020-02-24T23:47:40
| 242,452,681
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,301
|
cpp
|
BitMapObject.cpp
|
#include "bitmapobject.h"
BitMapObject::BitMapObject()
{
hdcMemory = NULL;
nextBitMap = NULL;
oldBitMap = NULL;
iWidth = 0;
iHeight = 0;
}
BitMapObject::~BitMapObject()
{
if (hdcMemory)
Destroy();
}
void BitMapObject::Load(HDC hdcCompatible, LPCTSTR lpszFilename)
{
if (hdcMemory)
Destroy();
hdcMemory = CreateCompatibleDC(hdcCompatible);
nextBitMap = (HBITMAP)LoadImage(NULL, lpszFilename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
oldBitMap = (HBITMAP)SelectObject(hdcMemory, nextBitMap);
BITMAP bmp;
GetObject(nextBitMap, sizeof(BITMAP), (LPVOID)&bmp);
iWidth = bmp.bmWidth;
iHeight = bmp.bmHeight;
}
void BitMapObject::Create(HDC hdcCompatible, int width, int height)
{
if (hdcMemory)
Destroy();
hdcMemory = CreateCompatibleDC(hdcCompatible);
nextBitMap = CreateCompatibleBitmap(hdcCompatible, width, height);
oldBitMap = (HBITMAP)SelectObject(hdcMemory, nextBitMap);
iWidth = width;
iHeight = height;
}
void BitMapObject::Destroy()
{
SelectObject(hdcMemory, oldBitMap);
DeleteObject(nextBitMap);
DeleteDC(hdcMemory);
hdcMemory = NULL;
nextBitMap = NULL;
oldBitMap = NULL;
iWidth = 0;
iHeight = 0;
}
BitMapObject::operator HDC()
{
return(hdcMemory);
}
int BitMapObject::GetWidth()
{
return(iWidth);
}
int BitMapObject::GetHeight()
{
return(iHeight);
}
|
e9f74bf815efe1a6ce5c6882b5271f6e76473dd1
|
a8fecb3a9ba96cb697209bf7d219d2b5ae91ca5d
|
/Leetcode/Leetcode_Problems/Remove_duplicates_from_sorted_array/main.cpp
|
0f44a06d319ef2cc84e3ed9d363b9644cf6bb040
|
[] |
no_license
|
sabasarwar/Coding_Practice
|
c7344e5d41d4ada9bea720d72ba0e49a8af7551d
|
182b1c605c39cc75e5e4a7818d82159895c8d217
|
refs/heads/master
| 2022-11-17T20:27:39.488304
| 2020-07-15T15:50:50
| 2020-07-15T15:50:50
| 257,617,997
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,483
|
cpp
|
main.cpp
|
/* ----------------------- Problem Statement -----------------------------
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
Example 1:
Given nums = [1,1,2],
Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively.
It doesn't matter what you leave beyond the returned length.
---------------------------------------------------------------------------*/
/* Solution 1 */
class Solution {
public:
int removeDuplicates(vector<int>& nums)
{
if(nums.size() == 0)
return 0;
int s=1;
for(int i=0 ; i<nums.size()-1 ; i++)
{
if(nums[i] != nums[i+1])
{
nums[s]=nums[i+1];
s++;
}
}
return s;
}
};
/* Solution 2 */
class Solution {
public:
int removeDuplicates(vector<int>& nums)
{
if(nums.size() == 0)
return 0;
vector<int>::iterator it;
it = nums.begin();
int i=1;
int item=nums[0];
while(i<nums.size())
{
if(item == nums[i])
nums.erase(it+i);
else
item=nums[i];
i++;
}
return nums.size();
}
};
|
0af047951b2a7cabe650704b413940c31772ec9b
|
9df48ca30c98a45eed8aecc99ef79af11c3a7348
|
/editor/include/Ressources/Manager.hpp
|
1fbd2761fc076451812f253b13f9378e0aa1c577
|
[] |
no_license
|
benit8/NETiles
|
8818870ca5e5f48cf6412644e11bca2729d3faea
|
fca2e60e5a0dd369a13cef1b19baaf2a799330f0
|
refs/heads/master
| 2020-03-31T03:32:15.724203
| 2018-11-22T17:36:37
| 2018-11-22T17:36:37
| 151,868,553
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,304
|
hpp
|
Manager.hpp
|
/*
** EPITECH PROJECT, 2018
** NETiles / Editor
** File description:
** Ressources / Manager.hpp
*/
#pragma once
////////////////////////////////////////////////////////////////////////////////
namespace Ressource {
class Manager;
}
////////////////////////////////////////////////////////////////////////////////
#include <fstream>
#include <iostream>
#include <map>
#include <stdexcept>
#include <string>
#include <sys/stat.h>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include "Ressources/Container.hpp"
#include "Utils/Singleton.hpp"
////////////////////////////////////////////////////////////////////////////////
namespace Ressource
{
const std::string assetsDir = "../assets/";
class Manager : public Singleton
{
public:
static Manager& getInstance();
static sf::Font &getFont(const std::string& name, bool isFullPath = false);
static sf::Image &getImage(const std::string& name, bool isFullPath = false);
static sf::Texture &getTexture(const std::string& name, bool isFullPath = false);
static sf::SoundBuffer &getSoundBuffer(const std::string& name, bool isFullPath = false);
private:
Container<sf::Font> m_fonts;
Container<sf::Image> m_images;
Container<sf::Texture> m_textures;
Container<sf::SoundBuffer> m_soundBuffers;
private:
Manager() noexcept;
};
}
|
08184b64e900773a6d74843f97cfa76c37ac867b
|
4e99979e6f68580d93bea46b0addcf83b31da473
|
/src/environment.cpp
|
fdcf62cee7ce0f40506ff88757b322f2b3ff1280
|
[] |
no_license
|
Marconefs/SFND_Lidar_Obstacle_Detection
|
0838234bf7aed7740d5523949d933b2c77a2bfed
|
305312e445cb6059f8206c2dca01ca72f32f26f1
|
refs/heads/main
| 2023-06-10T09:34:17.356700
| 2021-06-17T02:29:00
| 2021-06-17T02:29:00
| 377,312,899
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 8,949
|
cpp
|
environment.cpp
|
/* \author Aaron Brown */
// Create simple 3d highway enviroment using PCL
// for exploring self-driving car sensors
#include "sensors/lidar.h"
#include "render/render.h"
#include "processPointClouds.h"
// using templates for processPointClouds so also include .cpp to help linker
#include "processPointClouds.cpp"
#include "ransac3d.cpp"
#include "cluster.cpp"
std::vector<Car> initHighway(bool renderScene, pcl::visualization::PCLVisualizer::Ptr& viewer)
{
Car egoCar( Vect3(0,0,0), Vect3(4,2,2), Color(0,1,0), "egoCar");
Car car1( Vect3(15,0,0), Vect3(4,2,2), Color(0,0,1), "car1");
Car car2( Vect3(8,-4,0), Vect3(4,2,2), Color(0,0,1), "car2");
Car car3( Vect3(-12,4,0), Vect3(4,2,2), Color(0,0,1), "car3");
std::vector<Car> cars;
cars.push_back(egoCar);
cars.push_back(car1);
cars.push_back(car2);
cars.push_back(car3);
if(renderScene)
{
//renderHighway(viewer);
//egoCar.render(viewer);
//car1.render(viewer);
//car2.render(viewer);
//car3.render(viewer);
}
return cars;
}
void simpleHighway(pcl::visualization::PCLVisualizer::Ptr& viewer)
{
// ----------------------------------------------------
// -----Open 3D viewer and display simple highway -----
// ----------------------------------------------------
// RENDER OPTIONS
bool renderScene = true;
std::vector<Car> cars = initHighway(renderScene, viewer);
// TODO:: Create lidar sensor
Lidar* lidar = new Lidar(cars, 0);
pcl::PointCloud<pcl::PointXYZ>::Ptr inputCloud = lidar->scan();
//renderRays(viewer, lidar->position, inputCloud);
//renderPointCloud(viewer, inputCloud, "inputCloud");
// TODO:: Create point processor and segment the ground
ProcessPointClouds<pcl::PointXYZ> pointProcessor;
std::pair<typename pcl::PointCloud<pcl::PointXYZ>::Ptr, typename pcl::PointCloud<pcl::PointXYZ>::Ptr> segmentCloud = pointProcessor.SegmentPlane(inputCloud, 100, 0.2);
//renderPointCloud(viewer, segmentCloud.first, "cloud_obstacles", Color(0,1,0));
//renderPointCloud(viewer, segmentCloud.second, "cloud_road", Color(1,0,0));
// Clustering the object above the ground
std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> cloudClusters = pointProcessor.Clustering(segmentCloud.first, 1.0, 3, 30);
int clusterId = 0;
std::vector<Color> colors = {Color(1,0,0), Color(0,1,0), Color(0,0,1)};
for(pcl::PointCloud<pcl::PointXYZ>::Ptr cluster : cloudClusters)
{
std::cout << "cluster size ";
pointProcessor.numPoints(cluster);
renderPointCloud(viewer,cluster,"obstCloud"+std::to_string(clusterId),colors[clusterId]);
Box box = pointProcessor.BoundingBox(*cluster);
renderBox(viewer,box,clusterId);
++clusterId;
}
}
//void cityBlock(pcl::visualization::PCLVisualizer::Ptr& viewer)
void cityBlock(pcl::visualization::PCLVisualizer::Ptr& viewer, ProcessPointClouds<pcl::PointXYZI>* pointProcessorI, const pcl::PointCloud<pcl::PointXYZI>::Ptr& inputCloud)
{
// ----------------------------------------------------
// -----Open 3D viewer and display City Block -----
// ----------------------------------------------------
//ProcessPointClouds<pcl::PointXYZI>* pointProcessorI = new ProcessPointClouds<pcl::PointXYZI>();
//pcl::PointCloud<pcl::PointXYZI>::Ptr inputCloud = pointProcessorI->loadPcd("../src/sensors/data/pcd/data_1/0000000000.pcd");
// Filter the input cloud by making a voxel grid and delimitating the region of interest (ROI)
Eigen::Vector4f minPoint (-15,-6,-5,1);
Eigen::Vector4f maxPoint (15,6,5, 1);
float filterRes = 0.3;
pcl::PointCloud<pcl::PointXYZI>::Ptr filteredCloud = pointProcessorI->FilterCloud(inputCloud,filterRes,minPoint,maxPoint);
// Segment the ground planes
std::pair<typename pcl::PointCloud<pcl::PointXYZI>::Ptr, typename pcl::PointCloud<pcl::PointXYZI>::Ptr> segmentCloudGround = pointProcessorI->SegmentPlane(filteredCloud, 100, 0.2);
renderPointCloud(viewer, segmentCloudGround.second, "Ground point cloud", Color(0,1,0));
// Clustering the object above the ground
float clusterTolerance = 0.5;
int minSize = 5;
int maxSize = 300;
std::vector<pcl::PointCloud<pcl::PointXYZI>::Ptr> cloudClusters = pointProcessorI->Clustering(segmentCloudGround.first, clusterTolerance, minSize, maxSize);
int clusterId = 0;
std::vector<Color> colors = {Color(1,0,0), Color(0,1,0), Color(0,0,1)};
// Render each point cloud object with its bounding box
for(pcl::PointCloud<pcl::PointXYZI>::Ptr cluster : cloudClusters)
{
std::cout << "cluster size ";
pointProcessorI->numPoints(cluster);
renderPointCloud(viewer,cluster,"obstCloud"+std::to_string(clusterId),colors[clusterId]);
Box box = pointProcessorI->BoundingBox(*cluster);
renderBox(viewer,box,clusterId);
++clusterId;
}
//renderPointCloud(viewer,filteredCloud,"filteredCloud");
}
void cityBlock_fromScratch(pcl::visualization::PCLVisualizer::Ptr& viewer, ProcessPointClouds<pcl::PointXYZI>* pointProcessorI, const pcl::PointCloud<pcl::PointXYZI>::Ptr& inputCloud)
{
// Filter the input cloud by making a voxel grid and delimitating the region of interest (ROI)
Eigen::Vector4f minPoint (-15,-5,-5,1);
Eigen::Vector4f maxPoint (15,5,5, 1);
float filterRes = 0.3;
pcl::PointCloud<pcl::PointXYZI>::Ptr filteredCloud = pointProcessorI->FilterCloud(inputCloud,filterRes,minPoint,maxPoint);
// Segment road plane
std::unordered_set<int> inliers = Ransac(filteredCloud, 10, 0.5);
pcl::PointCloud<pcl::PointXYZI>::Ptr cloudPlane(new pcl::PointCloud<pcl::PointXYZI>());
pcl::PointCloud<pcl::PointXYZI>::Ptr cloudObjects(new pcl::PointCloud<pcl::PointXYZI>());
for(int index = 0; index < filteredCloud->points.size(); index++)
{
pcl::PointXYZI point = filteredCloud->points[index];
if(inliers.count(index))
cloudPlane->points.push_back(point);
else
cloudObjects->points.push_back(point);
}
// Find clusters
std::vector<std::vector<int>> clusters_index = getClusters(cloudObjects, 1.0);
std::vector<pcl::PointCloud<pcl::PointXYZI>::Ptr> clusters;
for(std::vector<int> cluster_i : clusters_index)
{
pcl::PointCloud<pcl::PointXYZI>::Ptr clusterCloud (new pcl::PointCloud<pcl::PointXYZI>);
for(int indice: cluster_i)
clusterCloud->push_back(cloudObjects->points[indice]);
clusters.push_back(clusterCloud);
}
// Render 3D point cloud with plane, obsjects and its bounding boxes
if(inliers.size())
renderPointCloud(viewer,cloudPlane,"inliers",Color(0,1,0));
int clusterId = 0;
for(pcl::PointCloud<pcl::PointXYZI>::Ptr cluster : clusters)
{
renderPointCloud(viewer, cluster,"cluster"+std::to_string(clusterId),Color(1,0,0));
pcl::PointCloud<pcl::PointXYZ> cloud_xyz;
pcl::copyPointCloud(*cluster, cloud_xyz);
BoxQ box = pointProcessorI->MOBoundingBox(cloud_xyz);
renderBox(viewer,box,clusterId);
++clusterId;
}
}
//setAngle: SWITCH CAMERA ANGLE {XY, TopDown, Side, FPS}
void initCamera(CameraAngle setAngle, pcl::visualization::PCLVisualizer::Ptr& viewer)
{
viewer->setBackgroundColor (0, 0, 0);
// set camera position and angle
viewer->initCameraParameters();
// distance away in meters
int distance = 16;
switch(setAngle)
{
case XY : viewer->setCameraPosition(-distance, -distance, distance, 1, 1, 0); break;
case TopDown : viewer->setCameraPosition(0, 0, distance, 1, 0, 1); break;
case Side : viewer->setCameraPosition(0, -distance, 0, 0, 0, 1); break;
case FPS : viewer->setCameraPosition(-10, 0, 0, 0, 0, 1);
}
if(setAngle!=FPS)
viewer->addCoordinateSystem (1.0);
}
int main (int argc, char** argv)
{
std::cout << "starting enviroment" << std::endl;
pcl::visualization::PCLVisualizer::Ptr viewer (new pcl::visualization::PCLVisualizer ("3D Viewer"));
CameraAngle setAngle = XY;
initCamera(setAngle, viewer);
ProcessPointClouds<pcl::PointXYZI>* pointProcessorI = new ProcessPointClouds<pcl::PointXYZI>();
std::vector<boost::filesystem::path> stream = pointProcessorI->streamPcd("../src/sensors/data/pcd/data_1");
auto streamIterator = stream.begin();
pcl::PointCloud<pcl::PointXYZI>::Ptr inputCloudI;
//cityBlock(viewer);
while (!viewer->wasStopped ())
{
// Clear viewer
viewer->removeAllPointClouds();
viewer->removeAllShapes();
// Load pcd and run obstacle detection process
inputCloudI = pointProcessorI->loadPcd((*streamIterator).string());
cityBlock_fromScratch(viewer, pointProcessorI, inputCloudI);
streamIterator++;
if(streamIterator == stream.end())
streamIterator = stream.begin();
viewer->spinOnce ();
}
}
|
f062158cf74eefb8c39fbd9c1b37c098d19e0176
|
ebeade2609e56126da910684fd41085b85f981d3
|
/Src/GaussianBlurConstantBuffer.cpp
|
4ef6842398382fde138f2d77882ec9df5fbc8648
|
[] |
no_license
|
patrickjamescarr/DirectX_Engine
|
3364e3d68dffd9365cc781d1246038f242ad4044
|
bf98fcb8708658e462eaa00e8e5f5c03a035cf49
|
refs/heads/main
| 2023-08-15T17:52:27.860256
| 2021-10-08T12:18:11
| 2021-10-08T12:18:11
| 345,572,176
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 715
|
cpp
|
GaussianBlurConstantBuffer.cpp
|
#include "pch.h"
#include "GaussianBlurConstantBuffer.h"
GaussianBlurConstantBuffer::GaussianBlurConstantBuffer(DX::DeviceResources & deviceResources, BlurBufferType blurParams)
: m_blurParams(blurParams), m_deviceResources(deviceResources)
{
if (!m_blurBuffer)
{
m_blurBuffer = std::make_unique<PixelConstantBuffer<BlurBufferType>>(deviceResources);
}
}
void GaussianBlurConstantBuffer::Bind(DX::DeviceResources & deviceResources) noexcept
{
m_blurBuffer->Update(deviceResources, m_blurParams);
m_blurBuffer->Bind(deviceResources);
}
void GaussianBlurConstantBuffer::Set()
{
m_blurBuffer->Update(m_deviceResources, m_blurParams);
m_blurBuffer->Bind(m_deviceResources);
}
|
d6c2befcc84a7770a27d015a39c5e2c0cf12c6d5
|
01137c4b6adf4b9249c3a07b0c26aebd1dba17dc
|
/searching/main.cpp
|
c2ecffdbb852b2170ac305917ad645a9893a2e62
|
[] |
no_license
|
electronicblocks/soucecodes1
|
d52991c0ad86d824674d3aadf62e69e5cdbfd839
|
45bb542f42192170a7f270bd3edec7fe3bc1132f
|
refs/heads/master
| 2021-07-15T02:35:43.418331
| 2017-10-14T02:40:02
| 2017-10-14T02:40:02
| 106,891,645
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,134
|
cpp
|
main.cpp
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.cpp
* Author: alphacoder
*
* Created on 12 October, 2017, 7:18 AM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
int binarysearch(int a[],int start,int end,int srchelement);
int main() {
int n; int a[100];
int p;
cout<<"enter no of the element ";
cin>>n;
for(int i=0;i<n;i++)
{
cout<<"entr the "<<i<<"th element\n";
cin>>a[i];
}
cout<<"element to be search0";
cin>>p;
int c=binarysearch(a,0,n,p);
if(c==-1)
{cout<<"not found";}
else
{cout<<c;}
return 0;
}
int binarysearch(int a[],int start,int end,int srchelement)
{int mid=(start+end)/2;
if(end==start+1)
{if(a[start]==srchelement){return a[start];}
else{
return -1;}}
if(a[mid]==srchelement)
{return a[mid];}
else {if(a[mid]<srchelement)
{binarysearch(a,mid,end,srchelement);
}else{binarysearch(a,start,mid,srchelement);}
}
}
|
b94c0e278853c651b37ee522eccb68c30e8dd316
|
5235ae66b46cfd628a0988ea10730b33c81c2e91
|
/static_cast_object/Main.cpp
|
682aa0a2eda108b514dd5be835a216afea63c65b
|
[] |
no_license
|
anstn1993/c-_practice
|
c761234303a439da3df8839abda1133c8afed5c4
|
d2f4a7c77778fd9a4415eaa239eac8e55f77f176
|
refs/heads/master
| 2022-03-18T21:40:50.599718
| 2019-12-12T09:34:02
| 2019-12-12T09:34:02
| 223,435,607
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 558
|
cpp
|
Main.cpp
|
#include <iostream>
#include "Animal.h"
#include "Cat.h"
#include "Dog.h"
using namespace std;
using namespace samples;
int main()
{
Animal* pet1 = new Cat(2, "Nyaong");
Animal* pet2 = new Dog(9, "Nuri");
Cat* cat = static_cast<Cat*>(pet1);
Dog* dog1 = static_cast<Dog*>(pet2);
Dog* dog2 = static_cast<Dog*>(pet1);
cout << "cat's name :" << cat->GetName() << endl;
cout << "dog1's address :" << dog1->GetAddress() << endl;
//print cat's name
cout << "dog2's address :" << dog2->GetAddress() << endl;
delete pet1;
delete pet2;
return 0;
}
|
4d81de2930ed6136a2b61ac6f1a87238cc3b7995
|
9732ad51b09956a1770ba827d32e35c03e9deade
|
/305_Lab8_Q5/test.cpp
|
a8463aec7c70125bfcc0f5d48a7cc1a9be5a34f8
|
[] |
no_license
|
shihabawal/JavaLabs
|
dd1ae3f04cfdaaf4405bf92cc1cb2992e8475a89
|
d09ce12db46860d3a48d306d76fa303d8017dce6
|
refs/heads/master
| 2021-01-22T17:52:49.916508
| 2017-03-15T07:44:58
| 2017-03-15T07:44:58
| 85,040,339
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,049
|
cpp
|
test.cpp
|
#include <iostream>
#include <cmath>
using namespace std;
bool binarySearchHelper(int *arr, int l, int target, int f = 0) {
int mid = (f + l) / 2;
if (arr[mid] == target)
return true;
else if (f > l)
return false;
else {
if (target > arr[mid])
return binarySearchHelper(arr, l, target, mid + 1);
else
return binarySearchHelper(arr, mid - 1, target, f);
}
}
bool binarySearch(int *arr, int size, int target) {
return binarySearchHelper(arr, size - 1, target);
}
bool search(int *arr, int size, int target, int i = 0) {
if (arr[i] == target)
return true;
else if (i >= size)
return false;
else
return search(arr, size, target, i + 1);
}
int main() {
int arr[5], num;
cout << "Enter 5 array elements: ";
for (int i = 0; i < 5; i++)
cin >> arr[i];
cout << "Enter target to search: ";
cin >> num;
(binarySearch(arr, 5, num)) ? cout << "Found " : cout << "Not Found ";
cout << "with binary search\n";
(search(arr, 5, num)) ? cout << "Found " : cout << "Not Found ";
cout << "with normal search\n";
return 0;
}
|
68ae6595c241016608cfd5ebf73abd5f22234da4
|
9c6cf683c9da8e2b4bffea4aec4201c931b123fc
|
/WinOGL/Ten.h
|
fa9b5af68001ac9e9bfcfb04a9c0b41a2ed3c720
|
[] |
no_license
|
jun-vcl/WinOGLGit-master
|
3c5759914598f97299a657ade979d7d6309fc1b9
|
393a7cac61e102f15466a9cf3a5542a014d9a089
|
refs/heads/master
| 2023-08-29T11:03:36.784486
| 2021-10-28T09:32:03
| 2021-10-28T09:32:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 283
|
h
|
Ten.h
|
#pragma once
class CTen
{
public:
CTen();
~CTen();
CTen(float x, float y);
private:
float x;
float y;
CTen *next_ten = NULL;
public:
void SetNextTen(CTen *CTen);
CTen *GetNextTen();
float GetTenX();
float GetTenY();
void SetTenXY(float x, float y);
void FreeTen();
};
|
e6e9ca929faeafa61e45d846bf4a8a4efbf4f4b8
|
66e4cf01bcaf0c302bf8de0534dd3328642f55d9
|
/src/ClassicalLayout.h
|
7f121de3264b71c1ec8ee1226bd446a8c02024b6
|
[
"MIT"
] |
permissive
|
StoneAndFish/GraduationProject
|
f9c115390919d5422d0ab95e83762452c30febd1
|
89cc28487cb79e449f37d21d430c10c07a9f06a9
|
refs/heads/master
| 2021-06-22T03:16:10.862757
| 2017-08-16T04:49:43
| 2017-08-16T04:49:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,531
|
h
|
ClassicalLayout.h
|
#pragma once
#include "Layout.h"
#include "Results.h"
#include "ofImage.h"
#include "octree.h"
#define MAX_COLOR 1024
class ClassicalLayout : public Layout {
public :
ClassicalLayout();
virtual ~ClassicalLayout();
virtual void BeginLayout(float width, float height, BaseMaterial *m, Results *r);
protected:
void ImageComposition(float width, float height);
void Typography(float width, float height, IplImage *sMap);
void InitTemplate(float w, float h);
float MinimizeEnergy(IplImage *sMap);
float MinimizeEnergy_Masthead(TemplateRegion *region, IplImage *sMap, float freeSpace);
float MinimizeEnergy_Coverlines(TemplateRegion *region, IplImage *sMap, float freeSpace);
float MinimizeEnergy_Byline(TemplateRegion *region, IplImage *sMap, float freeSpace);
float ComputeInstrutionEnergy(TemplateRegion *region, IplImage *sMap);
float ComputeUtilizationEnergy(TemplateRegion *region, IplImage *sMap);
void ColorDesign(IplImage *oriImage);
void ColorDesignByImg(IplImage *oriImage);
ofColor GetMainColorAvg(IplImage *oriImage);
ofColor GetMainColorOcTree(IplImage *oriImage);
void ColorDesignByRegion(IplImage *oriImage);
ofColor GetMainColorOcTree(int pixCount, uchar* uImage, int index = 0);
void Split(const string &input, vector<string> &output, const string &c);
string WordMerge(const vector<string> word, int start, int end);
private:
BaseMaterial* material;
Results* results;
ofxCvColorImage tempOri;
ofxCvGrayscaleImage tempSMap;
IplImage *ori;
IplImage *smap;
DemoTemplate* demoTemp;
};
|
da97bb652b39bbb0e9c12a3fda8960e7a42f727f
|
6e803f33939a3257d6ab4f4ff4f67199669767f1
|
/Tutorial/ResourceFontTexture.cpp
|
3cf35d3136b8dd74f4f25bff86e5c571a774ca92
|
[] |
no_license
|
Eresor/Cziczaka
|
ffe52d1add43f37f8d3e7c8f78e54fe527d1da98
|
0242920337d53c92c365755bce5b125f6f7a36d4
|
refs/heads/master
| 2021-01-17T12:57:05.408453
| 2016-08-02T11:39:26
| 2016-08-02T11:39:26
| 57,378,600
| 0
| 1
| null | 2016-07-06T12:41:26
| 2016-04-29T11:09:19
|
C
|
UTF-8
|
C++
| false
| false
| 1,530
|
cpp
|
ResourceFontTexture.cpp
|
#include "ResourceFontTexture.h"
ResourceFontTexture::ResourceFontTexture(const std::string& t, ResourceFont font, SDL_Renderer * renderer, Color color)
:text(t)
{
LoadResource(t, font, renderer, color);
}
bool ResourceFontTexture::LoadResource(const std::string& text, ResourceFont font, SDL_Renderer * renderer, Color color)
{
if (initialized)
{
DEBUG_LOG("Trying to load resource in already initialized instantion.");
return false;
}
SDL_Surface * surface = TTF_RenderText_Solid(font.getFont(), text.c_str(), {color.r,color.g,color.b,color.a});
if (surface == nullptr)
{
DEBUG_LOG("Error loading surface from font.");
return false;
}
texture.reset(SDL_CreateTextureFromSurface(renderer, surface), SDL_DestroyTexture);
SDL_FreeSurface(surface);
if (texture == nullptr)
{
DEBUG_LOG("Failed to create texture from surface");
return false;
}
initialized = true;
return true;
}
ResourceFontTexture::ResourceFontTexture(const ResourceFontTexture& other)
{
texture = other.texture;
text = other.text;
initialized = other.initialized;
}
ResourceFontTexture::ResourceFontTexture(ResourceFontTexture && other)
{
ResourceFontTexture::swap(*this, other);
}
ResourceFontTexture& ResourceFontTexture::operator=(const ResourceFontTexture other)
{
ResourceFontTexture::swap(*this, other);
return *this;
}
ResourceFontTexture::~ResourceFontTexture()
{
}
void ResourceFontTexture::swap(ResourceFontTexture r1, ResourceFontTexture r2)
{
ResourceTexture::swap(r1, r2);
std::swap(r1.text, r2.text);
}
|
53f991ead1f7e816b30d4630997094b121f50072
|
46f60616e995cc87a08cef9122f89ed70f4fcff2
|
/shadFails/FixedSet.cpp
|
f6253ac3255bd74f74a78deb32c5698fcde3f4d3
|
[] |
no_license
|
UPML/Fails
|
2ed42f813ac259c413af222c6d32541ca906f4cd
|
01175ec338a52b90464f57cb28b920fb2739a24b
|
refs/heads/master
| 2021-05-07T13:56:41.881340
| 2017-11-09T10:10:22
| 2017-11-09T10:10:22
| 109,727,973
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 6,585
|
cpp
|
FixedSet.cpp
|
#include <iostream>
#include <vector>
#include <cassert>
#include <cmath>
#include <random>
template<typename T>
class Optional {
public:
Optional &operator=(const T &value);
bool IsAssigned() const;
T GetValue() const;
private:
bool assigned_ = false;
T value_;
};
std::vector<int> ReadVector(std::istream &in);
struct Hash {
explicit Hash(std::mt19937 &generator) : Hash(generator(), generator()) {}
explicit Hash(size_t multiplier_value = 0, size_t adder_value = 0);
size_t operator()(int value) const;
private:
size_t multiplier_value;
size_t adder_valuer;
static const size_t kPrimeNumber = 2000000011;
};
template<typename T, typename Hash>
class FixedSet {
public:
FixedSet() : inner_data_size_(0), is_initialized_(false) {}
void Initialize(std::vector<T> data);
bool Contains(const T &value) const;
protected:
size_t CalcInnerPosition(const T &value) const;
size_t inner_data_size_;
std::vector<size_t> CalcDistribution(const std::vector<T> &data);
private:
virtual void InitBufferAndSize(size_t size) = 0;
virtual bool TryFillingHashTable(const std::vector<T> &data) = 0;
virtual bool HasKey(const T &value) const = 0;
bool is_initialized_;
Hash hash_;
};
template<typename T, typename Hash>
class PerfectHashFirstLevelHashTable : public FixedSet<T, Hash> {
private:
std::vector<Optional<T>> inner_data_;
void InitBufferAndSize(size_t size) final;
bool HasKey(const T &value) const final;
bool TryFillingHashTable(const std::vector<T> &data) final;
};
template<typename T, typename Hash>
class PerfectHashTable : public FixedSet<T, Hash> {
private:
std::vector<PerfectHashFirstLevelHashTable<T, Hash>> hashTable_;
void InitBufferAndSize(size_t size) final;
bool HasKey(const T &value) const final;
bool TryFillingHashTable(const std::vector<T> &data) final;
size_t kMemoryRepletionRatio = 4;
};
void OperateQueries(const std::vector<int> &queries,
const PerfectHashTable<int, Hash> &static_hash_table);
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
auto data = ReadVector(std::cin);
auto queries = ReadVector(std::cin);
PerfectHashTable<int, Hash> static_hash_table;
static_hash_table.Initialize(data);
OperateQueries(queries, static_hash_table);
return 0;
}
template<typename T>
Optional<T> &Optional<T>::operator=(const T &value) {
value_ = value;
assigned_ = true;
return *this;
}
template<typename T>
bool Optional<T>::IsAssigned() const {
return assigned_;
}
template<typename T>
T Optional<T>::GetValue() const {
assert(assigned_);
return value_;
}
Hash::Hash(size_t multiplier_value, size_t adder_value) :
multiplier_value(multiplier_value),
adder_valuer(adder_value) {}
size_t Hash::operator()(int value) const {
return (value * multiplier_value + adder_valuer) % kPrimeNumber;
}
std::vector<int> ReadVector(std::istream &in) {
size_t size;
in >> size;
std::vector<int> data(size);
for (size_t i = 0; i < size; ++i) {
in >> data[i];
}
return data;
}
void OperateQueries(const std::vector<int> &queries,
const PerfectHashTable<int, Hash> &static_hash_table) {
for (auto value: queries) {
if (static_hash_table.Contains(value)) {
std::cout << "Yes\n";
} else {
std::cout << "No\n";
}
}
}
template<typename T, typename Hash>
void FixedSet<T, Hash>::Initialize(std::vector<T> data) {
InitBufferAndSize(data.size());
std::mt19937 random_generator;
hash_ = Hash(random_generator);
while (!TryFillingHashTable(data)) {
hash_ = Hash(random_generator);
}
is_initialized_ = true;
}
template<typename T, typename Hash>
bool FixedSet<T, Hash>::Contains(const T &value) const {
assert(is_initialized_);
if (inner_data_size_ == 0) {
return false;
}
return HasKey(value);
}
template<typename T, typename Hash>
size_t FixedSet<T, Hash>::CalcInnerPosition(const T &value) const {
return hash_(value) % inner_data_size_;
}
template<typename T, typename Hash>
std::vector<size_t> FixedSet<T, Hash>::CalcDistribution(const std::vector<T> &data) {
std::vector<size_t> baskets(inner_data_size_, 0);
for (auto value : data) {
++baskets[CalcInnerPosition(value)];
}
return baskets;
}
template<typename T, typename Hash>
void PerfectHashFirstLevelHashTable<T, Hash>::InitBufferAndSize(size_t size) {
this->inner_data_size_ = size * size;
inner_data_.resize(this->inner_data_size_);
}
template<typename T, typename Hash>
bool PerfectHashFirstLevelHashTable<T, Hash>::HasKey(const T &value) const {
auto optional_value = inner_data_[this->CalcInnerPosition(value)];
return optional_value.IsAssigned() && optional_value.GetValue() == value;
}
template<typename T, typename Hash>
bool PerfectHashFirstLevelHashTable<T, Hash>::TryFillingHashTable(
const std::vector<T> &data) {
auto distribution = this->CalcDistribution(data);
for (auto num : distribution) {
if (num > 1) {
return false;
}
}
for (auto value: data) {
inner_data_[this->CalcInnerPosition(value)] = value;
}
return true;
}
template<typename T, typename Hash>
void PerfectHashTable<T, Hash>::InitBufferAndSize(size_t size) {
this->inner_data_size_ = size;
hashTable_.resize(this->inner_data_size_);
}
template<typename T, typename Hash>
bool PerfectHashTable<T, Hash>::HasKey(const T &value) const {
return hashTable_[this->CalcInnerPosition(value)].Contains(value);
}
template<typename T, typename Hash>
bool PerfectHashTable<T, Hash>::TryFillingHashTable(const std::vector<T> &data) {
auto distribution = this->CalcDistribution(data);
size_t sum_size = 0;
for (auto &number: distribution) {
sum_size += number * number;
}
if (sum_size > kMemoryRepletionRatio * hashTable_.size()) {
return false;
} else {
std::vector<std::vector<T>> baskets(hashTable_.size());
assert(distribution.size() == hashTable_.size());
for (size_t i = 0; i < hashTable_.size(); ++i) {
baskets[i].reserve(distribution[i]);
}
for (auto value : data) {
baskets[this->CalcInnerPosition(value)].push_back(value);
}
for (size_t i = 0; i < hashTable_.size(); ++i) {
hashTable_[i].Initialize(baskets[i]);
}
return true;
}
}
|
df91a78cc826c4cf3bbc91483dc70ea3ce724eb4
|
9d1e27d4b8a144a600ae237c75497eb519732c24
|
/FF3_Monster_Sim/main.cpp
|
6e75e8f730514784da32b67e72259a1d83114cce
|
[] |
no_license
|
LeeCombs/FF3_Monster_Sim
|
a07c245c47d7af9be9261127594f0a19dfa1a25b
|
d5b7e7ff57182a601c4e3fd898beecfb7e9a786d
|
refs/heads/master
| 2021-01-25T10:39:29.933956
| 2018-03-28T17:33:46
| 2018-03-28T17:33:46
| 123,367,599
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,109
|
cpp
|
main.cpp
|
#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>
#include "Monster.h"
#include "Spell.h"
#include "SpellManager.h"
using namespace std;
using namespace ff3j;
int WinMain()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
Spell spell;
spell.setLevel(1);
Monster mon;
SpellResult res = castSpell(spell, mon, mon);
// string s = copy
// string &s = reference
// const string &s = unchangable reference
for (const string &s : res.results) {
string str = s;
}
// Draw
sf::CircleShape monsterShape(75);
monsterShape.setFillColor(sf::Color::Red);
window.clear();
window.draw(shape);
window.draw(monsterShape);
window.display();
}
return 0;
}
|
6a42dbfcb62d13844fc8c071209818f191ef034a
|
ef3c529e0110134027462d78902263b306c95838
|
/TwofoldStarter/src/checkers.cpp
|
ccff965d55a44dabc7cd730822a6b7d6fcd91ce5
|
[] |
no_license
|
aviidlee/twofold_oberwolfach
|
f41fdd7f89037b9954da082507c2086f43215d3f
|
74cc114283377f1037f98184647b127e4c91f69b
|
refs/heads/master
| 2021-01-10T14:01:42.566727
| 2015-11-12T13:39:31
| 2015-11-12T13:39:31
| 45,023,258
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 2,234
|
cpp
|
checkers.cpp
|
/*
* checkers.cpp
*
* Created on: 14 Aug 2015
* Author: alexi_000
*/
#include "checkers.h"
void zero_initialise(int n, int* array) {
for(int i = 0; i < n; i++) {
array[i] = 0;
}
return;
}
/**
* Return true iff there are no repeated vertices (and thus every vertex
* occurs exactly once)
*/
bool check_repeat(int n, int numCycles, int* factor, Vertex** cycleList) {
// vertices[i] = number of times vertex i occurs.
int vertices[n];
zero_initialise(n, vertices);
for(int i = 0; i < numCycles; i++) {
Vertex* cycle = cycleList[i];
int cycleLen = factor[i];
for(int j = 0; j < cycleLen; j++) {
vertices[cycle[j].vertex]++;
}
}
for(int i = 0; i < n; i++) {
if(vertices[i] != 1) {
return false;
}
}
return true;
}
/**
* Checks that every difference in Z_{n-1}\{0} occurs exactly twice.
* NOTE: cycle lengths must be >= 3
*
* @param n - the order of the OP
* @param numCycles - the number of cycles in the factor
* @param factor - the 2-factor, an array whose entries are cycle lengths.
* @param cycleList - the supposed twofold 2-starter, consisting of an aray of
* array of vertices, where the array of vertices represents a cycle.
*
* REMEMBER TO IGNORE N BECAUSE IT'S INFINITY.
*/
bool check_differences(int n, int numCycles, int* factor, Vertex** cycleList) {
int N = n-1;
int diffList[N];
zero_initialise(N, diffList);
//cout << "We are in the group Z_" << N << endl;
//cout << "Our infinity element is thus " << N << endl;
for(int i = 0; i < numCycles; i++) {
Vertex* cycle = cycleList[i];
int cycleLen = factor[i];
for(int j = 0; j < cycleLen; j++) {
int v1 = cycle[j].vertex;
int v2 = cycle[(j+1) % cycleLen].vertex;
if(v1 == N || v2 == N) {
continue;
}
int diff1 = v1 > v2 ? v1-v2 : v2-v1;
diffList[diff1]++;
diffList[N - diff1]++;
}
}
// cout << "Differences calculated by check_differences: " << str_int_array(N, diffList) << endl;
for(int i = 1; i < N; i++) {
if(diffList[i] != 2) {
return false;
}
}
return true;
}
bool verify(int n, int numCycles, int* factor, Vertex** cycleList) {
return check_repeat(n, numCycles, factor, cycleList) &&
check_differences(n, numCycles, factor, cycleList);
}
|
278cd72489260bc2519084dc9ca98e3db1cffbc7
|
12a68f4c08a5f31d5a3fe81dd80f5dae49939ca6
|
/vjudge/scdp/E.cpp
|
60071a847a457020f0754d3b6ae3e56a2bf372e0
|
[] |
no_license
|
xLLLxLLLx/LAumcakzying
|
b3ba174c50de40614dbec505f13c266f2842dd2c
|
fa698bc6f4f9af5b98c884a6b9ef0922d49e699f
|
refs/heads/master
| 2020-03-22T23:13:46.313799
| 2018-07-30T13:21:27
| 2018-07-30T13:21:27
| 140,797,191
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 870
|
cpp
|
E.cpp
|
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define LL long long
using namespace std;
const int N=22,M=110;
const LL INF=7e18;
LL dp[1<<N];
int n,m;
LL b;
struct qx{
LL pr;
LL num;
LL ct,k;
}a[M];
bool comp(qx xx,qx yy){
return xx.k<yy.k;
}
int main(){
scanf("%d%d%lld",&n,&m,&b);
for(int i=0;i<n;++i){
scanf("%lld%lld%lld",&a[i].ct,&a[i].k,&a[i].num);
for(int j=0;j<a[i].num;++j){
int x;scanf("%d",&x);
a[i].pr|=(1<<(x-1));
}
}
sort(a,a+n,comp);
memset(dp,-1,sizeof(dp));
dp[0]=0;
LL minn=INF,tot=(1<<m)-1;
for(int i=0;i<n;++i){
for(int j=0;j<=tot;++j){
if(dp[j]==-1) continue;
LL w=a[i].pr|(j);
if(dp[w]==-1) dp[w]=dp[j]+a[i].ct;
else dp[w]=min(dp[w],dp[j]+a[i].ct);
}
if(dp[tot]!=-1) minn=min(minn,dp[tot]+a[i].k*b);
}
if(minn==INF) printf("-1\n");
else printf("%lld\n",minn);
return 0;
}
|
fe223674db9b7b430dba5397fe0b2145b93b0117
|
137c22b59942cba8393467ebc6f5843bcbbe3537
|
/timeoffset.h
|
37ec8e5461c8ba5843ff3cf31f1ef453ab576d73
|
[] |
no_license
|
SergeyStaroletov/NaiveHTM
|
bfa258edd3635bf3f89c2ea5ca0d3430a913e168
|
3c1c39324db452da6f8e091c8244d118c2ad3a76
|
refs/heads/main
| 2023-05-27T21:13:25.937891
| 2021-06-08T06:43:25
| 2021-06-08T06:43:25
| 358,036,968
| 0
| 1
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 567
|
h
|
timeoffset.h
|
#ifndef __TIMEOFFSET_H
#define __TIMEOFFSET_H
#include "brain.h"
#include "stdlibs.h"
namespace brain {
class TimeOffset : public IOffset {
private:
float offset_;
float scale_;
public:
TimeOffset();
PropertyID::Enum getPropertyId();
IOffsetPtr getInverted();
void SetData(float offset, float scale);
float getOffset();
float getScale();
void makeAverage(IOffsetPtr offset, float weight);
float getDelta(IOffsetPtr offset);
void outputToStream(std::ostream &out);
};
} // namespace brain
#endif // TIMEOFFSET_H
|
ad2e51fd6c9a56a4aad4b085a75c124457aef770
|
cbd0d93632b38f6ed242766bb56dbc0b29f3f0a2
|
/src/IStrategizer/Expression.cpp
|
6d32ceb9ce258f687e4e2d1e5bd72eeb2b0ffab6
|
[
"Apache-2.0"
] |
permissive
|
RtsAiResearch/IStrategizer
|
97b60c6d12d3cd71dbd952e45b37746fee8b61a6
|
2005060d40190041e4d541e23b6148336241d690
|
refs/heads/master
| 2020-05-17T08:24:29.666200
| 2017-03-06T06:42:53
| 2017-03-06T06:42:53
| 3,828,751
| 15
| 2
| null | 2017-03-06T06:42:53
| 2012-03-26T01:31:58
|
C++
|
UTF-8
|
C++
| false
| false
| 686
|
cpp
|
Expression.cpp
|
#include "Expression.h"
#include "ObjectFactory.h"
using namespace IStrategizer;
//----------------------------------------------------------------------------------------------
IClonable* Expression::Clone()
{
Expression* clone = static_cast<Expression*>(g_ObjectFactory.Create(GetObjectLayout().TypeName()));
Copy(clone);
return clone;
}
//----------------------------------------------------------------------------------------------
void Expression::Copy(IClonable* p_dest)
{
Expression* m_dest = static_cast<Expression*>(p_dest);
m_dest->_expressionType = _expressionType;
m_dest->_isEvaluated = _isEvaluated;
m_dest->_isSatisfied = _isSatisfied;
}
|
afee71c02fb8cf0574b88f63f459fdef4880482a
|
ac507e24073717f0f2f43480101be5db0213c2c4
|
/pwiz/analysis/frequency/PeakDetectorNaive.hpp
|
eaa94f958a1b8cd7f338aa83ace6b0b323124861
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] |
permissive
|
ProteoWizard/pwiz
|
7adbd5a276b49d5f0271eb8cfddbd6d21ee31318
|
f708f62d098c33ef60a76d92b038fde74361570a
|
refs/heads/master
| 2023-08-27T20:42:37.708268
| 2023-08-25T18:30:50
| 2023-08-25T18:30:50
| 124,952,577
| 185
| 92
|
Apache-2.0
| 2023-09-14T20:39:46
| 2018-03-12T21:16:01
|
C#
|
UTF-8
|
C++
| false
| false
| 1,953
|
hpp
|
PeakDetectorNaive.hpp
|
//
// $Id$
//
//
// Original author: Darren Kessner <darren@proteowizard.org>
//
// Copyright 2006 Louis Warschaw Prostate Cancer Center
// Cedars Sinai Medical Center, Los Angeles, California 90048
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef _PEAKDETECTORNAIVE_HPP_
#define _PEAKDETECTORNAIVE_HPP_
#include "pwiz/utility/misc/Export.hpp"
#include "PeakDetector.hpp"
#include <memory>
namespace pwiz {
namespace frequency {
/// Naive implementation of the PeakDetector interface.
///
/// Reports peaks where:
/// -# magnitude > noise*noiseFactor
/// -# magnitude is increasing on [center-detectionRadius, center]
/// -# magnitude is decreasing on [center, center+detectionRadius]
///
/// All peaks are reported as charge==1
class PWIZ_API_DECL PeakDetectorNaive : public PeakDetector
{
public:
/// create an instance.
static std::auto_ptr<PeakDetectorNaive> create(double noiseFactor = 5,
unsigned int detectionRadius = 2);
virtual double noiseFactor() const = 0;
virtual unsigned int detectionRadius() const = 0;
/// \name PeakDetector interface
//@{
virtual void findPeaks(const pwiz::data::FrequencyData& fd,
pwiz::data::peakdata::Scan& result) const = 0;
virtual ~PeakDetectorNaive(){}
//@}
};
} // namespace frequency
} // namespace pwiz
#endif // _PEAKDETECTORNAIVE_HPP_
|
cd46bcea0f3c310345de14051d8738bfe9bc26d8
|
3c15c28e5f0ab855ec63de9992a9151725e11a41
|
/Arrays/Calculate factorial of large numbers !! (Using Arrays).cpp
|
6c4b0ec27ef82a1bd046c8d14b1febe8e1d56e30
|
[] |
no_license
|
vidhichadha2507/PenCode
|
e8ac87d073804eb0f65621781c047524d80e9d21
|
0e493a37a6cf863dc6de59cccf18a51924dc0e5d
|
refs/heads/main
| 2023-07-30T14:00:21.256157
| 2021-09-30T19:12:54
| 2021-09-30T19:12:54
| 412,207,591
| 0
| 0
| null | 2021-09-30T19:54:25
| 2021-09-30T19:54:24
| null |
UTF-8
|
C++
| false
| false
| 913
|
cpp
|
Calculate factorial of large numbers !! (Using Arrays).cpp
|
#include <bits/stdc++.h>
using namespace std;
#define max 10000
int main()
{
int n, c, j, k, x, i;
int a[max];
cout << "Enter the number: ";
cin >> n;
j = 0; // j will be pointing to new index created to stored carry
a[0] = 1;
for (i = 2; i <= n; i++)
{
c = 0; //carry when each number of array is multiplied by i
//(i is a part of numbers that come in factorial)
//every number will be multiplied to array from starting index.
for (k = 0; k <= j; k++)
{
x = (a[k] * i) + c;
a[k] = x % 10;
c = x / 10;
}
//In case end carry is of more than one digit...
//digits are stored in reverse order..
while (c != 0)
{
a[++j] = c % 10;
c /= 10;
}
}
//print array in reverse order..
for (i = j; i >= 0; i--)
cout << a[i];
}
|
0e65951f2a1f4c22017d2c0acd54dfab1bc81f72
|
0f5565700d4be50bbafa12f57b82e673044b6d40
|
/015_3Sum.cpp
|
2e6d6919ca80a4378fece41eabd8abcfce2bc4b1
|
[] |
no_license
|
liqiang311/leetcode
|
791fa037cbfa442b4c858c34b166abda6fee4463
|
f4931e529694b07b9a45426a03f91fad600d5e07
|
refs/heads/master
| 2021-01-01T18:20:17.332079
| 2017-08-16T15:52:42
| 2017-08-16T15:52:42
| 98,309,760
| 0
| 0
| null | null | null | null |
WINDOWS-1252
|
C++
| false
| false
| 2,353
|
cpp
|
015_3Sum.cpp
|
/*
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0?
Find all unique triplets in the array which gives the sum of zero.
Note:
Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ¡Ü b ¡Ü c)
The solution set must not contain duplicate triplets.
For example, given array S = {-1 0 1 2 -1 -4},
A solution set is:
(-1, 0, 1)
(-1, -1, 2)
*/
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <ctime>
#include <algorithm>
//#include <functional>
using namespace std;
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
sort(nums.begin(),nums.end(),less<int>());
return KSum(&nums[0],nums.size(),0,3);
}
vector<vector<int>> KSum(int nums[], int size, int target, int k) {
vector<vector<int>> ret;
if (k < 2)
return ret;
if (k == 2)
{
int start = 0;
int end = size-1;
int preStart = INT_MAX, preEnd = INT_MAX;
while (start < end)
{
if (nums[start] + nums[end] == target)
{
if (preStart != nums[start] || preEnd != nums[end])
{
vector<int> v;
v.push_back(nums[start]);
v.push_back(nums[end]);
ret.push_back(v);
preStart = nums[start];
preEnd = nums[end];
}
start ++;
end --;
}
else if (nums[start] + nums[end] < target)
start ++;
else
end --;
}
return ret;
}
for (int i=0; i<size-2; i++)
{
if (i != 0 && nums[i] == nums[i-1])
continue;
vector<vector<int>> ret1 = KSum(nums+i+1,size-i-1,target-nums[i], k-1);
for (int j=0; j<ret1.size(); j++)
{
ret1[j].insert(ret1[j].begin(),nums[i]);
ret.push_back(ret1[j]);
}
}
return ret;
}
};
void main()
{
Solution s;
clock_t t1,t2;
int A[] = {7,-1,14,-12,-8,7,2,-15,8,8,-8,-14,-4,-5,7,9,11,-4,-15,-6,1,-14,4,3,10,-5,2,1,6,11,2,-2,-5,-7,-6,2,-15,11,-6,8,-4,2,1,-1,4,-6,-15,1,5,-15,10,14,9,-8,-6,4,-6,11,12,-15,7,-1,-9,9,-1,0,-4,-1,-12,-2,14,-9,7,0,-3,-4,1,-2,12,14,-10,0,5,14,-1,14,3,8,10,-8,8,-5,-2,6,-11,12,13,-7,-12,8,6,-13,14,-2,-5,-11,1,3,-6};
vector<int> AA(A, A+sizeof(A)/sizeof(int));
t1 = clock();
vector<vector<int>> ret = s.threeSum(AA);
for (int i=0; i<ret.size(); i++)
{
for (int j=0; j<ret[i].size(); j++)
cout<<ret[i][j]<<" ";
cout<<endl;
}
t2 = clock();
cout<<"Time Comsume: "<<t2-t1<<" ms"<<endl;
}
|
07f86e056d2527dbeceecb4ea141e2832a169c0d
|
b24f4a308a8e0e88a2ed72bfbaaad1a9418b3fa6
|
/src/problem_7.cpp
|
8da3a8442773a4a7bd06121f15f139c323185ebb
|
[] |
no_license
|
wichtounet/spirit_x3_tests
|
79d351bda48cfce452c968389de250d7f07274cd
|
0bfb7d8ffc0074d36887d7317c311be10bfb0906
|
refs/heads/master
| 2021-01-21T14:01:39.930594
| 2016-05-01T09:24:49
| 2016-05-01T09:24:49
| 18,881,037
| 1
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,679
|
cpp
|
problem_7.cpp
|
#include <string>
#include <boost/spirit/home/x3.hpp>
#include <boost/spirit/home/x3/support/ast/variant.hpp>
#include <boost/spirit/include/classic_position_iterator.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/fusion/adapted/boost_tuple.hpp>
namespace x3 = boost::spirit::x3;
typedef std::string::iterator base_iterator_type;
typedef boost::spirit::classic::position_iterator2<base_iterator_type> pos_iterator_type;
namespace x3_ast {
struct expression;
typedef x3::variant<char, x3::forward_ast<expression>, int> value;
struct expression {
value a ;
int b;
value c;
};
} //end of x3_ast namespace
BOOST_FUSION_ADAPT_STRUCT(
x3_ast::expression,
(x3_ast::value, a)
(int, b)
(x3_ast::value, c)
)
namespace x3_grammar {
struct expression_class {};
struct expression_2_class {};
x3::rule<expression_class, x3_ast::expression> const expression("expression");
x3::rule<expression_2_class, x3_ast::expression> const expression_2("expression_2");
auto const skipper = x3::ascii::space;
auto const expression_def =
x3::int_ >> x3::int_ >> x3::int_;
auto const expression_2_def =
expression >> x3::int_ >> expression;
BOOST_SPIRIT_DEFINE(expression_2, expression);
auto parser = expression_2;
} // end of grammar namespace
int main(int argc, char** argv){
std::string file_contents = "useless";
pos_iterator_type it(file_contents.begin(), file_contents.end(), "fake");
pos_iterator_type end;
x3_ast::expression result;
x3::phrase_parse(it, end, x3_grammar::parser, x3_grammar::skipper, result);
return 0;
}
|
84d347b64ef699c116278de12c88f4dfdd40b12f
|
ea2ce158d5cf8d55371450d8a2348491a2ceaed1
|
/include/Game.hpp
|
32929520ccd9623fe3205b06757affd47069639a
|
[] |
no_license
|
selivni/prac_6_1
|
14092a44092f85bbcf86c66d791e353c59a78f9b
|
cf022197fa8d4c62426868f6cf95dd85434efbf2
|
refs/heads/master
| 2020-05-20T14:46:24.572202
| 2017-10-17T20:13:00
| 2017-10-17T20:13:00
| 84,485,217
| 0
| 0
| null | null | null | null |
UTF-8
|
C++
| false
| false
| 1,429
|
hpp
|
Game.hpp
|
#ifndef gameprotector
#define gameprotector
#include <utility>
#include <unistd.h>
#include "Utility.h"
#include "Graphics.hpp"
#include "Bot.hpp"
class Game
{
static const int piecesDefault = 12;
static const int boardSizeVert = 8;
static const int boardSizeHor = 8;
static const int blackTurnTime = 300;
static const int fps = 60;
enum
{
EMPTY,
WHITE,
WHITE_K,
BLACK,
BLACK_K
};
enum
{
GAME_NOT_OVER,
TIE,
WHITE_WON,
BLACK_WON
};
enum
{
IDLE,
TURN_START,
WAIT_HUMAN,
BOT_TURN,
SMOOTH_MOVE
};
short int** board;
int playerPieces, aiPieces;
Bot bot;
char turn[5];
unsigned char lastKiller[2];
bool killflag;
unsigned char killCoordinates[2];
int gameOver(int who);
bool haveFreeForward(int i, int j);
bool haveFreeBackwards(int i, int j);
bool canKillNearby(int i, int j, short int enemy);
bool canKillKingNearby(int i, int j, short int enemy);
bool cantMove(int who);
bool turnCorrect();
void fillBoard();
void endGame();
void makeTurn();
int loopState;
void refreshBoard();
public:
Graphics graphics;
void keyboardFunc(unsigned char key, int x, int y);
Game();
void mainGameLoop();
};
extern Game* iHadNoChoice;
void Game_displayFunc();
void Game_mainGameLoop();
void Game_keyboardFunc(unsigned char, int, int);
void Game_mouseClick(int, int, int, int);
void Game_mouseDrag(int, int);
void Game_reshapeFunc(int, int);
void Game_timerFunc(int);
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.