seed
stringlengths 16
5.99k
| id
int64 0
213
|
|---|---|
void setup(void)
{
//////////STILL TRYING TO GET ZULU WITH A DIFFERENT LIBRARY
setSyncProvider(RTC.get); // the function to get the time from the RTC
//////////END STILL TRYING TO GET ZULU WITH A DIFFERENT LIBRARY
Serial.begin(115200);
dht.begin();
P.begin(2);
P.setInvert(false);
// P.setIntensity(6);
P.setZone(0, 0, MAX_DEVICES-5);
P.setZone(1, MAX_DEVICES-4, MAX_DEVICES-1);
P.setFont(1, numeric7Seg);
P.displayZoneText(1, szTime, PA_CENTER, SPEED_TIME, PAUSE_TIME, PA_PRINT, PA_NO_EFFECT);
// COMMENT ABOVE and UNCOMMENT HERE LATER P.displayZoneText(0, szMesg, PA_CENTER, SPEED_TIME, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
P.displayZoneText(0, szMesg, PA_CENTER, SPEED_TIME, ZULU_PAUSE_TIME, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
P.addChar('$', degC); //NOT NEEDED?
P.addChar('&', degF);
// RTC.control(DS1307_CLOCK_HALT, DS1307_OFF);
// RTC.control(DS1307_12H, DS1307_OFF);
// getTime(szTime);
}
| 200
|
int main() {
std::cout << "starting" << std::endl;
hfu::find_nth_index_test();
std::cout << "find_nth_index_test passed" << std::endl;
hfu::extract_airline_test();
std::cout << "find_airline_test passed" << std::endl;
hfu::create_frequencies_test();
std::cout << "create_frequencies_test passed" << std::endl;
std::cout << "terminating" << std::endl;
return 0;
}
| 201
|
void c_p_c()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("/Users/ishan/Desktop/fuzzy-chainsaw-algo/input.txt", "r", stdin);
freopen("/Users/ishan/Desktop/fuzzy-chainsaw-algo/output.txt", "w", stdout);
#endif
}
| 202
|
void loop()
{
timer.run();
if (Blynk.connected()) { // If connected run as normal
Blynk.run();
}
else if (ReCnctFlag == 0) { // If NOT connected and not already trying to reconnect, set timer to try to reconnect in 30 seconds
blynkConnectionStatusForNotification = false;
ReCnctFlag = 1; // Set reconnection Flag
Serial.println("Starting reconnection timer in 30 seconds...");
timer.setTimeout(30000L, []() { // Lambda Reconnection Timer Function
ReCnctFlag = 0; // Reset reconnection Flag
ReCnctCount++; // Increment reconnection Counter
Serial.print("Attempting reconnection #");
Serial.println(ReCnctCount);
Blynk.connect(); // Try to reconnect to the server
}); // END Timer Function
}
}
| 203
|
void fpcM_Init(void) {
fpcLy_Create(&rootlayer, NULL, queue, 10);
fpcLn_Create();
}
| 204
|
inline bool e_game_state_Parse(
const ::std::string& name, e_game_state* value) {
return ::google::protobuf::internal::ParseNamedEnum<e_game_state>(
e_game_state_descriptor(), name, value);
}
| 205
|
void checkforupdate()
{
Serial.println( "OTA Update Request Received" );
Serial.print( "Firmware URL: " );
Serial.println( FIRMWARE_URL );
HTTPClient httpClient;
httpClient.begin( FIRMWARE_URL );
int httpCode = httpClient.GET();
if( httpCode == 200 ) {
Serial.println( "Update file found, starting update" );
Blynk.virtualWrite(VPIN_UPDATE_LED, 1023);
t_httpUpdate_return ret = ESPhttpUpdate.update( FIRMWARE_URL );
switch(ret) {
case HTTP_UPDATE_FAILED:
Serial.println("[update] Update failed.");
break;
case HTTP_UPDATE_NO_UPDATES:
Serial.println("[update] Update no Update.");
break;
case HTTP_UPDATE_OK:
Serial.println("[update] Update ok."); // may not called we reboot the ESP
break;
}
} else {
Serial.print( "Firmware check failed, got HTTP response code " );
Serial.println( httpCode );
}
httpClient.end();
Blynk.virtualWrite(VPIN_UPDATE_LED, 0);
Blynk.virtualWrite(VPIN_FIRMWARE_UPDATE, HIGH);
}
| 206
|
int main()
{
int i, j, n, fake;
for (cin >> n; n; n--)
{
for (i = 0; i < COIN; i++)
ox[i] = coin[i] = 0;
for (i = 0; i < TIME; i++)
{
for (j = 0; j < 3; j++)
cin >> s[j];
if (s[2] == "even")
setStatus(0, 1);
else if (s[2] == "up")
setCoin(1);
else setCoin(-1);
}
for (i = fake = 0; i < COIN; i++)
{
if (abs(coin[i]) > abs(coin[fake])) fake = i;
else ox[i] = 1;
}
printf("%c is the counterfeit coin and it is %s.\n", fake + 'A', ((coin[fake] > 0) ? "light" : "heavy"));
}
}
| 207
|
void auto_mode() // Function to check if auto mode is ON and all voltage value is greater than voltage cutoff value, then turn on 2 relays
{
if(auto_mode_state_1 == LOW && lowvoltageflag == false && highvoltageflag == false && phasefailureflag == false){ //checks if auto mode is ON and voltage values is greater than min value - Motor 1
Serial.println("All condition is TRUE...swtiching on relay 1 now.");
digitalWrite(RELAY_PIN_1, LOW); // Turn on Relay 1
Blynk.virtualWrite(VPIN_BUTTON_1, LOW); // Update Blynk button status to ON
Serial.println("RELAY 1 Turned ON");
}
if(auto_mode_state_2 == LOW && lowvoltageflag == false && highvoltageflag == false && phasefailureflag == false){ //checks if auto mode is ON and voltage values is greater than min value - Motor 2
Serial.println("All condition is TRUE...swtiching on relay 2 now.");
digitalWrite(RELAY_PIN_2, LOW); // Turn on Relay 2
Blynk.virtualWrite(VPIN_BUTTON_2, LOW); // Update Blynk button status to ON
Serial.println("RELAY 2 Turned ON");
}
}
| 208
|
void setStatus(int Scoin, int Sox)
{
int i, j;
for (i = 0; i < 2; i++)
for (j = 0; j < s[i].size(); j++)
{
coin[s[i][j] - 'A'] = Scoin;
ox[s[i][j] - 'A'] = Sox;
}
return ;
}
| 209
|
void expand_data(float *data, float *data2, int Nx, int Ny, int Lx)
{
// expand data to 2N + 2 length
#pragma acc parallel loop independent present(data[0:Nx*Ny],data2[0:Lx*Ny])
for(int i=0;i<Ny;i++)
{
data2[Lx*i] = data2[Lx*i+Nx+1] = 0.0;
#pragma acc loop independent
for(int j=0;j<Nx;j++)
{
data2[Lx*i+j+1] = data[Nx*i+j];
data2[Lx*i+Nx+j+2] = -1.0*data[Nx*i+Nx-1-j];
}
}
}
| 210
|
void loop(){
//update VCC
VCC.update();
}
| 211
|
void DiscreteMasterProperty__float4__OnComplete(DiscreteMasterProperty__float4* __this)
{
::app::Uno::Float4 nv = __this->RestValue();
float str = 0.5f;
for (::app::Uno::Collections::List1_Enumerator__Fuse_Animations_MixerHandle_float4_ enum_123 = ::uPtr< ::app::Uno::Collections::List__Fuse_Animations_MixerHandle_float4_*>(__this->Handles)->GetEnumerator(); enum_123.MoveNext(); )
{
::app::Fuse::Animations::MixerHandle__float4* v = enum_123.Current();
if (::uPtr< ::app::Fuse::Animations::MixerHandle__float4*>(v)->HasValue() && (::uPtr< ::app::Fuse::Animations::MixerHandle__float4*>(v)->Strength > str))
{
nv = ::uPtr< ::app::Fuse::Animations::MixerHandle__float4*>(v)->Value;
str = v->Strength;
}
}
::uPtr< ::app::Uno::UX::Property__float4*>(__this->Property)->Set(nv, (::uObject*)__this);
}
| 212
|
void p14(Node *h, char *c, int l, int s){
Node *p = h;
Node *pn[15];
while(p){
int i;
for(i = 0; i < l; i ++){
if( i == 0) pn[i] = p->next;
else pn[i] = pn[i-1]->next;
if(pn[i] == NULL || pn[i]->c != c[i]){
break;
}
}
if(i != l) {
p = p->next;
continue;
}
// cout<<"p14"<<endl;
Node *node = new Node(' ');
pn[s] = insert(pn[s],node);
p = pn[l-1];
}
}
| 213
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.