Snippets Collections
		contact_map = Map();
		contact_map.put("First_Name	",rep.get("Name1_First"));
		contact_map.put("Last_Name",rep.get("Name1_Last"));
		contact_map.put("Mailing_City",rep.get("Address3_City"));
		contact_map.put("Phone",rep.get("PhoneNumber2"));
		contact_map.put("Mailing_State",rep.get("Address3_Region"));
		contact_map.put("Mailing_Zip",rep.get("Address3_ZipCode"));
		contact_map.put("Mailing_Street",rep.get("Address3_AddressLine1"));
		contact_map.put("Mailing_Street_Line_2",rep.get("Address3_AddressLine2"));
		contact_map.put("Email",rep.get("Email2"));
		contact_map.put("Mailing_Country",rep.get("Address3_Country"));
		contact_map.put("Social_Security_Number",rep.get("SingleLine4"));
		contact_map.put("Passport_Number",rep.get("SingleLine5"));
		contact_map.put("Is_the_legal_representative_an_American_citizen",rep.get("Dropdown3"));
		contact_map.put("Title",rep.get("SingleLine7"));
		contact_map.put("Occupation",rep.get("SingleLine8"));
		contact_map.put("Account_Name",account_id);
		// 		info contact_map;
		create_contact = zoho.crm.createRecord("Contacts",contact_map);
		info create_contact;
		if(create_contact.containKey("id"))
		{
			contact_id = create_contact.get("id");
			//////// Get Roles Ids /////
			// 		get_contact_roles_ids = invokeurl
			// 		[
			// 			url :"https://www.zohoapis.com/crm/v4/Contacts/roles"
			// 			type :GET
			// 			connection:"zoho_crm"
			// 		];
			// 		info get_contact_roles_ids;
			////////////////////////////////////////////////////
			//////////////// Add Contact role to a specific deal ////////
			role_map = Map();
			role_map.put("name","Legal Representative");
			role_map.put("id","6051205000000006871");
			Contact_Role = Map();
			Contact_Role.put("Contact_Role",role_map);
			data = Map();
			data.put("data",Contact_Role.toList());
          //////// 6051205000001977001 is Contact Id /////////
			add_contact_role_to_deal = invokeurl
			[
				url :"https://www.zohoapis.com/crm/v4/Deals/6051205000001947026/Contact_Roles/6051205000001977001"
				type :PUT
				parameters:data.toString()
				connection:"zoho_crm"
			];
			info add_contact_role_to_deal;
        }


0:02 / 4:51


Pass the clap around the classroom: vocabulary game
Launch
(
"
https://cemex.sharepoint.com/sites/PowerPlatformQA-TID/_layouts/15/Versions.aspx?list=%7B00ef5105-28e2-4fa6-860b-b70c12277676%7D&ID="
&
ThisItem
.ID)
Launch("https://cemex.sharepoint.com/sites/PowerPlatformQA-TID/_layouts/15/Versions.aspx?list=%7B00ef5105-28e2-4fa6-860b-b70c12277676%7D&ID=" & ThisItem.ID)
public class NW_VendorHelper
{
    public static str CreateVendor(NW_VendorReg    VendorReg)
    {
        VendTable                    vendTable;
        NumberSeq                    numberSeq;
        Name                         name = VendorReg.CompanyName;
        NA_VendTableWF              NA_VendTableWF;
        DirParty                        dirParty;
        DirPartyTable                   dirPartyTable;
        DirPartyPostalAddressView       dirPartyPostalAddressView;
        DirPartyContactInfoView         dirPartyContactInfo, _dirPartyContactInfo;

        ContactPerson       contactPerson;
        ContactPersonSyncEntity contactPersonSyncEntity;
        NW_VendorRegContact NW_VendorRegContact;

        ;
        //container      conAttribute=["BusinessUnit","CostCenter","Department"];
        //container      conAttributeValue=["001","007","022"];
        /* Marks the beginning of a transaction.
        Necessary to utilize the method numRefCustAccount() */
       
        try
        {
            //vendTable
            ttsBegin;
            vendTable.initValue();
            vendTable.AccountNum    = NumberSeq::newGetNum(VendParameters::numRefVendAccount()).num();
            vendTable.TaxWithholdVendorType_TH  =VendorReg.CompanyType;
            
            if(VendorReg.CompanyType == TaxWithholdVendorType_TH::Domestic)
            {
                vendTable.CR=VendorReg.CRNumStr;
            }
               
            else if(VendorReg.CompanyType == TaxWithholdVendorType_TH::Individual)
            {
                vendTable.CR=int2Str(VendorReg.LicenseNumber);
            }
            if(VendorReg.CompanyType == TaxWithholdVendorType_TH::Foreign)
            {
              
                vendTable.CR=VendorReg.Tin;
            }

         
            vendTable.VATNumber     =VendorReg.VATNumStr;//int2Str(VendorReg.VATNumber);
            vendTable.VendGroup     = "Other Supp";
            vendTable.Currency      ='SAR';
            vendTable.PaymTermId    ='1 Day';
            vendTable.PaymMode      ='CHECK';
            vendTable.APIOfficialContactEmail      =VendorReg.OfficialContactEmail;
          // vendTable.WorkflowStateNew      = TradeWorkflowState::Completed;
            NA_VendTableWF.AccountNum=Vendtable.AccountNum;
            NA_VendTableWF.WorkflowStateNew= TradeWorkflowState::Completed;
            NA_VendTableWF.insert();
            //vendTable.DefaultDimension=DefaultDimesnionHelper::createDefaultDimension(conAttribute,conAttributeValue);
            vendTable.insert();
            NW_VendorRegContact = VendorReg.VendorRegContact();
            dirPartyTable = DirPartyTable::findRec(vendTable.Party,true);
            dirPartyTable.Name = name;
            dirPartyTable.DEL_FirstName = NW_VendorRegContact.ContactFirstName;
            dirPartyTable.DEL_MiddleName = NW_VendorRegContact.ContactLastName;
            dirPartyTable.DEL_LastName = NW_VendorRegContact.ContactLastName;
            //dirPartyTable.update();
            dirPartyTable.doUpdate();

            contactPersonSyncEntity = ContactPersonSyncEntity::construct(contactPerson);

            contactPersonSyncEntity.parmFirstName(NW_VendorRegContact.ContactFirstName);
            //contactPersonSyncEntity.parmMiddleName("");
            contactPersonSyncEntity.parmLastName(NW_VendorRegContact.ContactLastName);
            //contactPersonSyncEntity.parmLastNamePrefix("");
            contactPersonSyncEntity.parmContactForParty(dirPartyTable.RecId);
            contactPersonSyncEntity.parmSensitivity(smmSensitivity::Personal);
            contactPersonSyncEntity.write();
            //DirParty
            /* Creates a new instance of the DirParty class from an address book entity
            that is represented by the custTable parameter. */
            dirParty = DirParty::constructFromCommon(vendTable);
            dirPartyPostalAddressView.LocationName      = VendorReg.AddressName;
            dirPartyPostalAddressView.City              = VendorReg.City;
            dirPartyPostalAddressView.Street            = VendorReg.StreetName;
            //dirPartyPostalAddressView.StreetNumber      = '18';
            dirPartyPostalAddressView.CountryRegionId   = VendorReg.Country;
            dirPartyPostalAddressView.ZipCode           = VendorReg.ZipPostalCode;
            dirPartyPostalAddressView.DistrictName      = VendorReg.District;
            dirPartyPostalAddressView.BuildingCompliment = VendorReg.BuildingNo;
            dirPartyPostalAddressView.Building_RU = VendorReg.BuildingNo;
            //dirPartyPostalAddressView.State             = VendorReg;
            dirPartyPostalAddressView.IsPrimary         = NoYes::Yes;
            // Fill address
            dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView);

            dirPartyContactInfo.LocationName    ='Email Address';
            dirPartyContactInfo.Locator         =VendorReg.OffcialCompanyEmail;
            dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Email;
            dirPartyContactInfo.IsPrimary       = NoYes::Yes;
            // Fill Contacts
            dirParty.createOrUpdateContactInfo(dirPartyContactInfo);

            _dirPartyContactInfo.LocationName    ='Email Address ';
            _dirPartyContactInfo.Locator         =VendorReg.OffcialCompanyEmail;
            _dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Email;
            _dirPartyContactInfo.IsPrimary       = NoYes::Yes;
            contactPersonSyncEntity.createOrUpdateContactInfo(_dirPartyContactInfo);

            dirPartyContactInfo.clear();
            _dirPartyContactInfo.clear();

            dirPartyContactInfo.LocationName    ='Mobile Number';
            dirPartyContactInfo.Locator         =VendorReg.MobileNumber;
            dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Phone;
            dirPartyContactInfo.IsPrimary       = NoYes::Yes;
            // Fill Contacts
            dirParty.createOrUpdateContactInfo(dirPartyContactInfo);

            _dirPartyContactInfo.LocationName    ='Mobile Number ';
            _dirPartyContactInfo.Locator         =VendorReg.MobileNumber;
            _dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Phone;
            _dirPartyContactInfo.IsPrimary       = NoYes::Yes;
            contactPersonSyncEntity.createOrUpdateContactInfo(_dirPartyContactInfo);
            // Marks the end of transaction.

            vendTable.ContactPersonId = contactPerson.ContactPersonId;
            vendTable.update();
           

         
            VendVendorBankAccountEntity VVBE;
            VVBE.VendorAccountNumber = Vendtable.AccountNum;
            VVBE.BankName = VendorReg.BankName;
            VVBE.name=VendorReg.BankName;
            VVBE.AddressCountry = VendorReg.BankCounty;
            VVBE.AddressCity = VendorReg.BankCity;
            VVBE.AddressPostBox = VendorReg.BankPostBox;
            VVBE.AddressStreet = VendorReg.BankStreet ;//+" " + VendorReg.BankOther;
            VVBE.AddressDistrictName = VendorReg.BankDistrictName;
            if(VendorReg.SWIFTCode!="")
            {
                VVBE.BankGroupId = VendorReg.SWIFTCode;
            }
            VVBE.IBAN = VendorReg.IBAN;
            VVBE.addresstype = VendorReg.BankAddressType;
            VVBE.AddressDescription=VendorReg.BankAddressName;
            VVBE.AddressBuildingCompliment = VendorReg.BankBuildingNumber;
            VVBE.BankAccountNumber = VendorReg.AccountNum;
            VVBE.AddressZipCode = VendorReg.BankZipCode;
            VVBE.BeneficaryBankNb=VendorReg.IBAN;
           // VVBE.CurrentCurrencyCode=vr.CurrencyCode;
            VVBE.WorkflowState=VendBankAccountChangeProposalWorkflowState::Approved;
            
            VVBE.insert();
        

            if(VendorReg.BankAccountDetailsStr && VendorReg.BankAccountDetailsName)
            {
                NW_AttachmentAPIHelper::AttachFileFromAPI(VendorReg.BankAccountDetailsName, VendorReg.BankAccountDetailsStr, tableNum(VendBankAccount) , VVBE.RecId);
            }

            if(VendorReg.VatCertificateStr && VendorReg.VatCertificateName )
            {
                NW_AttachmentAPIHelper::AttachFileFromAPI(VendorReg.VatCertificateName, VendorReg.VatCertificateStr, tableNum(VendTable) , Vendtable.RecId);
            }

            if(VendorReg.CompanyRegDocumentStr && VendorReg.CompanyRegDocumentName)
            {
                NW_AttachmentAPIHelper::AttachFileFromAPI(VendorReg.CompanyRegDocumentName, VendorReg.CompanyRegDocumentStr,  tableNum(VendTable),  Vendtable.RecId);
            }

          
            if(VendorReg.OtherStr && VendorReg.OtherName)
            {
                NW_AttachmentAPIHelper::AttachFileFromAPI(VendorReg.OtherName , VendorReg.OtherStr,  tableNum(VendTable) ,  Vendtable.RecId);
            }

            ttsCommit;
            return vendTable.AccountNum;
        }
        catch(Exception::Error)
        {
            ttsAbort;
            throw Exception::Error;
        }
    }

}
#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<string.h>
#include<stdlib.h>
int main(){
   int fd[2],x;
   pid_t pid;
   char string[]="welcome";
   char b[80];
   pipe(fd);
   pid=fork();
   if(pid==0){
   close(fd[0]);
   write(fd[1],string,(strlen(string)+1));
   exit(0);
   }
   else{
     close(fd[1]);
     x=read(fd[0],b,sizeof(b));
     printf("received string:%s",b);
     }
     return 0;
     }
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<fcntl.h>
#include<string.h>


int main(){


char string[]="welcome";
char b[80];
int fd[2],x;
pid_t pid;
 
pipe(fd);

pid=fork();

if(pid==0){
close(fd[0]);
		write(fd[1],string,strlen(string)+1);
		
		
		
		

}else{
	close(fd[1]);
	x=read(fd[0],b,sizeof(b));
	printf("received string is %s",b);
	
}



return 0;
}
// change the account input element to "type=password" to hide the value
cy.get('#account-id').invoke('attr', 'type', 'password')
// now take the screenshot
cy.get('#account').screenshot('account', {
  overwrite: true,
})
#include<stdio.h>

int main() {
  /* array will store at most 5 process with 3 resoures if your process or
  resources is greater than 5 and 3 then increase the size of array */
  int p, c, count = 0, i, j, alc[5][3], max[5][3], need[5][3], safe[5], available[3], done[5], terminate = 0;
  printf("Enter the number of process and resources");
  scanf("%d %d", & p, & c);
  // p is process and c is diffrent resources
  printf("enter allocation of resource of all process %dx%d matrix", p, c);
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      scanf("%d", & alc[i][j]);
    }
  }
  printf("enter the max resource process required %dx%d matrix", p, c);
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      scanf("%d", & max[i][j]);
    }
  }
  printf("enter the  available resource");
  for (i = 0; i < c; i++)
    scanf("%d", & available[i]);

  printf("\n need resources matrix are\n");
  for (i = 0; i < p; i++) {
    for (j = 0; j < c; j++) {
      need[i][j] = max[i][j] - alc[i][j];
      printf("%d\t", need[i][j]);
    }
    printf("\n");
  }
  /* once process execute variable done will stop them for again execution */
  for (i = 0; i < p; i++) {
    done[i] = 0;
  }
  while (count < p) {
    for (i = 0; i < p; i++) {
      if (done[i] == 0) {
        for (j = 0; j < c; j++) {
          if (need[i][j] > available[j])
            break;
        }
        //when need matrix is not greater then available matrix then if j==c will true
        if (j == c) {
          safe[count] = i;
          done[i] = 1;
          /* now process get execute release the resources and add them in available resources */
          for (j = 0; j < c; j++) {
            available[j] += alc[i][j];
          }
          count++;
          terminate = 0;
        } else {
          terminate++;
        }
      }
    }
    if (terminate == (p - 1)) {
      printf("safe sequence does not exist");
      break;
    }

  }
  if (terminate != (p - 1)) {
    printf("\n available resource after completion\n");
    for (i = 0; i < c; i++) {
      printf("%d\t", available[i]);
    }
    printf("\n safe sequence are\n");
    for (i = 0; i < p; i++) {
      printf("p%d\t", safe[i]);
    }
  }

  return 0;
}
.gfield-choice-input {
      opacity: 0;
      position: absolute;
   // top: 50% !important;
   // transform: translateY(-50%);

      &:checked+label {
        background: $primary;
        color: $white;
      }
    }

    .gchoice {
      input:checked+label {
        &:before {
          filter: brightness(5);
        }
      }
    }
<?php echo do_shortcode('[gravityform id="1" title="false" ajax="true"]') ?>
// Replace 'YOUR_FORM_ID' with the ID of your Google Form
var form = FormApp.openById('1anUG2PmvXTIec9QycnZXEWFhDW8sAeDBgnQu9mefdo4');

// Load submission counter from Script Properties
var scriptProperties = PropertiesService.getScriptProperties();
var submissionCounter = parseInt(scriptProperties.getProperty('submissionCounter')) || 0;

// Load processed submissions from User Properties
var userProperties = PropertiesService.getUserProperties();
var processedSubmissions = userProperties.getProperty('processedSubmissions');
processedSubmissions = processedSubmissions ? JSON.parse(processedSubmissions) : {};

function onFormSubmit(e) {
  // Lock the script to prevent concurrent execution
  var lock = LockService.getScriptLock();
  lock.waitLock(30000); // wait for 30 seconds

  try {
    var response = e.response;
    var submissionId = response.getId();
    
    // Check if this submission has already been processed
    if (processedSubmissions[submissionId]) {
      return;
    }

    var itemResponses = response.getItemResponses();
    var recipientEmail = '';
    var ccEmails = []; // Array to store CC email addresses for each location
    var generateSerialNumber = true; // Default to true, assuming serial number should be generated
    var attachments = []; // Array to store attachments
    var downloadLinks = ''; // String to store download links for the email body
    
    // Check the response for the specific question that determines whether to generate a serial number or not
    for (var i = 0; i < itemResponses.length; i++) {
      var itemResponse = itemResponses[i];
      if (itemResponse.getItem().getTitle() === 'FORM SUBMISSION TYPE') { // Adjust this to the title of the question that determines HR type
        if (itemResponse.getResponse() === 'CORPORATE HR') {
          generateSerialNumber = false; // If Corporate HR is selected, do not generate serial number
        }
      }
    }
    
    // Incrementing the submission counter if needed
    if (generateSerialNumber) {
      submissionCounter++;
    }
    
    // Extracting the form data and formatting as HTML table
    var formData = '<table border="1">';
    
    // Adding serial number to the table if needed
    if (generateSerialNumber) {
      formData += '<tr><td><strong>Serial Number</strong></td><td>' + submissionCounter + '</td></tr>';
    }
    
    for (var i = 0; i < itemResponses.length; i++) {
      var itemResponse = itemResponses[i];
      formData += '<tr><td><strong>' + itemResponse.getItem().getTitle() + '</strong></td><td>' + itemResponse.getResponse() + '</td></tr>';
      if (itemResponse.getItem().getTitle() === 'EMAIL OF THE EMPLOYEE') { // Change 'Email Address' to the title of your email question
        recipientEmail = itemResponse.getResponse();
      }
      // Check if the question is the location question
      if (itemResponse.getItem().getTitle() === 'SELECT UNIT') { // Adjust this to the title of your location question
        var selectedLocations = itemResponse.getResponse().split(', ');
        // Loop through selected locations
        for (var j = 0; j < selectedLocations.length; j++) {
          var location = selectedLocations[j];
          // Add email addresses to the ccEmails array based on the selected location
          switch (location) {
            case 'Binola-1,2':
              ccEmails.push('niranjan.yadav@meenakshipolymers.com', 'hr.binola@meenakshipolymers.com', 'neeraj.yadav@meenakshipolymers.com');
              break;
            case 'Corporate 2,3,4':
              ccEmails.push('ashwani.kumar1@meenakshipolymers.com','neeraj.yadav@meenakshipolymers.com');
              break;
            case 'Dadri':
              ccEmails.push('hr.dadri@meenakshipolymers.com', 'mayank.sharma@meenakshipolymers.com', 'neeraj.yadav@meenakshipolymers.com');
              break;
            case 'Haridwar I':
              ccEmails.push('prashant.gupta@meenakshipolymers.com', 'sachin.kumar@meenakshipolymers.com', 'neeraj.yadav@meenakshipolymers.com');
              break;
            case 'Haridwar II':
              ccEmails.push('arun.kumar2@meenakshipolymers.com', 'praveen.sharma@meenakshipolymers.com', 'neeraj.yadav@meenakshipolymers.com');
              break;
            case 'Kadi':
              ccEmails.push('aditi.singh@meenakshipolymers.com', 'neeraj.yadav@meenakshipolymers.com');
              break;
            case 'Gurgaon':
              ccEmails.push('kuldeep.yadav@meenakshipolymers.com', 'neeraj.yadav@meenakshipolymers.com');
              break;  
            case 'Manesar':
              ccEmails.push('manoj.khosya@meenakshipolymers.com', 'neeraj.yadav@meenakshipolymers.com');
              break;
            case 'Neemrana':
              ccEmails.push('sandeep.kumar@meenakshipolymers.com', 'neeraj.yadav@meenakshipolymers.com');
              break;          
            default:
              break;
          }
        }
      }
      // Check if the question has file uploads
if (itemResponse.getItem().getType() === FormApp.ItemType.FILE_UPLOAD) {
  var fileResponses = itemResponse.getResponse();
  for (var k = 0; k < fileResponses.length; k++) {
    var fileId = fileResponses[k]; // Retrieve each file ID
    if (!attachments.includes(fileId)) { // Check if the file is not already attached
      var file = DriveApp.getFileById(fileId);
      attachments.push(file.getBlob());
      downloadLinks += '<a href="cid:' + file.getId() + '">' + file.getName() + '</a><br>';
    }
  }
}


    }
    formData += '</table>';
    
    if (recipientEmail !== '') {
      // Formatting the email content in HTML
      var htmlBody = '<html><body>';
      htmlBody += '<h1>Request for New Ticket/Hotel Booking, See Details Below</h1>';
      htmlBody += formData;
      if (downloadLinks !== '') {
        htmlBody += '<h2>Uploaded Files:</h2>' + downloadLinks;
      }
      htmlBody += '</body></html>';
      
      // Subject with serial number if generated
      var subject = generateSerialNumber ? 'Request for New Ticket/Hotel Booking - Serial Number: ' + submissionCounter : 'Request Update for Hotel/Train/Flight Booking';
      
      // Sending the email
      MailApp.sendEmail({
        to: recipientEmail,
        cc: ccEmails.join(','),
        subject: subject,
        htmlBody: htmlBody,
        attachments: attachments
      });
    }
    
    // Store updated submissionCounter in Script Properties if needed
    if (generateSerialNumber) {
      scriptProperties.setProperty('submissionCounter', submissionCounter);
    }
    
    // Record this submission as processed
    processedSubmissions[submissionId] = true;
    userProperties.setProperty('processedSubmissions', JSON.stringify(processedSubmissions));
  } finally {
    // Release the lock
    lock.releaseLock();
  }
}

// Install a trigger to run on form submission
function installTrigger() {
  ScriptApp.newTrigger('onFormSubmit')
      .forForm(form)
      .onFormSubmit()
      .create();
}
#include <stdio.h>

int main() {
    char ch;
    int vowelCount = 0;

    printf("Enter a stream of characters:\n");

    while ((ch = getchar()) != '\n') {
        if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
            ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') {
            vowelCount++;
        }
    }

    printf("Number of vowels: %d\n", vowelCount);

    return 0;
}
#include <stdio.h>
#include <ctype.h>
 
int main() {
    char c;
    int vowels=0, consonant=0;
    puts("Enter a stream of characters:");
    
    while((c=getchar())!='\n')
    {
    if(isalpha(c))
    {
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='A'||c=='E'||c=='I'||c=='O'||c=='U')
        vowels++;
        else
        consonant++;
    }
    
    
 
    }
    printf("Vowels: %d\n", vowels);
    printf("Consonant: %d", consonant);
    
    return 0;
}
#include <stdio.h>
#include <ctype.h>
 
int main()
{
    char c;
    puts("Enter a stream of characters:");
    
while((c=getchar())!='\n')
{
    if(isalpha(c))
    putchar(c);
}
    return 0;
}
#include <stdio.h>
#include <ctype.h>
 
int main()
{
    char c;
    puts("Enter a stream of characters:");
    
while((c=getchar())!='\n')
{
    if(isalpha(c))
    putchar(c);
}
    return 0;
}
// Mobile Header
.xd-mobile-header1 {
    /* ==== VARIABLES SECTION ==== */
    /*  The below code is all using the variables from _variables.scss
    Any changes to the site variables should be reflected automatically
    without requiring changing any custom code here */
    background: $header-bgcolor;
    .menu-bar {
        background: $primenav-bgcolor;
        border-top: $primenav-topborder;
        border-bottom: $primenav-btmborder;
        .fa {
            color: $primenav-mobile-iconcolor;
        }
        .icon-bar {
            background-color: $primenav-mobile-iconcolor;
        }
    }
    .PrimaryNavigation_1-0-0 {
        ul.nav {
            .root-link {
                color: $primenav-mobile-linkcolor !important;
                font-size: $primenav-mobile-fontsize !important;
            }
            .dropdown-menu {
                .dropdown {
                    .dropdown-link {
                        color: $primenav-mobile-linkcolor;
                        font-size: $primenav-mobile-dropdown-fontsize;
                        @if ($primenav-mobile-dropdownicon-display) {
                            &:before {
                                content: "#{$primenav-mobile-dropdownicon}";
                                font-family: "FontAwesome";
                            }
                        }
                        &:hover, &:focus{
                            background-color: transparent;
                        }
                    }
                }
            }
        }
    }
    /* ==== END VARIABLES SECTION ==== */
    /* ==== BASIC STYLES ==== */
    /*  This code is just some basic styling to format the header as shown in the XD UI kit.
        You shouldn't have to edit this code too much, but this code can be adjusted as needed.*/
    margin: 0;
    >.ari-column {
        padding: {
            left: 0;
            right: 0;
        };
    }
    .logo {
        margin: 20px 10px;
    }
    .xd1-mobile-search {
        padding: {
            left: 15px;
            right: 15px;
        };
        .SearchBar_1-0-0 {
            margin: 10px 0;
        }
    }
    .menu-bar {
        margin: 0;
        padding: 5px 0;
        .ari-col-xs-6 {
            display: flex;
            align-items: center;
            &.menu-bar-left {
                justify-content: flex-start;
            }
            &.menu-bar-right {
                justify-content: flex-end;
                .navbar-toggle {
                    margin: 0;
                    padding: 0;
                    overflow: visible;
                    &:not(.collapsed) {
                        .fa:before{ content: "\f00d"; }
                    }
                }
            }
        }
        .search-btn{
            a.collapsed{
                .fa-search:before{
                    content: "\f00d" !important;
                }
            }
        } 
    }
    .xd1-mobile-nav {
        padding: 0 15px;
        .navbar-header {
            display: none;
        }
        .navbar-collapse {
            display: block !important;
            .nav>li.dropdown .dropdown-menu .dropdown-link{
            	color: #fff;
            }
        }
    }
    /* ==== END BASIC STYLES ==== */
}
#include <stdio.h>
#include <ctype.h>
int counta, counte, counti, counto, countu, countvowel, countconsonant;

int main()
{
    char c;
    
    printf("Input A string of characters: ");
    while ((c=getchar()) != '\n')

    if (c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' || c == 'I' || c == 'o' || c == 'O' || c == 'u' || c == 'U') { 
        countvowel++;
    } else 
    countconsonant++;
    
    printf("vowels = %d \n", countvowel);
    printf("consonants = %d \n", countconsonant);

    return (0);
}
#include <stdio.h>
#include <ctype.h>

int main()
{
    char c;
    
    printf("Input A string of characters: ");
    while ((c=getchar()) != '\n')
    
    if (isalnum(c)) {
        putchar(c);
    } else
    if (ispunct(c)) {
        putchar(c);
    }
    return 0;
}
/******************************************************************************

create a program that will accept a stream of characters 
and will display the count of the vowels and consonant

*******************************************************************************/
#include <stdio.h>
#include <ctype.h>
int counta, counte, counti, counto, countu;

int main()
{
    char c;
    
    printf("Input A string of characters: ");
    while ((c=getchar()) != '\n')

    if (c == 'a' || c == 'A') { 
        counta++;
    } else
        if (c == 'e' || c == 'E') { 
        counte++;

    } else
        if (c == 'i' || c == 'I') { 
        counti++;
    } else
        if (c == 'o' || c == 'O') { 
        counto++;
    } else
        if (c == 'u' || c == 'U') { 
        countu++;
    }
    
    printf("a = %d \n", counta);
    printf("e = %d \n", counte);
    printf("i = %d \n", counti);
    printf("o = %d \n", counto);
    printf("u = %d \n", countu);

}
#include <stdio.h>
#include <ctype.h>

int main() {
    char c;
    int a=0, e=0, i=0, o=0, u=0;
    puts("Enter a stream of characters:");
    
    while((c=getchar())!='\n')
    {
    switch(c)
    {
    case 'a':
    case 'A':a++; break;
    case'e':
    case'E':e++; break;
    case 'i':
    case 'I':i++; break;
    case 'o':
    case 'O':o++; break;
    case 'u':
    case 'U':u++; break;
    }
    
    }

    printf("A=%d\n", a);
    printf("E=%d\n", e);
    printf("I=%d\n", i);
    printf("O=%d\n", o);
    printf("U=%d\n", u);
    return 0;
}
include <stdio.h> 

  

int main() 

{ 

    int array[3][4]; 

    int r, c, total, smallest, largest; 

    float ave; 

     

    printf ("Enter 12 Integers: "); 

     

    //input Integers 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         scanf ("%d", &array[r][c]);    

        } 

     

    //print 12 Integers 

    printf ("The numbers inputted are: "); 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         printf ("%d ", array[r][c]);    

        } 

     

    //print 12 Integers 

    printf ("\nThe numbers in reverse are: "); 

    for (r=2;r>=0;r--) 

        for (c=3;c>=0;c--) { 

         printf ("%d ", array[r][c]);    

        } 

     

    //odd 

    printf ("\nThe odd numbers are: "); 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         if (array[r][c]%2==1) 

         printf ("%d ", array[r][c]);    

        } 

     

    //even 

    printf ("\nThe even numbers are: "); 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         if (array[r][c]%2==0) 

         printf ("%d ", array[r][c]);    

        } 

     

    //total 

    printf ("\nSum: "); 

    for (r=0;r<=2;r++) { 

        for (c=0;c<=3;c++) { 

        total=total+array[r][c]; 

        } 

    }   

    printf ("%d", total); 

     

    //average 

    printf ("\nAverage: "); 

    ave=total/12; 

    printf ("%.2f", ave); 

     

    smallest = largest = array[0][0]; 

     

    //Smallest and largest 

    for (int r=0;r<=2;r++) { 

        for (c=0;c<=3;c++) { 

         if (array[r][c]<smallest) { 

            smallest = array[r][c]; 

         } 

        if (array[r][c]>largest) { 

            largest = array[r][c]; 

         } 

        }} 

         

    printf ("\nThe smallest is: %d", smallest); 

    printf ("\nThe largest is: %d", largest); 

     

    //nalito ako sa number 8 kasi two dimensional toh pero sige 

    float a2[3][4]; 

     

    printf ("\nThe 2nd array contains: "); 

    for (r=0;r<=2;r++)  

        for (c=0;c<=3;c++) { 

         

        a2[r][c]=array[r][c]; 

        printf ("%.0f ", a2[r][c]); 

         

        } 

    return 0; 

}   

 
#include <stdio.h>
#include <ctype.h>

int main() {
    char c;
    int vowels=0, consonant=0;
    puts("Stream of Characters:");
    
    while((c=getchar())!='\n')
    {
    if(isalpha(c))
    {
        if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u'||c=='A'||c=='E'||c=='I'||c=='O'||c=='U')
        vowels++;
        else
        consonant++;
    }
    
    

    }
    printf("Vowels: %d\n", vowels);
    printf("Consonant: %d", consonant);
    
    return 0;
}
/******************************************************************************

Write a program that would accept a stream of characters as input and  display only the letters removing the spaces. Convert all vowels to uppercase and  all consonants to lowercase.

     Sample Output:   

Enter a stream of characters:       Hello    World    123!!!

                                 hEllOwOrld

*******************************************************************************/
#include <stdio.h>
#include <ctype.h>
#include <string.h>

char Determine_Cons_Vow (char *S);
char Remove_Space_Number (char *S);
char String[100], No_Space_Number[100], Cons_Vow_String[100];
int main()
{
    printf("Input a string of characters: ");
    scanf("%[^\n]%*c", String);
    
    printf ("Before:                     %s\n", String);
    
    Remove_Space_Number(String);
    
    printf ("Without Spaces and Numbers: %s\n", No_Space_Number);
    
    Determine_Cons_Vow(No_Space_Number);
    
    printf ("Final:                      %s", Cons_Vow_String);
    
    return 0;
}

char Remove_Space_Number(char *S)
{
    
    int j=0;
    for (int i=0; i<=100; i++)
    {
        if (String[i] != ' ')
        {
            if (isalpha(String[i]))
            {
                No_Space_Number[j]=String[i];
                j++;
            }
        }
    }
    for (int i=0; i<=100; i++)
    {
        return No_Space_Number[i];
    }
}

char Determine_Cons_Vow (char *S)
{
    int j=0;
    
    for (int i=0; i<=100; i++) 
    {
        Cons_Vow_String[i]=No_Space_Number[i];
    }
    
    for (int i=0; i<=100; i++)
    {
        if (Cons_Vow_String[i] == 'a' || Cons_Vow_String[i] == 'e' || Cons_Vow_String[i] == 'i' ||Cons_Vow_String[i] == 'o' || Cons_Vow_String[i] == 'u' || Cons_Vow_String[i] == 'A' || Cons_Vow_String[i] == 'E' || Cons_Vow_String[i] == 'I' || Cons_Vow_String[i] == 'O' || Cons_Vow_String[i] == 'U') 
        {
            Cons_Vow_String[i] = toupper(Cons_Vow_String[i]);
        }
        else
        Cons_Vow_String[i] = tolower(Cons_Vow_String[i]);
    }
    
    for (int i=0; i<=100; i++)
    {
        return Cons_Vow_String[i];
    }
}
#include <stdio.h>
#include <ctype.h>

int main()
{
    char c;
    puts("Enter a stream of characters:");
    
while((c=getchar())!='\n')
{
    if(isalpha(c))
    putchar(c);
}
    return 0;
}
import mysql.connector
import json
import os

# Connect to MySQL
conn = mysql.connector.connect(
    host="localhost",
    user="root",
    password="Eimaipolykala1",
    database="twitter_db"
)
cursor = conn.cursor()

# Path to the directory containing JSON files
json_dir = r'C:\Users\User\Desktop\DBL Data Challenge\data'


# Loop through JSON files in the directory
for filename in os.listdir(json_dir):
    data_agg = []
    if filename.endswith('.json'):
        with open(os.path.join(json_dir, filename), 'r') as file:
            for line in file:
                try :
                # Load each line as JSON

                    data = json.loads(line)
                    data_agg.append(data)
                except JSONDecodeError as e:
                    print(f"Error in {filename}: {e}")
            
            
        for item in data_agg:
            # Insert data into MySQL table
            query = "INSERT INTO raw_data_proto (data, filename) VALUES (%s, %s)"
            values = (json.dumps(item), filename)
            cursor.execute(query, values)

# Commit changes and close connections
conn.commit()
cursor.close()
conn.close()
import mysql.connector
import json
import os

# Connect to MySQL
conn = mysql.connector.connect(
    host="localhost",
    user="root",
    password="Eimaipolykala1",
    database="twitter_db"
)
cursor = conn.cursor()

# Path to the directory containing JSON files
json_dir = r'C:\Users\User\Desktop\DBL Data Challenge\data'


# Loop through JSON files in the directory
for filename in os.listdir(json_dir):
    data_agg = []
    if filename.endswith('.json'):
        with open(os.path.join(json_dir, filename), 'r') as file:
            for line in file:
                # Load each line as JSON

                data = json.loads(line)
                data_agg.append(data)
            
            
        for item in data_agg:
            # Insert data into MySQL table
            query = "INSERT INTO raw_data_proto (data, filename) VALUES (%s, %s)"
            values = (json.dumps(item), filename)
            cursor.execute(query, values)

# Commit changes and close connections
conn.commit()
cursor.close()
conn.close()
Run df -h to verify your root partition is full (100%)
Run lsblk and then lsblk -f to get block device details
sudo mount -o size=10M,rw,nodev,nosuid -t tmpfs tmpfs /tmp
sudo growpart /dev/DEVICE_ID PARTITION_NUMBER
lsblk to verify partition has expanded
sudo resize2fs /dev/DEVICE_IDPARTITION_NUMBER
Run df -h to verify your resized disk
sudo umount /tmp
<div class="related-post">
  <div class="container">
    <h2 id="recent">Related Articles</h2>
    <div class="row">
      <?php
      $current_post_type = get_post_type($post);
      // The query arguments
      $args = array(
        'posts_per_page' => 3,
        'order' => 'rand',
        'orderby' => 'ID',
        'post_type' => 'post',
        'post_status' => 'publish',
        'numberposts' => -1,
        'post__not_in' => array($post->ID)
      );

      // Create the related query
      $rel_query = new WP_Query($args);

      // Check if there is any related posts
      if ($rel_query->have_posts()):
        ?>


        <?php
        // The Loop
        while ($rel_query->have_posts()):
          $rel_query->the_post();
          $post_tags = get_the_tags();
          ?>
          <div class="col-md-4 col-sm-6 col-12 related-col">

            <?php the_post_thumbnail(); ?>
            <div class="taxonomy-post_tag wp-block-post-terms">
              <?php
              if ($post_tags) {
                if (count($post_tags) > 0) {
                  foreach ($post_tags as $key => $val) {
                    ?>
                    <a href="<?php echo get_permalink(); ?>">
                      <?php echo $val->name; ?>
                    </a>
                    <?php
                  }
                }
              }
              ?>
            </div>
            <div class="wp-block-post-date"> <time>
                <?php echo get_the_date() ?>
              </time></div>
            <a href="<?php the_permalink() ?>">
              <h3 class="entry-title">
                <?php the_title() ?>
              </h3>
            </a>

          </div>
          <?php
        endwhile;
        ?>

        <?php
      endif;

      // Reset the query
      wp_reset_query();

      ?>
    </div>
  </div>
</div>
n = int(input('Total number of items in list: '))
L = []

# Input items into the list
for i in range(n):
    item = int(input('Enter the item: '))
    L.append(item)

# Selection sort algorithm
for i in range(n - 1):
    min_index = i

    for j in range(i + 1, n):
        if L[j] < L[min_index]:
            min_index = j

    L[i], L[min_index] = L[min_index], L[i]

# Print the sorted list
print('Sorted list:\n', L)
n=int(input('total number of items in list'))
L=[]
for i in range(n):
    item=int(input('enter the item'))
    L.append(item)
n=int(input('total number of items in list'))
L=[]
for i in range(n):
    item=int(input('enter the item'))
    L.append(item)



for i in range(1,n):
    k=L[i]
    j=i-1
    while j>=0 and k<L[j]:
        L[j+1]=L[j]
        j=j-1
    else:
        L[j+1]=k
print('sorted list:\n',L)

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-aiplatform
import vertexai

from vertexai.generative_models import GenerativeModel, Part

# TODO(developer): Update and un-comment below line
# project_id = "PROJECT_ID"

vertexai.init(project=project_id, location="us-central1")

model = GenerativeModel(model_name="gemini-1.0-pro-vision-001")

response = model.generate_content(
    [
        Part.from_uri(
            "gs://cloud-samples-data/generative-ai/image/scones.jpg",
            mime_type="image/jpeg",
        ),
        "What is shown in this image?",
    ]
)

print(response.text)
//SJF                                                                                                                                                 #include<stdio.h>
#define size 20
int main(void)
{
      int i , j, n , t, p[size],bt[size],wt[size],tat[size];
      float awt=0,atat=0;
      printf("Enter the number of processes:");
      scanf(" %d",&n);
      printf("Enter the process numbers:");
      for(i=0;i<n;i++)
      {
            scanf(" %d",&p[i]);
      }
      printf("Enter burst time of the processes:");
      for(i=0;i<n;i++)
      {
            scanf(" %d",&bt[i]);
      }
      //Applying bubble sort
      for(i=1;i<n;i++)
      {
            for(j=0;j<n-i;j++)
            {
                  t=bt[j];
                  bt[j]=bt[j+1];
                  bt[j+1]=t;
                  t=p[j];
                  p[j]=p[j+1];
                  p[j+1]=t;
            }
      }
      printf("Process\tBT\tWt\tTAT\n");
      for(i=0;i<n;i++)
      {
            wt[i]=0;
            tat[i]=0;
            for(j=0;j<i;j++)
            {
                  wt[i]=wt[i]+bt[j];
            }
            tat[i]=wt[i]+bt[i];
            awt=awt+wt[i];
            atat=atat+tat[i];
            printf("%d\t%d\t%d\t%d\n",p[i],bt[i],wt[i],tat[i]);
      }
      printf("Average waiting time:%0.2f\n",awt/n);
      printf("Average turn around time:%0.2f\n",atat/n);
      return 0;
}

//Our SJF                                                                                                                                       #include<stdio.h>
int main()
{
                              int at[10],bt[10],p[10];
            int n,i,j,temp,time=0,count,over=0,sum_wait=0,sum_turnaround=0,start;
            float avgwait,avgturn;
            printf("Enter the number of processes\n");
            scanf("%d",&n);
            for(i=0;i<n;i++)
            {
                                    printf("Enter the arrival time and execution time for process %d\n",i+1);
                scanf("%d%d",&at[i],&bt[i]);
                p[i]=i+1;
            }
            for(i=0;i<n-1;i++)
            {
                for(j=i+1;j<n;j++)
                {
                   if(at[i]>at[j])
                   {
                    temp=at[i];
                    at[i]=at[j];
                    at[j]=temp;
                    temp=bt[i];
                    bt[i]=bt[j];
                    bt[j]=temp;
                    temp=p[i];
                    p[i]=p[j];
                    p[j]=temp;     
                   }
                        
                 }
            }
            printf("\nProcess\tAT\tBT\tWT\tTAT\n");
            while(over<n)
            {
               count=0;
               for(i=over;i<n;i++)
               {
                  if(at[i]<=time)
                     count++;
                  else
                     break;
               }
               if(count>1)
               {
                 for(i=over;i<over+count-1;i++)
                 {
                    for(j=i+1;j<over+count;j++)
                    {
                      if(bt[i]>bt[j])
                      {
                        temp=at[i];
                        at[i]=at[j];
                        at[j]=temp;
                        temp=bt[i];
                        bt[i]=bt[j];
                        bt[j]=temp;
                        temp=p[i];
                        p[i]=p[j];
                        p[j]=temp;     
                       }
                     }                     
                   }
                 }
                start=time;
                time+=bt[over];
                printf("p[%d]\t%d\t%d\t%d\t%d\n",p[over],at[over],bt[over],time-at[over]-bt[over],time-at[over]);
                sum_wait+=time-at[over]-bt[over];
                                                                                                sum_turnaround+=time-at[over];
                over++;
            }
            avgwait=(float)sum_wait/(float)n;
            avgturn=(float)sum_turnaround/(float)n;
            printf("Average waiting time is %f\n",avgwait);
            printf("Average turnaround time is %f\n",avgturn);
            return 0;
}  
//FCFS                                                                                                         #include<stdio.h>
int main(void)
{
      int n,at[10],bt[10],ct[10],tat[10],wt[10],sum,i,j,k;
      float totaltat=0,totalwt=0;
      printf("Enter No of processors:");
      scanf(" %d",&n);
      for(i=0;i<n;i++)
      {
            printf("Enter the arrival time of processor %d:",i+1);
            scanf(" %d",&at[i]);
      }
      for(i=0;i<n;i++)
      {
            printf("Enter the burst time of processor %d:",i+1);
            scanf(" %d",&bt[i]);
      }
      //Calculation of completion times for each processor
      sum=at[0];
      for(j=0;j<n;j++)
      {
            sum=sum+bt[j];
            ct[j]=sum;
      }
      //Calculation of turn around time
      for(k=0;k<n;k++)
      {
            tat[k]=ct[k]-at[k];
            totaltat=totaltat+tat[k];
      }
      //Calculation of waiting time
      for(i=0;i<n;i++)
      {
            wt[i]=tat[i]-bt[i];
            totalwt=totalwt+wt[i];
      }
      printf("Process\tAT\tBT\tCT\tTAT\tWt\n");
      for(i=0;i<n;i++)
      {
            printf("\nP%d\t%d\t%d\t%d\t%d\t%d\t\n",i+1,at[i],bt[i],ct[i],tat[i],wt[i]);
      }
      printf("average of turn around time:%0.1f\n",totaltat/n);
      printf("average of waiting time:%0.1f\n",totalwt/n);
      return 0;
}
//Optimal page replacement
#include<stdio.h>
int n;
int main()
{
int seq[30],fr[5],pos[5],find,flag,max,i,j,m,k,t,s;
int count=1,pf=0,p=0;
float pfr;
printf("Enter maximum limit of the sequence: ");
scanf("%d",&max);
printf("\nEnter the sequence: ");
 for(i=0;i<max;i++)
scanf("%d",&seq[i]);
 printf("\nEnter no. of frames: ");
 scanf("%d",&n);
fr[0]=seq[0];
pf++;
printf("%d\t",fr[0]);
i=1;
while(count<n)
{
flag=1; p++;
for(j=0;j<i;j++)
{
if(seq[i]==seq[j]) flag=0;
}
if(flag!=0)
{
 fr[count]=seq[i];
 printf("%d\t",fr[count]);
 count++;
pf++;

}
i++;
}
 
printf("\n");
for(i=p;i<max;i++)
{
flag=1;
for(j=0;j<n;j++)
{
if(seq[i]==fr[j])
flag=0;
}
if(flag!=0)

{
for(j=0;j<n;j++)
{
m=fr[j];
for(k=i;k<max;k++)
{
if(seq[k]==m)
{
    pos[j]=k;
     break;

 }
else
pos[j]=1;

}
}
for(k=0;k<n;k++)
{
if(pos[k]==1)
flag=0;
}
if(flag!=0)
s=findmax(pos);
 if(flag==0)
{
for(k=0;k<n;k++)
{
if(pos[k]==1)
{
s=k;
 break;
}
}
}
fr[s]=seq[i];
for(k=0;k<n;k++)
printf("%d\t",fr[k]);
pf++;
printf("\n");
}
}
pfr=(float)pf/(float)max;
printf("\nThe no. of page faults are %d",pf);
printf("\nPage fault rate %f",pfr);
getch();
}
int findmax(int a[])
{
int max,i,k=0;
max=a[0];
for(i=0;i<n;i++)
{
if(max<a[i])
{
  max=a[i];
   k=i;
}
}
return k;
}
//FIFO PAGE REPLACEMENT ALGORITHM
#include<stdio.h>
#include<conio.h>
int main()
{
int i, j, k, f, pf=0, count=0, rs[25], m[10], n;
printf("\n Enter the length of reference string -- ");
scanf("%d",&n);
printf("\n Enter the reference string -- ");
 for(i=0;i<n;i++)
scanf("%d",&rs[i]);
 printf("\n Enter no. of frames -- ");
 scanf("%d",&f);
for(i=0;i<f;i++)
m[i]=-1;

printf("\n The Page Replacement Process is -- \n");
 for(i=0;i<n;i++)
{
for(k=0;k<f;k++)
{
  if(m[k]==rs[i])
  break;

}
if(k==f)
{
m[count++]=rs[i];
pf++;

}

for(j=0;j<f;j++)
printf("\t%d",m[j]);
if(k==f)
printf("\tPF No. %d",pf);
printf("\n");
if(count==f)
count=0;
}
printf("\n The number of Page Faults using FIFO are %d",pf);
getch();

}
Sub LoopEachOpenWorkbook()

'PURPOSE: Add today's date into every currently open Excel workbook
'SOURCE: www.TheSpreadsheetGuru.com

Dim wb As Workbook

For Each wb In Application.Workbooks
  If wb.Name <> "PERSONAL.xlsb" Then
    
    'Add today's date to cell A1 of first worksheet in workbook
      wb.Worksheets(1).Range("A1") = Date
  
  End If
Next wb

End Sub
Option Explicit
                      'Remember to add a reference to Microsoft Visual Basic for Applications Extensibility 
                      'Exports all VBA project components containing code to a folder in the same directory as this spreadsheet.
                      Public Sub ExportAllComponents()
                          Dim VBComp As VBIDE.VBComponent
                          Dim destDir As String, fName As String, ext As String 
                          'Create the directory where code will be created.
                          'Alternatively, you could change this so that the user is prompted
                          If ActiveWorkbook.Path = "" Then
                              MsgBox "You must first save this workbook somewhere so that it has a path.", , "Error"
                              Exit Sub
                          End If
                          destDir = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name & " Modules"
                          If Dir(destDir, vbDirectory) = vbNullString Then MkDir destDir
                          
                          'Export all non-blank components to the directory
                          For Each VBComp In ActiveWorkbook.VBProject.VBComponents
                              If VBComp.CodeModule.CountOfLines > 0 Then
                                  'Determine the standard extention of the exported file.
                                  'These can be anything, but for re-importing, should be the following:
                                  Select Case VBComp.Type
                                      Case vbext_ct_ClassModule: ext = ".cls"
                                      Case vbext_ct_Document: ext = ".cls"
                                      Case vbext_ct_StdModule: ext = ".bas"
                                      Case vbext_ct_MSForm: ext = ".frm"
                                      Case Else: ext = vbNullString
                                  End Select
                                  If ext <> vbNullString Then
                                      fName = destDir & "\" & VBComp.Name & ext
                                      'Overwrite the existing file
                                      'Alternatively, you can prompt the user before killing the file.
                                      If Dir(fName, vbNormal) <> vbNullString Then Kill (fName)
                                      VBComp.Export (fName)
                                  End If
                              End If
                          Next VBComp
                      End Sub
                      
' Req'd Refs: Late Binding  -> None required
'             Early Binding -> Microsoft Scripting Runtime
#Const FSO_EarlyBind = True
#If FSO_EarlyBind = True Then
    Private pFSO                As Scripting.FileSystemObject
#Else
    Private pFSO                As Object
#End If


#If FSO_EarlyBind = True Then
Public Function oFSO() As Scripting.FileSystemObject
#Else
Public Function oFSO() As Object
#End If
    If pFSO Is Nothing Then
        #If FSO_EarlyBind = True Then
            Set pFSO = New FileSystemObject
        #Else
            Set pFSO = CreateObject("Scripting.FileSystemObject")
        #End If
    End If
    Set oFSO = pFSO
End Function

Public Sub oFSO_Clear()
    'Be sure to always run this when closing your Form/DB to avoid
    '   hidden instances from running in the background!
    Set pFSO = Nothing
End Sub
Sub SendOutlookMessages()'Dimension variables.
    Dim OL As Object, MailSendItem As Object
    Dim W As Object
    Dim MsgTxt As String, SendFile As String
    Dim ToRangeCounter As Variant
    
    'Identifies Word file to send
    SendFile = Application.GetOpenFilename(Title:="Select MS Word " & _
    "file to mail, then click 'Open'", buttontext:="Send", _
    MultiSelect:=False)'Starts Word session
    Set W = GetObject(SendFile)'Pulls text from file for message body
    MsgTxt = W.Range(Start:=W.Paragraphs(1).Range.Start, _
    End:=W.Paragraphs(W.Paragraphs.Count).Range.End)'Ends Word session
    Set W = Nothing
    
    'Starts Outlook session
    Set OL = CreateObject("Outlook.Application")
    Set MailSendItem = OL.CreateItem(olMailItem)
    
    ToRangeCounter = 0
    
    'Identifies number of recipients for To list.
    For Each xCell In ActiveSheet.Range(Range("tolist"), _
    Range("tolist").End(xlToRight))
    ToRangeCounter = ToRangeCounter + 1
    Next xCell
    
    If ToRangeCounter = 256 Then ToRangeCounter = 1
    
    'Creates message
    With MailSendItem
    .Subject = ActiveSheet.Range("subjectcell").Text
    .Body = MsgTxt
    
    'Creates "To" list
    For Each xRecipient In Range("tolist").Resize(1, ToRangeCounter)
    RecipientList = RecipientList & ";" & xRecipient
    Next xRecipient
    
    .To = RecipientList
    .Send
    End With
    
    'Ends Outlook session
    Set OL = Nothing
    
End Sub
Sub SendOutlookMessages()'Dimension variables.
    Dim OL As Object, MailSendItem As Object
    Dim W As Object
    Dim MsgTxt As String, SendFile As String
    Dim ToRangeCounter As Variant
    
    'Identifies Word file to send
    SendFile = Application.GetOpenFilename(Title:="Select MS Word " & _
    "file to mail, then click 'Open'", buttontext:="Send", _
    MultiSelect:=False)'Starts Word session
    Set W = GetObject(SendFile)'Pulls text from file for message body
    MsgTxt = W.Range(Start:=W.Paragraphs(1).Range.Start, _
    End:=W.Paragraphs(W.Paragraphs.Count).Range.End)'Ends Word session
    Set W = Nothing
    
    'Starts Outlook session
    Set OL = CreateObject("Outlook.Application")
    Set MailSendItem = OL.CreateItem(olMailItem)
    
    ToRangeCounter = 0
    
    'Identifies number of recipients for To list.
    For Each xCell In ActiveSheet.Range(Range("tolist"), _
    Range("tolist").End(xlToRight))
    ToRangeCounter = ToRangeCounter + 1
    Next xCell
    
    If ToRangeCounter = 256 Then ToRangeCounter = 1
    
    'Creates message
    With MailSendItem
    .Subject = ActiveSheet.Range("subjectcell").Text
    .Body = MsgTxt
    
    'Creates "To" list
    For Each xRecipient In Range("tolist").Resize(1, ToRangeCounter)
    RecipientList = RecipientList & ";" & xRecipient
    Next xRecipient
    
    .To = RecipientList
    .Send
    End With
    
    'Ends Outlook session
    Set OL = Nothing
    
End Sub
' Variable declarations
Dim blNotFirstIteration As Boolean
Dim Fil As File
Dim hFolder As Folder, SubFolder As Folder
Dim FileExt As String
Dim FSO As Scripting.FileSystemObject

' Recursive procedure for iterating through all files in all subfolders
' of a folder and locating specific file types by file extension.
Sub FindFilesInFolders(ByVal HostFolder As String, FileTypes As Variant)
'(1) This routine uses Early Binding so you must add reference to Microsoft Scripting Runtime:
' Tools > References > Microsoft Scripting Runtime
'(2) Call procedure using a command like:
' Call FindFilesInFolders("C:\Users\MHS\Documents", Array("xlsm", "xlsb"))
    If FSO Is Nothing Then Set FSO = New Scripting.FileSystemObject
    Set hFolder = FSO.GetFolder(HostFolder)

    ' iterate through all files in the root of the main folder
    If Not blNotFirstIteration Then
      For Each Fil In hFolder.Files
          FileExt = FSO.GetExtensionName(Fil.Path)
    
          ' check if current file matches one of the specified file types
          If Not IsError(Application.Match(FileExt, FileTypes, 0)) Then
              ' ****************************************
              ' Insert your code here
              ' ****************************************
              Cells(WorksheetFunction.CountA(Range("A:A")) + 1, 1) = Fil.Path
          End If
      Next Fil
    
      ' make recursive call, if main folder contains subfolder
      If Not hFolder.SubFolders Is Nothing Then
          blNotFirstIteration = True
          Call FindFilesInFolders(HostFolder, FileTypes)
      End If
    
    ' iterate through all files in all the subfolders of the main folder
    Else
      For Each SubFolder In hFolder.SubFolders
          For Each Fil In SubFolder.Files
              FileExt = FSO.GetExtensionName(Fil.Path)
    
              ' check if current file matches one of the specified file types
              If Not IsError(Application.Match(FileExt, FileTypes, 0)) Then
                  ' ****************************************
                  ' Insert your code here
                  ' ****************************************
                  Cells(WorksheetFunction.CountA(Range("A:A")) + 1, 1) = Fil.Path
              End If
          Next Fil
    
          ' make recursive call, if subfolder contains subfolders
          If Not SubFolder.SubFolders Is Nothing Then _
              Call FindFilesInFolders(HostFolder & "\" & SubFolder.Name, FileTypes)
    
      Next SubFolder
    End If
    blNotFirstIteration = False
End Sub
Sub AllEnvironVariables()
    Dim strEnviron As String
    Dim VarSplit As Variant
    Dim i As Long
    For i = 1 To 255
        strEnviron = Environ$(i)
        If LenB(strEnviron) = 0& Then GoTo TryNext:
        VarSplit = Split(strEnviron, "=")
        If UBound(VarSplit) > 1 Then Stop
        Range("A" & Range("A" & Rows.Count).End(xlUp).Row + 1).Value = i
        Range("B" & Range("B" & Rows.Count).End(xlUp).Row + 1).Value = VarSplit(0)
        Range("C" & Range("C" & Rows.Count).End(xlUp).Row + 1).Value = VarSplit(1)
TryNext:
    Next
End Sub
Sub GetWordData()
'Note: this code requires a reference to the Word object model. See under the VBE's Tools|References.
Application.ScreenUpdating = False
Dim wdApp As New Word.Application, wdDoc As Word.Document, c As Long, r As Long
Dim strFolder As String, strFile As String, WkBk As Workbook, WkSht As Worksheet
strFolder = GetFolder: If strFolder = "" Then GoTo ErrExit
Set WkBk = ActiveWorkbook
strFile = Dir(strFolder & "\*.docx", vbNormal)
While strFile <> ""
  Set wdDoc = wdApp.Documents.Open(Filename:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False)
  Set WkSht = WkBk.Sheets.Add: r = 4
  WkSht.Name = Split(strFile, ".doc")(0)
  WkBk.Sheets(1).Range.Copy
  WkSht.Paste
  WkSht.Range("A2").Value = WkSht.Name
  With wdDoc
    With .Range
      With .Find
        .ClearFormatting
        .Replacement.ClearFormatting
        'Find blocks of text of interest
        .Text = "Uid:*Units:*^13"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindStop
        .MatchWildcards = True
        .Execute
      End With
      Do While .Find.Found
        r = r + 1
        'Parse & write the text to Excel
        For c = 1 To 4
          WkSht.Cells(r, c).Value = Trim(Split(Split(.Text, vbCr)(c - 1), ":")(1))
        Next
        .Collapse wdCollapseEnd
        .Find.Execute
      Loop
    End With
    .Close SaveChanges:=False
  End With
  strFile = Dir()
Wend
ErrExit:
wdApp.Quit
Set wdDoc = Nothing: Set wdApp = Nothing: Set WkSht = Nothing: Set WkBk = Nothing
Application.ScreenUpdating = True
End Sub

Function GetFolder() As String
    Dim oFolder As Object
    GetFolder = ""
    Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
    If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
    Set oFolder = Nothing
End Function
Sub GetWordData()
'Note: this code requires a reference to the Word object model. See under the VBE's Tools|References.
Application.ScreenUpdating = False
Dim wdApp As New Word.Application, wdDoc As Word.Document, c As Long, r As Long
Dim strFolder As String, strFile As String, WkBk As Workbook, WkSht As Worksheet
strFolder = GetFolder: If strFolder = "" Then GoTo ErrExit
Set WkBk = ActiveWorkbook
strFile = Dir(strFolder & "\*.docx", vbNormal)
While strFile <> ""
  Set wdDoc = wdApp.Documents.Open(Filename:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False)
  Set WkSht = WkBk.Sheets.Add: r = 4
  WkSht.Name = Split(strFile, ".doc")(0)
  WkBk.Sheets(1).Range.Copy
  WkSht.Paste
  WkSht.Range("A2").Value = WkSht.Name
  With wdDoc
    With .Range
      With .Find
        .ClearFormatting
        .Replacement.ClearFormatting
        'Find blocks of text of interest
        .Text = "Uid:*Units:*^13"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindStop
        .MatchWildcards = True
        .Execute
      End With
      Do While .Find.Found
        r = r + 1
        'Parse & write the text to Excel
        For c = 1 To 4
          WkSht.Cells(r, c).Value = Trim(Split(Split(.Text, vbCr)(c - 1), ":")(1))
        Next
        .Collapse wdCollapseEnd
        .Find.Execute
      Loop
    End With
    .Close SaveChanges:=False
  End With
  strFile = Dir()
Wend
ErrExit:
wdApp.Quit
Set wdDoc = Nothing: Set wdApp = Nothing: Set WkSht = Nothing: Set WkBk = Nothing
Application.ScreenUpdating = True
End Sub

Function GetFolder() As String
    Dim oFolder As Object
    GetFolder = ""
    Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
    If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
    Set oFolder = Nothing
End Function
Sub ShowDriveList
    Dim fs, d, dc, s, n
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set dc = fs.Drives
    For Each d in dc
        s = s & d.DriveLetter & " - " 
        If d.DriveType = 3 Then
            n = d.ShareName
        Else
            n = d.VolumeName
        End If
        s = s & n & vbCrLf
    Next
    MsgBox s
End Sub
star

Wed May 08 2024 13:15:12 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge #zoho

star

Wed May 08 2024 12:55:52 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v

@Mariukas45

star

Wed May 08 2024 12:34:15 GMT+0000 (Coordinated Universal Time)

@eguajardo

star

Wed May 08 2024 12:31:04 GMT+0000 (Coordinated Universal Time)

@Jotab

star

Wed May 08 2024 12:02:19 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Wed May 08 2024 11:31:43 GMT+0000 (Coordinated Universal Time) https://tailwindcss.com/docs/guides/symfony

@TheLands

star

Wed May 08 2024 09:26:29 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 08 2024 09:06:34 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 08 2024 08:48:59 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/48915773/cypress-test-if-element-does-not-exist

@al.thedigital #shouldnot #notexist

star

Wed May 08 2024 08:41:45 GMT+0000 (Coordinated Universal Time) https://glebbahmutov.com/cypress-examples/recipes/hide-input-fields.html

@al.thedigital #javascript

star

Wed May 08 2024 08:32:01 GMT+0000 (Coordinated Universal Time)

@signup

star

Wed May 08 2024 07:48:56 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #css

star

Wed May 08 2024 07:05:46 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #php

star

Wed May 08 2024 06:58:18 GMT+0000 (Coordinated Universal Time)

@ash1i

star

Wed May 08 2024 04:31:26 GMT+0000 (Coordinated Universal Time)

@vishalsingh21

star

Wed May 08 2024 04:12:48 GMT+0000 (Coordinated Universal Time)

@Saging

star

Wed May 08 2024 04:12:12 GMT+0000 (Coordinated Universal Time)

@Saging

star

Wed May 08 2024 04:11:46 GMT+0000 (Coordinated Universal Time)

@Saging

star

Wed May 08 2024 03:49:08 GMT+0000 (Coordinated Universal Time)

@kervinandy123 #c

star

Wed May 08 2024 03:42:30 GMT+0000 (Coordinated Universal Time)

@Saging

star

Tue May 07 2024 22:38:42 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Tue May 07 2024 22:26:28 GMT+0000 (Coordinated Universal Time)

@madgakantara

star

Tue May 07 2024 17:09:13 GMT+0000 (Coordinated Universal Time)

@agung #aws #ec2

star

Tue May 07 2024 16:13:39 GMT+0000 (Coordinated Universal Time)

@CarlosR

star

Tue May 07 2024 10:43:01 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #html #php

star

Tue May 07 2024 08:03:14 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/f7aca05f-2e9f-4596-ba4e-ae1b91e73435

@jass855

star

Tue May 07 2024 07:59:26 GMT+0000 (Coordinated Universal Time)

@jass855 #python

star

Tue May 07 2024 07:52:36 GMT+0000 (Coordinated Universal Time) https://cloud.google.com/python/docs/reference/aiplatform/latest/index.html

@rosa

star

Tue May 07 2024 07:34:17 GMT+0000 (Coordinated Universal Time) https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal

@rosa #python

star

Tue May 07 2024 06:04:55 GMT+0000 (Coordinated Universal Time)

@proxylabs

star

Tue May 07 2024 06:03:34 GMT+0000 (Coordinated Universal Time)

@proxylabs

star

Tue May 07 2024 05:58:56 GMT+0000 (Coordinated Universal Time)

@proxylabs

star

Tue May 07 2024 05:34:17 GMT+0000 (Coordinated Universal Time)

@proxylabs

star

Mon May 06 2024 22:04:55 GMT+0000 (Coordinated Universal Time) https://www.thespreadsheetguru.com/loop-open-workbooks-and-modify/

@acassell

star

Mon May 06 2024 21:33:34 GMT+0000 (Coordinated Universal Time) https://www.experts-exchange.com/articles/1457/Automate-Exporting-all-Components-in-an-Excel-Project.html

@acassell

star

Mon May 06 2024 21:31:28 GMT+0000 (Coordinated Universal Time) https://www.devhut.net/vba-fso-files-folders-drives-and-more/

@acassell

star

Mon May 06 2024 21:24:33 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/outlook/troubleshoot/development/vba-macro-that-uses-data-from-word-and-excel-to-send-messages?source

@acassell

star

Mon May 06 2024 21:22:08 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/outlook/troubleshoot/development/vba-macro-that-uses-data-from-word-and-excel-to-send-messages?source

@acassell

star

Mon May 06 2024 21:20:52 GMT+0000 (Coordinated Universal Time) https://wellsr.com/vba/2018/excel/list-files-in-folder-and-subfolders-with-vba-filesystemobject/

@acassell

star

Mon May 06 2024 21:18:48 GMT+0000 (Coordinated Universal Time) https://wellsr.com/vba/2019/excel/list-all-environment-variables-with-vba-environ/

@acassell

star

Mon May 06 2024 21:04:29 GMT+0000 (Coordinated Universal Time) https://chandoo.org/forum/threads/macro-to-extract-text-from-word-doc.43933/

@acassell

star

Mon May 06 2024 20:55:14 GMT+0000 (Coordinated Universal Time) https://chandoo.org/forum/threads/macro-to-extract-text-from-word-doc.43933/

@acassell

star

Mon May 06 2024 20:53:39 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/drives-property

@acassell

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension