Snippets Collections
int setBit(int n)
    {
        // Write Youwhile(r Code here
        int count=0;
        while((n%2)!=0)
    {
        n=n>>1;
        count++;
    }
    n=n+1;
    for(int i=0;i<count;++i)
    {
        n=n*2+1;
    }
        return n;
    }
int setBit(int n)
    {
        // Write Youwhile(r Code here
        int count=0;
        while((n%2)!=0)
    {
        n=n>>1;
        count++;
    }
    n=n+1;
    for(int i=0;i<count;++i)
    {
        n=n*2+1;
    }
        return n;
    }
// Holds the state of the button
int buttonState = 0;

void setup() {
  // Open a serial connection to display values
  Serial.begin(9600);

  // Set the LED pins as outputs
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);

  // Setting the button as input
  pinMode(2, INPUT);  
}

void loop() {
  // Read value of button
  buttonState = digitalRead(2);

  // If button is not pressed, then the green LED is turned on while the other red LEDs are not
  if (buttonState == LOW) {
    Serial.println("Engaging Hyperdrive");
    digitalWrite(3, HIGH);
    digitalWrite(4, LOW);
    digitalWrite(5, LOW);
  }

  // Else if button is pressed, then both of the red LEDs are turned on while the green LED is turned off
  else {
    Serial.println("Firing Lasers");
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);

    delay(250);
    digitalWrite(4, HIGH);
    digitalWrite(5, LOW);
    delay(250);

  }

}
int removeDuplicates(vector<int>& nums) {
        int size = nums.size();

        int right =1,left = 0;
        while (right < size)
        {
            if ((nums[left] != nums[right]) && (right - left == 1))
            {
            left++;
            right++;
            }
            else if (nums[left] == nums[right])
            {
            right++;
            }
            else
            {
            nums[++left] = nums[right++];
            }
        }


    return left + 1;
        
    }
let
    Source = Csv.Document(File.Contents("C:\Users\Marchand.Olivier\Desktop\PLT_BYTEL_PROJETS_DEMANDE_SDL_20240523_062724.csv"),[Delimiter="¤", Encoding=1252]),
    #"En-têtes promus" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Type modifié" = Table.TransformColumnTypes(#"En-têtes promus",{{"NUM_PROJET", type text}, {"NUM_TACHE", type text}, {"NUM_DO", type text}, {"NUM_DEMANDE_SDL", type text}, {"TYPE_LIEN", type text}, {"CSG", type text}})
in
    #"Type modifié"
let
    Source = Folder.Files("\\demasriis14\bytelimportscript\output\success"),
    #"Lignes filtrées" = Table.SelectRows(Source, each Text.StartsWith([Name], "PLT_BYTEL_NODE")),
    #"Lignes filtrées1" = Table.SelectRows(#"Lignes filtrées", let latest = List.Max(#"Lignes filtrées"[Date created]) in each [Date created] = latest),
    #"Fichiers masqués filtrés1" = Table.SelectRows(#"Lignes filtrées1", each [Attributes]?[Hidden]? <> true),
    #"Appeler une fonction personnalisée1" = Table.AddColumn(#"Fichiers masqués filtrés1", "Transformer le fichier", each #"Transformer le fichier"([Content])),
    #"Colonnes renommées1" = Table.RenameColumns(#"Appeler une fonction personnalisée1", {"Name", "Source.Name"}),
    #"Autres colonnes supprimées1" = Table.SelectColumns(#"Colonnes renommées1", {"Source.Name", "Transformer le fichier"}),
    #"Colonne de tables développée1" = Table.ExpandTableColumn(#"Autres colonnes supprimées1", "Transformer le fichier", Table.ColumnNames(#"Transformer le fichier"(#"Exemple de fichier")))
in
    #"Colonne de tables développée1"
%%[
set @language = System_Language__c
Set @FRvalue= "fr_" 
/* Does it match; ; if no match, output of IndexOf(1,2) will be "0" */ 


if @language == "French" OR IndexOf(@language,@FRvalue) > 0 then 
Set @subjectline = "Vous êtes sur la liste pour recevoir les dernières nouvelles concernant Cat® Vantage" 
else 
Set @subjectline = "You're on the list for the latest news for Cat® Vantage Rewards!"
endif

]%%
The tech- industry is evolving and software development is constantly astonishing its path due to the emergence of new technologies, various factors, and frequent upgrades in societal demands. Let’s see a few trendsetting software development trends that will enhance your business technologically.

Artificial Intelligence (AI) and Machine learning
Progressive Web Apps (PWAs)
Internet of Things (IoT)
Edge computing
5G Technology
Blockchain 
Cyber security
Cloud Computing
Quantum Computing
 Low code/No code Development

With these booming trendsetters, you can formulate digital acceleration in your business software, to drive remarkable results. Get started to empower your business, by incorporating these cutting-edge technological stacks.

If you are confused about how to opt for the right technology for your business software, then get started with the right software consulting company for conventional direction or you may hire suitable software consultants in the industry. check out >> https://maticz.com/software-consulting-services

bundle exec rails db < my_db.sql
optimizer = tf.keras.optimizers.Adam()

# Define your loss function (e.g., Mean Squared Error)
mse_loss_fn = tf.keras.losses.MeanSquaredError()

# Compile the model
cvae_model.compile(optimizer=optimizer, loss=mse_loss_fn)

# Train the model
cvae_model.fit([data, clusters], data, epochs=10, batch_size=32)
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

sk-proj-FrAcuJSTxPSFr9DNpCc6T3BlbkFJxsg70pKZaJdlDMscfBhL


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

sk-proj-cwkoOcKTTpuwjPgVbU9AT3BlbkFJ4o2iDTsWWLckZhIkX1Zt

https://go.microsoft.com/fwlink/?linkid=2213926

curl https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/extensions/chat/completions?api-version=2023-12-01-preview \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_API_KEY" \
  -d '{"enhancements":{"ocr":{"enabled":true},"grounding":{"enabled":true}},"dataSources":[{"type":"AzureComputerVision","parameters":{"endpoint":" <Computer Vision Resource Endpoint> ","key":"<Computer Vision Resource Key>"}}],"messages":[{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":[{"type":"text","text":"Describe this picture:"},{"type":"image_url","image_url":"https://learn.microsoft.com/azure/ai-services/computer-vision/media/quickstarts/presentation.png"}]}]}'
root@kali:~# above -h
                                        
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   @   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   @@@   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  @@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@                                         @@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@@   @@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@                                     @@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
                                        
                       Invisible network protocol sniffer
                 Designed for pentesters and security engineers
              Version 2.4, Codename: My Own Summer (Shove It)
               Author: Magama Bazarov, <caster@exploit.org>
usage: above [-h] [--interface INTERFACE] [--timer TIMER]
             [--output-pcap OUTPUT_FILE] [--input-pcap INPUT_FILE]

options:
  -h, --help            show this help message and exit
  --interface INTERFACE
                        Specify the interface
  --timer TIMER         Specify the timer value (seconds)
  --output-pcap OUTPUT_FILE
                        Specify the output pcap file to record traffic (hot
                        mode)
  --input-pcap INPUT_FILE
                        Specify the input pcap file to analyze traffic (cold
                        mode)
root@kali:~# 7zr -h

7-Zip (r) 23.01 (x64) : Igor Pavlov : Public domain : 2023-06-20
 64-bit locale=C.UTF-8 Threads:8 OPEN_MAX:1024

Usage: 7zr <command> [<switches>...] <archive_name> [<file_names>...] [@listfile]

<Commands>
  a : Add files to archive
  b : Benchmark
  d : Delete files from archive
  e : Extract files from archive (without using directory names)
  h : Calculate hash values for files
  i : Show information about supported formats
  l : List contents of archive
  rn : Rename files in archive
  t : Test integrity of archive
  u : Update files to archive
  x : eXtract files with full paths

<Switches>
  -- : Stop switches and @listfile parsing
  -ai[r[-|0]]{@listfile|!wildcard} : Include archives
  -ax[r[-|0]]{@listfile|!wildcard} : eXclude archives
  -ao{a|s|t|u} : set Overwrite mode
  -an : disable archive_name field
  -bb[0-3] : set output log level
  -bd : disable progress indicator
  -bs{o|e|p}{0|1|2} : set output stream for output/error/progress line
  -bt : show execution time statistics
  -i[r[-|0]]{@listfile|!wildcard} : Include filenames
  -m{Parameters} : set compression Method
    -mmt[N] : set number of CPU threads
    -mx[N] : set compression level: -mx1 (fastest) ... -mx9 (ultra)
  -o{Directory} : set Output directory
  -p{Password} : set Password
  -r[-|0] : Recurse subdirectories for name search
  -sa{a|e|s} : set Archive name mode
  -scc{UTF-8|WIN|DOS} : set charset for console input/output
  -scs{UTF-8|UTF-16LE|UTF-16BE|WIN|DOS|{id}} : set charset for list files
  -scrc[CRC32|CRC64|SHA1|SHA256|*] : set hash function for x, e, h commands
  -sdel : delete files after compression
  -seml[.] : send archive by email
  -sfx[{name}] : Create SFX archive
  -si[{name}] : read data from stdin
  -slp : set Large Pages mode
  -slt : show technical information for l (List) command
  -snh : store hard links as links
  -snl : store symbolic links as links
  -sni : store NT security information
  -sns[-] : store NTFS alternate streams
  -so : write data to stdout
  -spd : disable wildcard matching for file names
  -spe : eliminate duplication of root folder for extract command
  -spf[2] : use fully qualified file paths
  -ssc[-] : set sensitive case mode
  -sse : stop archive creating, if it can't open some input file
  -ssp : do not change Last Access Time of source files while archiving
  -ssw : compress shared files
  -stl : set archive timestamp from the most recently modified file
  -stm{HexMask} : set CPU thread affinity mask (hexadecimal number)
  -stx{Type} : exclude archive type
  -t{Type} : Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName] : Update options
  -v{Size}[b|k|m|g] : Create volumes
  -w[{path}] : assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]{@listfile|!wildcard} : eXclude filenames
  -y : assume Yes on all queries
http://rpc.pingomatic.com
http://rpc.twingly.com
http://www.blogdigger.com/RPC2
http://ping.blo.gs/
http://ping.feedburner.com
http://rpc.weblogs.com/RPC2
http://www.pingmyblog.com
root@kali:~# wifite -h
   .               .    
 .´  ·  .     .  ·  `.  wifite2 2.7.0
 :  :  :  (¯)  :  :  :  a wireless auditor by derv82
 `.  ·  ` /¯\ ´  ·  .´  maintained by kimocoder
   `     /¯¯¯\     ´    https://github.com/kimocoder/wifite2

options:
  -h, --help                                 show this help message and exit

SETTINGS:
  -v, --verbose                              Shows more options (-h -v). Prints commands and outputs. (default:
                                             quiet)
  -i [interface]                             Wireless interface to use, e.g. wlan0mon (default: ask)
  -c [channel]                               Wireless channel to scan e.g. 1,3-6 (default: all 2Ghz channels)
  -inf, --infinite                           Enable infinite attack mode. Modify scanning time with -p (default:
                                             off)
  -mac, --random-mac                         Randomize wireless card MAC address (default: off)
  -p [scan_time]                             Pillage: Attack all targets after scan_time (seconds)
  --kill                                     Kill processes that conflict with Airmon/Airodump (default: off)
  -pow [min_power], --power [min_power]      Attacks any targets with at least min_power signal strength
  --skip-crack                               Skip cracking captured handshakes/pmkid (default: off)
  -first [attack_max], --first [attack_max]  Attacks the first attack_max targets
  -ic, --ignore-cracked                      Hides previously-cracked targets. (default: off)
  --clients-only                             Only show targets that have associated clients (default: off)
  --nodeauths                                Passive mode: Never deauthenticates clients (default: deauth targets)
  --daemon                                   Puts device back in managed mode after quitting (default: off)

WEP:
  --wep                                      Show only WEP-encrypted networks
  --require-fakeauth                         Fails attacks if fake-auth fails (default: off)
  --keep-ivs                                 Retain .IVS files and reuse when cracking (default: off)

WPA:
  --wpa                                      Show only WPA-encrypted networks (includes WPS)
  --new-hs                                   Captures new handshakes, ignores existing handshakes in hs (default:
                                             off)
  --dict [file]                              File containing passwords for cracking (default: /usr/share/dict/wordlist-
                                             probable.txt)

WPS:
  --wps                                      Show only WPS-enabled networks
  --wps-only                                 Only use WPS PIN & Pixie-Dust attacks (default:
                                             off)
  --bully                                    Use bully program for WPS PIN & Pixie-Dust attacks (default:
                                             reaver)
  --reaver                                   Use reaver program for WPS PIN & Pixie-Dust attacks (default:
                                             reaver)
  --ignore-locks                             Do not stop WPS PIN attack if AP becomes locked (default:
                                             stop)

PMKID:
  --pmkid                                    Only use PMKID capture, avoids other WPS & WPA attacks (default:
                                             off)
  --no-pmkid                                 Don't use PMKID capture (default: off)
  --pmkid-timeout [sec]                      Time to wait for PMKID capture (default: 300 seconds)

COMMANDS:
  --cracked                                  Print previously-cracked access points
  --check [file]                             Check a .cap file (or all hs/*.cap files) for WPA handshakes
  --crack                                    Show commands to crack a captured handshake
		blueprint_details = invokeurl
		[
			url: "https://www.zohoapis.com/crm/v5/Deals/"+DealID+"/actions/blueprint"
			type: GET
			connection:"zoho_crm"
		];
	// 	info blueprint_details;
		blueprint = Map();
		blueprint.put("transition_id","6051205000002261178");
	// 	blueprint.put("data",dataMap);
		blueprintList = List();
		blueprintList.add(blueprint);
		param = Map();
		param.put("blueprint",blueprintList);
		update_blueprint_stage = invokeurl
		[
		url :"https://www.zohoapis.com/crm/v5/Deals/" + DealID + "/actions/blueprint"
		type :PUT
		parameters:param.toString()
		connection:"zoho_crm"
		];
		info update_blueprint_stage;
{
  // You probably don't need to set anything in the configuration,
  // we infer a lot of information from the repo. One value that's worth
  // setting is your default sandbox ids to fork for a PR. It's easier to test
  // on a sandbox that includes some test cases already.
  // This is also optional, we default to 'vanilla' if it isn't set.
  "sandboxes": ["new", "vanilla"]
}
{
  // You probably don't need to set anything in the configuration,
  // we infer a lot of information from the repo. One value that's worth
  // setting is your default sandbox ids to fork for a PR. It's easier to test
  // on a sandbox that includes some test cases already.
  // This is also optional, we default to 'vanilla' if it isn't set.
  "sandboxes": ["new", "vanilla"]
}
{
  // You probably don't need to set anything in the configuration,
  // we infer a lot of information from the repo. One value that's worth
  // setting is your default sandbox ids to fork for a PR. It's easier to test
  // on a sandbox that includes some test cases already.
  // This is also optional, we default to 'vanilla' if it isn't set.
  "sandboxes": ["new", "vanilla"]
}
{
  // You probably don't need to set anything in the configuration,
  // we infer a lot of information from the repo. One value that's worth
  // setting is your default sandbox ids to fork for a PR. It's easier to test
  // on a sandbox that includes some test cases already.
  // This is also optional, we default to 'vanilla' if it isn't set.
  "sandboxes": ["new", "vanilla"]
}
function onOpen() {
  var ui = SpreadsheetApp.getUi();
  ui.createMenu('Custom Menu')
      .addItem('Update Master Summary', 'updateMasterSummaryBasedOnConfiguration')
      .addItem('Update Configuration', 'updateConfiguration')
      .addItem('Update Consolidated Master', 'updateConsolidatedMaster')
       .addItem('Update Consolidated Rejected', 'updateConsolidatedRejected')
      .addToUi();
}

function updateMasterSummaryBasedOnConfiguration() {
  var statusNames = ["RFQ SENT", "PART NUMBER SET UP", "SOURCED", "DEVELOPING", "AWAITING SAMPLE", "SAMPLE RECEIVED", "PIES COLLECTION", "PIES APPROVED", "PIES REJECTED", "PM APPROVED", "PRICING", "COMPLETE", "TERMINATED"];

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var masterSheet = spreadsheet.getSheetByName("Master Summary");
  var configSheet = spreadsheet.getSheetByName("Configuration");

  // Clear existing content in Master Summary sheet excluding the first column
  var rangeToClear = masterSheet.getRange("B:ZZ");
  rangeToClear.clear();

  // Get tab names and their statuses from the Configuration sheet
  var rangeData = configSheet.getRange("A:B").getValues();
  var tabNames = [];
  var tabStatuses = [];

  // Populate tabNames and tabStatuses arrays
  for (var i = 0; i < rangeData.length; i++) {
    var tabName = rangeData[i][0];
    var status = rangeData[i][1];
    if (tabName && status) { // Ensure both tab name and status exist
      tabNames.push(tabName);
      tabStatuses.push(status.toLowerCase()); // Convert status to lowercase for consistency
    }
  }

  // Set the headers for active tabs and count status for each tab
  var activeTabs = tabNames.filter(function(_, index) {
    return tabStatuses[index] === "active";
  });

  // Set the headers for active tabs in Master Summary
  var headerRowData = ['Status', 'Total Parts Count'].concat(activeTabs);
  masterSheet.getRange(1, 1, 1, headerRowData.length).setValues([headerRowData]);

  // Create a 2D array to hold all the data to be written to the Master Summary sheet
  var outputData = statusNames.map(function(statusName) {
    return [statusName, 0].concat(new Array(activeTabs.length).fill(0));
  });

  // Add a row for the total counts
  var totalCountsRow = ['TotTotal Parts Count', 0].concat(new Array(activeTabs.length).fill(0));
  outputData.push(totalCountsRow);

  // Iterate over active tabs and count the statuses
  activeTabs.forEach(function(tabName, tabIndex) {
    var sheet = spreadsheet.getSheetByName(tabName);
    if (sheet) {
      var values = sheet.getRange("A:A").getValues().flat();
      var statusCounts = statusNames.reduce(function(counts, status) {
        counts[status] = 0;
        return counts;
      }, {});

      // Count the statuses
      values.forEach(function(value) {
        var upperValue = value.toString().toUpperCase();
        if (statusCounts.hasOwnProperty(upperValue)) {
          statusCounts[upperValue]++;
        }
      });

      // Fill the outputData array with counts
      statusNames.forEach(function(statusName, statusIndex) {
        var count = statusCounts[statusName] || 0;
        outputData[statusIndex][tabIndex + 2] = count; // Insert count into corresponding column
        outputData[statusIndex][1] += count; // Add count to the total column
        totalCountsRow[tabIndex + 2] += count; // Add count to the total row
      });
      totalCountsRow[1] += totalCountsRow[tabIndex + 2]; // Add total of current tab to the grand total
    }
  });

  // Write the collected data to the sheet in one operation
  masterSheet.getRange(2, 1, outputData.length, outputData[0].length).setValues(outputData);
}

function updateConfiguration() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var configSheet = spreadsheet.getSheetByName("Configuration");

  // Fetch existing sheet names from Configuration sheet
  var existingSheetNames = configSheet.getRange("A2:A").getValues().flat().filter(function(name) {
    return name; // Filter out empty values
  });

  // Fetch all sheet names excluding "Configuration" and "Master Summary"
  var allSheetNames = spreadsheet.getSheets().map(function(sheet) {
    return sheet.getName();
  }).filter(function(name) {
    return name !== "Configuration" && name !== "Master Summary";
  });

  // Filter out existing sheet names from all sheet names
  var newSheetNames = allSheetNames.filter(function(name) {
    return !existingSheetNames.includes(name);
  });

  // Append new sheet names to the Configuration sheet
  if (newSheetNames.length > 0) {
    var startRow = existingSheetNames.length + 2;
    configSheet.getRange(startRow, 1, newSheetNames.length, 1).setValues(newSheetNames.map(function(name) {
      return [name];
    }));

    // Calculate status for new sheet names
    var statusNames = ["RFQ SENT", "PART NUMBER SET UP", "SOURCED", "DEVELOPING", "AWAITING SAMPLE", "SAMPLE RECEIVED", "PIES COLLECTION", "PIES APPROVED", "PIES REJECTED", "PM APPROVED", "PRICING", "COMPLETE", "TERMINATED"];

    for (var k = 0; k < newSheetNames.length; k++) {
      var tabName = newSheetNames[k];
      var isActive = false;

      // Check each status for the current sheet
      for (var i = 0; i < statusNames.length; i++) {
        var status = statusNames[i];
        var count = getCountForStatusInSheet(status, tabName);
        if (count > 0) {
          isActive = true;
          break;
        }
      }

      // Set the status for the current sheet in the Configuration sheet
      var statusCell = configSheet.getRange(startRow + k, 2);
      statusCell.setValue(isActive ? "Active" : "Inactive");
      var statusValidationRule = SpreadsheetApp.newDataValidation()
          .requireValueInList(["Active", "Inactive"], true)
          .build();
      statusCell.setDataValidation(statusValidationRule);
      statusCell.setFontColor(isActive ? "#00FF00" : "#FF0000");
    }
  }
}

function getCountForStatusInSheet(status, sheetName) {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);
  
  // Return 0 if sheet doesn't exist
  if (!sheet) {
    return 0;
  }

  var statusColumn = sheet.getRange("A:A").getValues().flat(); // Assuming statuses are in column A

  // Count occurrences of status
  var count = statusColumn.filter(function(value) {
    return value === status;
  }).length;

  return count;
}

 
function updateConsolidatedMaster() {
  var statusNames = ["RFQ SENT", "PART NUMBER SET UP", "SOURCED", "DEVELOPING", "AWAITING SAMPLE", "SAMPLE RECEIVED", "PIES COLLECTION", "PIES APPROVED", "PIES REJECTED", "PM APPROVED", "PRICING", "COMPLETE"];
  var columnsToCopy = ["Status", "Start Date", "Part Type", "HOL P/N", "OE#", "ALT OE", "MAM Status (change to Dev)", "FP Status (Change to Electronically Announced)", "PartCat Status (Changed to Electronically Announced)", "Interchange", "Interchange Completion", "Parts List/RFQ Submitted to Warren", "Parts List/RFQ Returned to Holstein", "Production Sourced Part is requested from Warren", "ETA of Sample", "Date Prod Sample Delivered to Holstein", "Factory Code"];

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();

  try {
    var masterSheet = spreadsheet.getSheetByName("Consolidated Master");
    var configSheet = spreadsheet.getSheetByName("Configuration");

    // Clear existing content in Consolidated Master sheet
    masterSheet.clear();

    // Get active tab names and their statuses from the Configuration sheet
    var rangeData = configSheet.getRange("A:B").getValues();
    var activeTabs = rangeData.filter(function(row) {
      return row[1] && row[1].toLowerCase() === "active";
    }).map(function(row) {
      return row[0];
    });

    // Initialize variables
    var allData = [];
    var rowIndex = 2;

    // Insert headers
    allData.push(columnsToCopy.concat("MOQ")); // Add MOQ to the header row
    masterSheet.getRange(1, 1, 1, allData[0].length).setValues([allData[0]]);

    // Iterate through active tabs
    activeTabs.forEach(function(tabName) {
      var sheet = spreadsheet.getSheetByName(tabName);
      if (sheet) {
        var sheetData = sheet.getDataRange().getValues();

        // Get column names
        var columnNames = sheetData[1];

        // Iterate through rows (excluding header rows)
        sheetData.slice(2).forEach(function(row) {
          var status = row[0];

          // Check if status is in the list and copy relevant data
          if (statusNames.includes(status)) {
            var rowData = [status];
            columnsToCopy.forEach(function(col) {
              var colIndex = columnNames.indexOf(col);
              if (colIndex !== -1) {
                rowData.push(row[colIndex]);
              }
            });

            // Find MOQ column index and convert date to "1" if found
            var moqIndex = columnNames.indexOf("MOQ");
            if (moqIndex !== -1) {
              var moqValue = row[moqIndex];
              if (typeof moqValue === 'object' && moqValue instanceof Date) {
                rowData.push("1");
              } else {
                rowData.push(moqValue);
              }
            } else {
              rowData.push(""); // Add empty string if MOQ column not found
            }
            allData.push(rowData);
          }
        });
      }
    });

    // Insert all data at once
    if (allData.length > 1) { // Check if there's data to insert
      masterSheet.getRange(rowIndex, 1, allData.length - 1, allData[0].length).setValues(allData.slice(1));
    }
  } catch (error) {
    // Handle errors gracefully (e.g., log error or display message to user)
    console.error("Error occurred:", error);
  }
}


function updateConsolidatedRejected() {
  var statusNames = ["PIES REJECTED"];
  var columnsToCopy = ["STATUS", "Part Type", "HOL P/N", "OE#", "QC Inspection/PIES Collection", "HOL Feedback Sent", "New Sample Requested", "New Sample Received"];
 
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var masterSheet = spreadsheet.getSheetByName("Consolidated Rejected");
  var configSheet = spreadsheet.getSheetByName("Configuration");
 
  // Clear existing content in Consolidated Rejected sheet
  masterSheet.clear();
 
  // Get tab names and their statuses from the Configuration sheet
  var rangeData = configSheet.getRange("A:B").getValues();
  var activeTabs = rangeData.filter(function(row) {
    return row[1] && row[1].toLowerCase() === "active";
  }).map(function(row) {
    return row[0];
  });
 
  // Initialize a variable to keep track of the row to insert data into
  var rowIndex = 2;
 
  // Insert headers for the Consolidated Rejected sheet
  var headers = columnsToCopy;
  masterSheet.getRange(1, 1, 1, headers.length).setValues([headers]);
 
  // Iterate through each active tab
  activeTabs.forEach(function(tabName) {
    var sheet = spreadsheet.getSheetByName(tabName);
    if (sheet) {
      var sheetData = sheet.getDataRange().getValues();
 
      // Get the column names from the second row
      var columnNames = sheetData[1];
 
      // Iterate through each row in the sheet
      sheetData.forEach(function(row, rowIdx) {
        if (rowIdx === 0 || rowIdx === 1) return; // Skip the header rows
 
        var status = row[0]; // Assuming status is in the first column (A)
 
        // If the status is "TERMINATED" or "PIES REJECTED", add it to the Consolidated Rejected sheet
        if (statusNames.includes(status)) {
          var rowData = [];
 
          // Insert the data into the Consolidated Rejected sheet
          columnsToCopy.forEach(function(col) {
            var colIndexInSheet = columnNames.indexOf(col);
            if (colIndexInSheet !== -1) {
              rowData.push(row[colIndexInSheet]);
            } else if (col === "STATUS") {
              rowData.push(status); // Add status directly for the STATUS column
            } else {
              rowData.push(''); // Fill in with an empty string if the column is not found
            }
          });
 
          masterSheet.getRange(rowIndex, 1, 1, rowData.length).setValues([rowData]);
          rowIndex++;
        }
      });
    }
  });
}


from fastapi import FastAPI


db = [
 {'api_key': '437af89f-38ba-44f1-9eda-924f370193d4',
  'tokens': 3,
  'user_id': '6ddf9779-4be7-449c-a70d-51e81c19dd0b'},
 {'api_key': '48762b59-e968-459e-b28d-50e7a1ad37a4', 
  'tokens': 3,
  'user_id': 'daf36850-68ab-40fc-86af-e6093b6797dd'},
 {'api_key': 'dabbd875-acbd-4b98-a47f-a526075d41b4', 
  'tokens': 3,
  'user_id': '5750957f-a246-4290-a35e-2dec83bcfcea'},
 {'api_key': '604d5fe2-f7ce-4560-8137-eeae32091738',
  'tokens': 3,
  'user_id': '2d4ac462-b118-48d7-897e-163c2e8327aa'},
 {'api_key': '8540cbef-de3e-4cbd-83bc-f66297a7f407',
  'tokens': 3,
  'user_id': 'bb435e7e-b5da-4a8c-b860-e43a8e765f67'}
]



app = FastAPI()

def update_tokens_for_user(user_id, api_key):
    for user in db:
        if user['user_id'] == user_id and user['api_key'] == api_key:
            tokens = user['tokens']
            if tokens > 0:
                tokens = tokens - 1
                user['tokens'] = tokens

                return {'tokens': tokens}
            
            else:
                return {'tokens': tokens, 'msg': 'you need to get more tokens'}


@app.get('/test')
def test(user_id : str, api_key: str):
    result = update_tokens_for_user(user_id, api_key)
    if result:
        return result
    else:
        return {'msg': 'api key or user id is not found'}
import pprint

data = {'email': 'test@test.com', 'password': '123'}

print(data, type(data))

# convert dict to str
result = pprint.pformat(data)

print(result, type(result))
{
  // You probably don't need to set anything in the configuration,
  // we infer a lot of information from the repo. One value that's worth
  // setting is your default sandbox ids to fork for a PR. It's easier to test
  // on a sandbox that includes some test cases already.
  // This is also optional, we default to 'vanilla' if it isn't set.
  "sandboxes": ["new", "vanilla"]
}
{
  // You probably don't need to set anything in the configuration,
  // we infer a lot of information from the repo. One value that's worth
  // setting is your default sandbox ids to fork for a PR. It's easier to test
  // on a sandbox that includes some test cases already.
  // This is also optional, we default to 'vanilla' if it isn't set.
  "sandboxes": ["new", "vanilla"]
}
from peewee import Model, SqliteDatabase, CharField, IntegerField, UUIDField
from uuid import uuid4
from faker import Faker
from random import randint

fake = Faker()

db = SqliteDatabase('mydb.db')

class User(Model):
    name = CharField(max_length = 25)
    email = CharField(max_length = 25)
    age = IntegerField()
    password = CharField(max_length = 100)
    user_id = UUIDField(primary_key = True, default = uuid4)

    class Meta:
        database = db


db.connect()
db.create_tables([User])

for i in range(20):
    new_user = User.create(**{
        'name': fake.name(),
        'email': fake.email(),
        'age': randint(12, 45),
        'password': fake.password()
    })

    new_user.save()

db.commit()
<div id="<%= dom_id(question) %>"
  class="grid-stack-item"
  gs-id="<%= question.id %>"
  gs-y="<%= question.position %>"
  gs-x="0"
  gs-w="12"
  gs-h="<%= question.new_record? && 2 %>"
  data-controller="questionnaire-question removable"
  data-action="item:added->questionnaire-question#openEdit questionnaire-question:saved->questionnaire#questionSaved"
  data-questionnaire-target="question"
  data-cy="<%= question.new_record? ? "new-" : "" %>questionnaire-question-<%= question.value_type %>">
  <div class="relative flex items-stretch overflow-visible grid-stack-item-content">
    <div class="flex flex-grow group-[.is-container]:hidden flex-1 items-center cursor-pointer space-x-3 py-1.5 px-4 bg-white rounded-lg dark:bg-gray-800 shadow-light dark:shadow-dark dark:hover:shadow-dark-hover">
      <%= inline_svg_tag "fields/#{question.value_type}.svg", class: "h-4 w-4" %>
      <span class="text-xs font-medium leading-6 text-gray-800 dark:text-gray-200">
        <%= t("value_type_#{question.value_type}", scope: "simple_form.labels.field") %>
      </span>
    </div>
    <div class="hidden group-[.is-container]:flex flex-col w-full">
      <div class="absolute right-5 flex items-center space-x-2.5 top-1/2 -mt-2 z-100">
        <%= render SlideoverComponent.new(title: t(".form_title_#{question.persisted?}"), size: questionnaire_question_slideover_size(question), toggle_actions: ["slideover#close", ("removable#remove" if question.new_record?)].compact) do |component| %>
          <% component.with_button do %>
            <%= button_tag type: "button", class: "h-4", data: {action: "slideover#open", questionnaire_question_target: "edit", cy: "edit-question"} do %>
              <%= heroicon "pencil-square", variant: "outline", options: {class: "w-4 h-4 text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"} %>
            <% end %>
          <% end %>
          <%= render "form", question: %>
        <% end %>
        <%= render ConfirmationModalComponent.new(
          title: t(".delete_title"),
          message: t(".delete_message"),
          form_options: {url: [:settings, question.business_process, question], method: :delete, html: {data: {action: "removable#remove:passive", questionnaire_question_target: "deleteForm"}}}
        ) do |component| %>
          <% component.with_button(class: "h-4", data: {cy: "delete-question"}) do %>
            <%= heroicon "trash", variant: "outline", options: {class: "w-4 h-4 text-gray-400 hover:text-gray-800 dark:hover:text-gray-200"} %>
          <% end %>
        <% end %>
      </div>
      <div class="flex items-center h-full gridstack-draggable-handle">
        <div class="flex-1 rounded-lg grid-stack-item-content-container bg-white/60 dark:bg-gray-400/8 shadow-light dark:shadow-dark dark:hover:shadow-dark-hover">
          <% if question.value_type == "spreadsheet" %>
            <div class="flex-1 pt-3 pr-16 min-h-14">
              <div class="pl-4">
                <%= render "name", question: %>
              </div>
              <div class="relative px-1">
                <%= render "settings/questionnaire_questions/placeholders/#{question.value_type}" %>
              </div>
            </div>
          <% else %>
            <div class="flex items-center flex-1 py-2.5 px-4 min-h-14">
              <div class="w-1/2">
                <%= render "name", question: %>
              </div>
              <div class="relative flex-1 pr-16">
                <%= render "settings/questionnaire_questions/placeholders/#{question.value_type}" %>
              </div>
            </div>
          <% end %>
        </div>
      </div>
    </div>
  </div>
</div>
 const int N = 1e5;
        vector<int> dp(N,-1);
class Solution {
public:
    int climbStairs(int n) {
       
        if(n==1)return 1;
        if(n==2)return 2;
        if(dp[n]!=-1)return dp[n];
        return dp[n]=climbStairs(n-1)+climbStairs(n-2);
      }
};
<article></article>

article {
    background: url('https://cdn.hobbyconsolas.com/sites/navi.axelspringer.es/public/media/image/2024/04/furiosa-saga-mad-max-3303782.jpg?tf=3840x');
    width: 450px;
    height: 250px;
    background-size: cover;
    position: relative;
    border-radius: 4px;
}
article::after {
    content: '';
    width: 100%;
    height: 100%;
    inset: 0;
    position: absolute;
    background: inherit;
    filter: blur(15px) contrast(200%);
    z-index: -1;
}
# Scanning the directory using os python function
img_dirs = []
for entry in os.scandir(path_to_data):
    if entry.is_dir():
        img_dirs.append(entry.path)
type Props = {
  state: 'success' | 'partial' | 'failure'
}

const props = defineProps<Props>()

const states: Record<Props['state'], { icon: IconDefinition; color: Color }> = {
  success: { icon: faCheckCircle, color: 'success' },
  partial: { icon: faCircleMinus, color: 'warning' },
  failure: { icon: faCircleXmark, color: 'error' },
}

const icon = computed(() => states[props.state].icon)
const color = computed(() => states[props.state].color)
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5;
vector<int> dp(N,-1);
int fib(int n)
{
    if(n==0)return 0;
    if(n==1)return 1;
    if(dp[n]!=-1)return dp[n];
    return dp[n]=fib(n-1)+fib(n-2);
}
int main()
{
    int n=6;
    cout<<fib(n);
}
string reverseWords(string s) {
       int n = s.size();
       std::string reverse_string = "";
       for ( int i = n-1 ; i > -1; --i ){
        if (s[i] == ' '){
            continue;
        }
        int count = 0;
        while ( i > -1 && s[i] != ' '){
            --i; count++;
        }
        if (reverse_string != ""){
            reverse_string.append(" ");
        }
        reverse_string.append(s.substr(i+1,count));
       }
       return reverse_string; 
    }
# Importing library
from scipy.stats import f_oneway

# Performance when each of the engine 
# oil is applied
performance1 = [89, 89, 88, 78, 79]
performance2 = [93, 92, 94, 89, 88]
performance3 = [89, 88, 89, 93, 90]
performance4 = [81, 78, 81, 92, 82]

# Conduct the one-way ANOVA
f_oneway(performance1, performance2, performance3, performance4)
func upnp_setup():
	var upnp = UPNP.new()
	
	var discover_result = upnp.discover()
	assert(discover_result == UPNP.UPNP_RESULT_SUCCESS, \
		"UPNP Discover Failed! Error %s" % discover_result)

	assert(upnp.get_gateway() and upnp.get_gateway().is_valid_gateway(), \
		"UPNP Invalid Gateway!")

	var map_result = upnp.add_port_mapping(PORT)
	assert(map_result == UPNP.UPNP_RESULT_SUCCESS, \
		"UPNP Port Mapping Failed! Error %s" % map_result)
	
	print("Success! Join Address: %s" % upnp.query_external_address())
//HTML_code
<div class="container">
<div class="row justify-content-center">
<table class="table" id="veri_tablo">
 <thead class="thead-dark">
   <tr>
     <th onclick="sort_data('id')">ID</th>
     <th onclick="sort_data('name')">Name</th>
     <th onclick="sort_data('username')">Username</th>
     <th onclick="sort_data('email')">Email</th>
     <th onclick="sort_data('address')">Adres</th>
   </tr>
 </thead>
</table>
<div>
  </div>


//JS_code
let data =[];
function veriAl() 
{
  fetch('https://jsonplaceholder.typicode.com/users')
   .then(response =>{
   if(!response.ok)
     {
       throw Error("ERROR");
     }
   return response.json();//json fonksiyonunun promise döndürmeyi sağladığı ile ilgili birşey okudum
    //Biz bunu return yaptığımızda ikinci yazılan then e gelir
   })
    .then(veri => {
    /*data=veri;
    console.log(veri);
    const html=data.map(user => {
      return `<table class="user">
      <td> ${user.id}</td>
      <td>${user.name}</td>
      <td>${user.username}</td>
      <td>${user.email}</td>
    <td>${user.address.street}/${user.address.suite}/${user.address.city}</td>
      </table>
     `;
    }).join("");*/
    data=veri;
   veriEkle(data);
}).catch(error => {//promise reddedildiğinde bu callback çalışır
    console.log(error);
  });
}
const sort_data = (field) =>
{
  data.sort((a,b) => {
    let valueA=a[field];
    let valueB= b[field];
    if(valueA<valueB)
      {
        return -1;
      }
    else if(valueB>valueA)
      {
        return 1;
      }
    return 0;            
  })
  console.log("sıralandı"+field+"e göre",data);
  veriEkle(data);
  }
const veriEkle =(array)=>
{
  
  const html=array.map(user =>{
    return `<table class="user">
      <td> ${user.id}</td>
      <td>${user.name}</td>
      <td>${user.username}</td>
      <td>${user.email}</td>
    <td>${user.address.street}/${user.address.suite}/${user.address.city}</td>
      </table>
     `;
    
  }).join("");
   console.log(html); document.querySelector('#veri_tablo').insertAdjacentHTML("afterbegin",html);
}
veriAl();

//HTML_code
<div class="container">
<div class="row justify-content-center">
<table class="table" id="veri_tablo">
 <thead class="thead-dark">
   <tr>
     <th onclick="sort_data('id')">ID</th>
     <th onclick="sort_data('name')">Name</th>
     <th onclick="sort_data('username')">Username</th>
     <th onclick="sort_data('email')">Email</th>
     <th onclick="sort_data('address')">Adres</th>
   </tr>
 </thead>
</table>
<div>
  </div>


//JS_code
let data =[];
function veriAl() 
{
  fetch('https://jsonplaceholder.typicode.com/users')
   .then(response =>{
   if(!response.ok)
     {
       throw Error("ERROR");
     }
   return response.json();//json fonksiyonunun promise döndürmeyi sağladığı ile ilgili birşey okudum
    //Biz bunu return yaptığımızda ikinci yazılan then e gelir
   })
    .then(veri => {
    /*data=veri;
    console.log(veri);
    const html=data.map(user => {
      return `<table class="user">
      <td> ${user.id}</td>
      <td>${user.name}</td>
      <td>${user.username}</td>
      <td>${user.email}</td>
    <td>${user.address.street}/${user.address.suite}/${user.address.city}</td>
      </table>
     `;
    }).join("");*/
    data=veri;
   veriEkle(data);
}).catch(error => {//promise reddedildiğinde bu callback çalışır
    console.log(error);
  });
}
const sort_data = (field) =>
{
  data.sort((a,b) => {
    let valueA=a[field];
    let valueB= b[field];
    if(valueA<valueB)
      {
        return -1;
      }
    else if(valueB>valueA)
      {
        return 1;
      }
    return 0;            
  })
  console.log("sıralandı"+field+"e göre",data);
  veriEkle(data);
  }
const veriEkle =(array)=>
{
  
  const html=array.map(user =>{
    return `<table class="user">
      <td> ${user.id}</td>
      <td>${user.name}</td>
      <td>${user.username}</td>
      <td>${user.email}</td>
    <td>${user.address.street}/${user.address.suite}/${user.address.city}</td>
      </table>
     `;
    
  }).join("");
   console.log(html); document.querySelector('#veri_tablo').insertAdjacentHTML("afterbegin",html);
}
veriAl();

class VolumeProfile
  {
...
public:
   void              VolumeProfile(datetime _from, datetime _to);
                    ~VolumeProfile() {};
   double            GetHVPrice();
   void              Plot();
...
  };
function onOpen() {
  var ui = SpreadsheetApp.getUi();
  ui.createMenu('Custom Menu')
      .addItem('Update Master Summary', 'updateMasterSummaryBasedOnConfiguration')
      .addItem('Update Configuration', 'updateConfiguration')
      .addItem('Update Consolidated Master', 'updateConsolidatedMaster')
      .addToUi();
}

function updateMasterSummaryBasedOnConfiguration() {
  var statusNames = ["RFQ SENT", "PART NUMBER SET UP", "SOURCED", "DEVELOPING", "AWAITING SAMPLE", "SAMPLE RECEIVED", "PIES COLLECTION", "PIES APPROVED", "PIES REJECTED", "PM APPROVED", "PRICING", "COMPLETE", "TERMINATED"];

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var masterSheet = spreadsheet.getSheetByName("Master Summary");
  var configSheet = spreadsheet.getSheetByName("Configuration");

  // Clear existing content in Master Summary sheet excluding the first column
  var rangeToClear = masterSheet.getRange("B:ZZ");
  rangeToClear.clear();

  // Get tab names and their statuses from the Configuration sheet
  var rangeData = configSheet.getRange("A:B").getValues();
  var tabNames = [];
  var tabStatuses = [];

  // Populate tabNames and tabStatuses arrays
  for (var i = 0; i < rangeData.length; i++) {
    var tabName = rangeData[i][0];
    var status = rangeData[i][1];
    if (tabName && status) { // Ensure both tab name and status exist
      tabNames.push(tabName);
      tabStatuses.push(status.toLowerCase()); // Convert status to lowercase for consistency
    }
  }

  // Set the headers for active tabs and count status for each tab
  var activeTabs = tabNames.filter(function(_, index) {
    return tabStatuses[index] === "active";
  });

  // Set the headers for active tabs in Master Summary
  var headerRowData = ['Status', 'Total Parts Count'].concat(activeTabs);
  masterSheet.getRange(1, 1, 1, headerRowData.length).setValues([headerRowData]);

  // Create a 2D array to hold all the data to be written to the Master Summary sheet
  var outputData = statusNames.map(function(statusName) {
    return [statusName, 0].concat(new Array(activeTabs.length).fill(0));
  });

  // Add a row for the total counts
  var totalCountsRow = ['TotTotal Parts Count', 0].concat(new Array(activeTabs.length).fill(0));
  outputData.push(totalCountsRow);

  // Iterate over active tabs and count the statuses
  activeTabs.forEach(function(tabName, tabIndex) {
    var sheet = spreadsheet.getSheetByName(tabName);
    if (sheet) {
      var values = sheet.getRange("A:A").getValues().flat();
      var statusCounts = statusNames.reduce(function(counts, status) {
        counts[status] = 0;
        return counts;
      }, {});

      // Count the statuses
      values.forEach(function(value) {
        var upperValue = value.toString().toUpperCase();
        if (statusCounts.hasOwnProperty(upperValue)) {
          statusCounts[upperValue]++;
        }
      });

      // Fill the outputData array with counts
      statusNames.forEach(function(statusName, statusIndex) {
        var count = statusCounts[statusName] || 0;
        outputData[statusIndex][tabIndex + 2] = count; // Insert count into corresponding column
        outputData[statusIndex][1] += count; // Add count to the total column
        totalCountsRow[tabIndex + 2] += count; // Add count to the total row
      });
      totalCountsRow[1] += totalCountsRow[tabIndex + 2]; // Add total of current tab to the grand total
    }
  });

  // Write the collected data to the sheet in one operation
  masterSheet.getRange(2, 1, outputData.length, outputData[0].length).setValues(outputData);
}


function updateConfiguration() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var configSheet = spreadsheet.getSheetByName("Configuration");

  // Fetch existing sheet names from Configuration sheet
  var existingSheetNames = configSheet.getRange("A2:A").getValues().flat().filter(function(name) {
    return name; // Filter out empty values
  });

  // Fetch all sheet names excluding "Configuration" and "Master Summary"
  var allSheetNames = spreadsheet.getSheets().map(function(sheet) {
    return sheet.getName();
  }).filter(function(name) {
    return name !== "Configuration" && name !== "Master Summary";
  });

  // Filter out existing sheet names from all sheet names
  var newSheetNames = allSheetNames.filter(function(name) {
    return !existingSheetNames.includes(name);
  });

  // Append new sheet names to the Configuration sheet
  if (newSheetNames.length > 0) {
    var startRow = existingSheetNames.length + 2;
    configSheet.getRange(startRow, 1, newSheetNames.length, 1).setValues(newSheetNames.map(function(name) {
      return [name];
    }));

    // Calculate status for new sheet names
    var statusNames = ["RFQ SENT", "PART NUMBER SET UP", "SOURCED", "DEVELOPING", "AWAITING SAMPLE", "SAMPLE RECEIVED", "PIES COLLECTION", "PIES APPROVED", "PIES REJECTED", "PM APPROVED", "PRICING", "COMPLETE", "TERMINATED"];

    for (var k = 0; k < newSheetNames.length; k++) {
      var tabName = newSheetNames[k];
      var isActive = false;

      // Check each status for the current sheet
      for (var i = 0; i < statusNames.length; i++) {
        var status = statusNames[i];
        var count = getCountForStatusInSheet(status, tabName);
        if (count > 0) {
          isActive = true;
          break;
        }
      }

      // Set the status for the current sheet in the Configuration sheet
      var statusCell = configSheet.getRange(startRow + k, 2);
      statusCell.setValue(isActive ? "Active" : "Inactive");
      var statusValidationRule = SpreadsheetApp.newDataValidation()
          .requireValueInList(["Active", "Inactive"], true)
          .build();
      statusCell.setDataValidation(statusValidationRule);
      statusCell.setFontColor(isActive ? "#00FF00" : "#FF0000");
    }
  }
}

function getCountForStatusInSheet(status, sheetName) {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);
  
  // Return 0 if sheet doesn't exist
  if (!sheet) {
    return 0;
  }

  var statusColumn = sheet.getRange("A:A").getValues().flat(); // Assuming statuses are in column A

  // Count occurrences of status
  var count = statusColumn.filter(function(value) {
    return value === status;
  }).length;

  return count;
}

function updateConsolidatedMaster() {
  var statusNames = ["RFQ SENT", "PART NUMBER SET UP", "SOURCED", "DEVELOPING", "AWAITING SAMPLE", "SAMPLE RECEIVED", "PIES COLLECTION", "PIES APPROVED", "PIES REJECTED", "PM APPROVED", "PRICING", "COMPLETE"];
  var columnsToCopy = ["Status", "Start Date", "Part Type", "HOL P/N", "OE#", "ALT OE", "MAM Status (change to Dev)", "FP Status (Change to Electronically Announced)", "PartCat Status (Changed to Electronically Announced)", "Interchange", "Interchange Completion", "Parts List/RFQ Submitted to Warren", "Parts List/RFQ Returned to Holstein", "Production Sourced Part is requested from Warren", "ETA of Sample", "Date Prod Sample Delivered to Holstein", "Factory Code", "MOQ"];

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var masterSheet = spreadsheet.getSheetByName("Consolidated Master");
  var configSheet = spreadsheet.getSheetByName("Configuration");

  // Clear existing content in Consolidated Master sheet
  masterSheet.clear();

  // Get tab names and their statuses from the Configuration sheet
  var rangeData = configSheet.getRange("A:B").getValues();
  var activeTabs = rangeData.filter(function(row) {
    return row[1] && row[1].toLowerCase() === "active";
  }).map(function(row) {
    return row[0];
  });

  // Initialize a variable to keep track of the row to insert data into
  var rowIndex = 2;

  // Insert headers for the Consolidated Master sheet
  var headers = columnsToCopy;
  masterSheet.getRange(1, 1, 1, headers.length).setValues([headers]);

  // Iterate through each active tab
  activeTabs.forEach(function(tabName) {
    var sheet = spreadsheet.getSheetByName(tabName);
    if (sheet) {
      var sheetData = sheet.getDataRange().getValues();

      // Get the column names from the second row
      var columnNames = sheetData[1];

      // Iterate through each row in the sheet
      sheetData.forEach(function(row, rowIdx) {
        if (rowIdx === 0 || rowIdx === 1) return; // Skip the header rows

        var status = row[0]; // Assuming status is in the first column (A)
        var statusIndex = statusNames.indexOf(status);

        // If the status is one of the specified statusNames, add it to the Consolidated Master sheet
        if (statusIndex !== -1) {
          var rowData = [status]; // Start with the status in the first column

          // Insert the data into the Consolidated Master sheet
          columnsToCopy.forEach(function(col, colIndex) {
            var colIndexInSheet = columnNames.indexOf(col);
            if (colIndexInSheet !== -1 && rowIdx > 1) {
              rowData.push(row[colIndexInSheet]);
            }
          });

          masterSheet.getRange(rowIndex, 1, 1, rowData.length).setValues([rowData]);
          rowIndex++;
        }
      });
    }
  });
}
function updateConsolidatedRejected() {
  var statusNames = ["TERMINATED", "PIES REJECTED"];
  var columnsToCopy = ["STATUS", "Part Type", "HOL P/N", "OE#", "QC Inspection/PIES Collection", "HOL Feedback Sent", "New Sample Requested", "New Sample Received"];

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var masterSheet = spreadsheet.getSheetByName("Consolidated Rejected");
  var configSheet = spreadsheet.getSheetByName("Configuration");

  // Clear existing content in Consolidated Rejected sheet
  masterSheet.clear();

  // Get tab names and their statuses from the Configuration sheet
  var rangeData = configSheet.getRange("A:B").getValues();
  var activeTabs = rangeData.filter(function(row) {
    return row[1] && row[1].toLowerCase() === "active";
  }).map(function(row) {
    return row[0];
  });

  // Initialize a variable to keep track of the row to insert data into
  var rowIndex = 2;

  // Insert headers for the Consolidated Rejected sheet
  var headers = columnsToCopy;
  masterSheet.getRange(1, 1, 1, headers.length).setValues([headers]);

  // Iterate through each active tab
  activeTabs.forEach(function(tabName) {
    var sheet = spreadsheet.getSheetByName(tabName);
    if (sheet) {
      var sheetData = sheet.getDataRange().getValues();

      // Get the column names from the second row
      var columnNames = sheetData[1];

      // Iterate through each row in the sheet
      sheetData.forEach(function(row, rowIdx) {
        if (rowIdx === 0 || rowIdx === 1) return; // Skip the header rows

        var status = row[0]; // Assuming status is in the first column (A)

        // If the status is "TERMINATED" or "PIES REJECTED", add it to the Consolidated Rejected sheet
        if (statusNames.includes(status)) {
          var rowData = [];

          // Insert the data into the Consolidated Rejected sheet
          columnsToCopy.forEach(function(col) {
            var colIndexInSheet = columnNames.indexOf(col);
            if (colIndexInSheet !== -1) {
              rowData.push(row[colIndexInSheet]);
            } else if (col === "STATUS") {
              rowData.push(status); // Add status directly for the STATUS column
            } else {
              rowData.push(''); // Fill in with an empty string if the column is not found
            }
          });

          masterSheet.getRange(rowIndex, 1, 1, rowData.length).setValues([rowData]);
          rowIndex++;
        }
      });
    }
  });
}
//.......................................//

function updateConsolidatedMaster() {
  var statusNames = ["RFQ SENT", "PART NUMBER SET UP", "SOURCED", "DEVELOPING", "AWAITING SAMPLE", "SAMPLE RECEIVED", "PIES COLLECTION", "PIES APPROVED", "PIES REJECTED", "PM APPROVED", "PRICING", "COMPLETE"];
  var columnsToCopy = ["Status", "Start Date", "Part Type", "HOL P/N", "OE#", "ALT OE", "MAM Status (change to Dev)", "FP Status (Change to Electronically Announced)", "PartCat Status (Changed to Electronically Announced)", "Interchange", "Interchange Completion", "Parts List/RFQ Submitted to Warren", "Parts List/RFQ Returned to Holstein", "Production Sourced Part is requested from Warren", "ETA of Sample", "Date Prod Sample Delivered to Holstein", "Factory Code"];

  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();

  try {
    var masterSheet = spreadsheet.getSheetByName("Consolidated Master");
    var configSheet = spreadsheet.getSheetByName("Configuration");

    // Clear existing content in Consolidated Master sheet
    masterSheet.clear();

    // Get active tab names and their statuses from the Configuration sheet
    var rangeData = configSheet.getRange("A:B").getValues();
    var activeTabs = rangeData.filter(function(row) {
      return row[1] && row[1].toLowerCase() === "active";
    }).map(function(row) {
      return row[0];
    });

    // Initialize variables
    var allData = [];
    var rowIndex = 2;

    // Insert headers
    allData.push(columnsToCopy.concat("MOQ")); // Add MOQ to the header row
    masterSheet.getRange(1, 1, 1, allData[0].length).setValues([allData[0]]);

    // Iterate through active tabs
    activeTabs.forEach(function(tabName) {
      var sheet = spreadsheet.getSheetByName(tabName);
      if (sheet) {
        var sheetData = sheet.getDataRange().getValues();

        // Get column names
        var columnNames = sheetData[1];

        // Iterate through rows (excluding header rows)
        sheetData.slice(2).forEach(function(row) {
          var status = row[0];

          // Check if status is in the list and copy relevant data
          if (statusNames.includes(status)) {
            var rowData = [status];
            columnsToCopy.forEach(function(col) {
              var colIndex = columnNames.indexOf(col);
              if (colIndex !== -1) {
                rowData.push(row[colIndex]);
              }
            });

            // Find MOQ column index and convert date to "1" if found
            var moqIndex = columnNames.indexOf("MOQ");
            if (moqIndex !== -1) {
              var moqValue = row[moqIndex];
              if (typeof moqValue === 'object' && moqValue instanceof Date) {
                rowData.push("1");
              } else {
                rowData.push(moqValue);
              }
            } else {
              rowData.push(""); // Add empty string if MOQ column not found
            }
            allData.push(rowData);
          }
        });
      }
    });

    // Insert all data at once
    if (allData.length > 1) { // Check if there's data to insert
      masterSheet.getRange(rowIndex, 1, allData.length - 1, allData[0].length).setValues(allData.slice(1));
    }
  } catch (error) {
    // Handle errors gracefully (e.g., log error or display message to user)
    console.error("Error occurred:", error);
  }
}


# Evaluating the best model on the test set
best_model = grid_search.best_estimator_
test_score = best_model.score(x_test, y_test)
print('Test set accuracy:', test_score)
pipe = make_pipeline(MinMaxScaler(), PCA(n_components=100), SVC())
star

Thu May 23 2024 21:06:20 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Thu May 23 2024 21:05:55 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Thu May 23 2024 18:01:38 GMT+0000 (Coordinated Universal Time)

@ReynaldJr

star

Thu May 23 2024 17:30:22 GMT+0000 (Coordinated Universal Time) https://leetcode.com/problems/remove-duplicates-from-sorted-array/submissions/

@TILAK_CODE_NOW

star

Thu May 23 2024 15:38:09 GMT+0000 (Coordinated Universal Time)

@omcm

star

Thu May 23 2024 15:19:10 GMT+0000 (Coordinated Universal Time)

@omcm

star

Thu May 23 2024 14:57:07 GMT+0000 (Coordinated Universal Time)

@kathrynhefner

star

Thu May 23 2024 12:31:13 GMT+0000 (Coordinated Universal Time) https://maticz.com/software-consulting-services

@Floralucy #inventorymanagement #inventory #warehousemanagement #inventorysoftware

star

Thu May 23 2024 10:23:19 GMT+0000 (Coordinated Universal Time)

@jakaria

star

Thu May 23 2024 05:21:03 GMT+0000 (Coordinated Universal Time) https://codepen.io/Gurken-Glas/pen/PovNoJx

@radeguzvic #undefined

star

Thu May 23 2024 03:29:38 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/?oai-dm

@kris96tian #python

star

Thu May 23 2024 02:10:20 GMT+0000 (Coordinated Universal Time)

@manhmd #java

star

Thu May 23 2024 00:34:15 GMT+0000 (Coordinated Universal Time) https://www.kali.org/tools/above/

@Mad_Hatter

star

Thu May 23 2024 00:33:06 GMT+0000 (Coordinated Universal Time) https://www.kali.org/tools/7zip/

@Mad_Hatter

star

Thu May 23 2024 00:27:20 GMT+0000 (Coordinated Universal Time) https://developer.wordpress.org/advanced-administration/wordpress/update-services/

@radeguzvic

star

Thu May 23 2024 00:21:14 GMT+0000 (Coordinated Universal Time) https://www.kali.org/tools/wifite/

@Mad_Hatter

star

Thu May 23 2024 00:11:49 GMT+0000 (Coordinated Universal Time) https://www.kali.org/tools/villain/

@Mad_Hatter #linux #kali #tools

star

Wed May 22 2024 22:55:14 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/windows/terminal/distributions

@Mad_Hatter

star

Wed May 22 2024 21:12:56 GMT+0000 (Coordinated Universal Time) https://onlinehtmleditor.dev/

@ami #undefined

star

Wed May 22 2024 21:11:26 GMT+0000 (Coordinated Universal Time) https://onlinehtmleditor.dev/

@ami #undefined

star

Wed May 22 2024 18:16:31 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Wed May 22 2024 16:59:45 GMT+0000 (Coordinated Universal Time) https://ci.codesandbox.io/setup?installation_id

@radeguzvic #json

star

Wed May 22 2024 16:59:43 GMT+0000 (Coordinated Universal Time) https://ci.codesandbox.io/setup?installation_id

@radeguzvic #json

star

Wed May 22 2024 16:59:40 GMT+0000 (Coordinated Universal Time) https://ci.codesandbox.io/setup?installation_id

@radeguzvic #json

star

Wed May 22 2024 16:59:36 GMT+0000 (Coordinated Universal Time) https://ci.codesandbox.io/setup?installation_id

@radeguzvic #json

star

Wed May 22 2024 16:51:42 GMT+0000 (Coordinated Universal Time)

@taufiq_ali

star

Wed May 22 2024 15:40:37 GMT+0000 (Coordinated Universal Time) https://www.pyramidions.com/mobile-app-development-chennai.html

@Steve_1

star

Wed May 22 2024 15:13:11 GMT+0000 (Coordinated Universal Time) https://ci.codesandbox.io/setup?installation_id

@radeguzvic #json

star

Wed May 22 2024 15:13:07 GMT+0000 (Coordinated Universal Time) https://ci.codesandbox.io/setup?installation_id

@radeguzvic #json

star

Wed May 22 2024 13:57:20 GMT+0000 (Coordinated Universal Time)

@flawed

star

Wed May 22 2024 12:21:03 GMT+0000 (Coordinated Universal Time) https://www.alphacodez.com/paxful-clone-script

@PaulWalker07 #c #c++

star

Wed May 22 2024 11:48:03 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Wed May 22 2024 10:37:36 GMT+0000 (Coordinated Universal Time)

@rstringa

star

Wed May 22 2024 09:56:43 GMT+0000 (Coordinated Universal Time)

@Uncoverit #python

star

Wed May 22 2024 09:24:46 GMT+0000 (Coordinated Universal Time)

@Paloma #typescript

star

Wed May 22 2024 08:23:51 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Wed May 22 2024 07:51:02 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Wed May 22 2024 06:17:08 GMT+0000 (Coordinated Universal Time) https://online-spss.com/

@Richard22 ##data ##python ##statistics ##dataanalysishelp

star

Wed May 22 2024 03:14:09 GMT+0000 (Coordinated Universal Time)

@azariel #glsl

star

Wed May 22 2024 02:13:56 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/66967959/how-to-exclude-one-specific-file-from-format-on-save-in-vscode

@kayengxiong

star

Tue May 21 2024 19:40:01 GMT+0000 (Coordinated Universal Time) https://codepen.io/hyperborean17/pen/VwazdoQ

@mohamedahmed123

star

Tue May 21 2024 19:39:22 GMT+0000 (Coordinated Universal Time) https://codepen.io/hyperborean17/pen/VwazdoQ

@mohamedahmed123

star

Tue May 21 2024 16:59:31 GMT+0000 (Coordinated Universal Time)

@taufiq_ali

star

Tue May 21 2024 16:41:04 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/extension/initializing?newuser

@atang148

star

Tue May 21 2024 16:18:14 GMT+0000 (Coordinated Universal Time)

@Uncoverit #python

star

Tue May 21 2024 16:17:12 GMT+0000 (Coordinated Universal Time)

@Uncoverit #python

Save snippets that work with our extensions

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