Snippets Collections
.basic grid{
  display: grid;
  gap: 1rem;
  
  /* 1 too skinny, too much code */
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
  
  /* 2 cleaner code */
  grid-template-columns: repeat(12, 1fr);
  
  /* 3 better sizing but overflows*/
  grid-template-columns: repeat(12, minmax(240px, 1fr));
  //doesnt get smaller than 240px but get as big as 1fr
  
  /* 4 final*/
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  //works also with auto-fill
  
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Boost Days - What's on this week! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Welcome to another Boost Day week!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-10: Tuesday, 10th September",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Xero Café:* Café-style beverages and sweet treats.\n:brown_heart: *Weekly Café Special:* Almond Cappuccino.\n:breakfast: *Breakfast:* Provided by CBD Catering from *8.30AM - 10.30AM* in All Hands."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-12: Thursday, 12th September",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Xero Café:* Café-style beverages and sweet treats.\n:brown_heart: *Weekly Café Special:* Alomond Capuccino.\n:sandwich: Afternoon Tea: Provided by Sticky Fingers from *2pm - 3pm* in All Hands\n:yoga2:*Wellness:* Yoga Session with Zoe in the Gym from 12pm - 1pm. *Sign up here* <https://docs.google.com/spreadsheets/d/19dtgZ2oesXKtb9f7zlcAnjnvYuNJUjzsVjtysX6KyAQ/edit?gid=0#gid=0|*here*>!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Later this month*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:moon-cake: Mooncake Festival Celebration on *Tuesday, 17th September.*\n :bouquet: Social + on *Thursday 19th September*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=eGVyby5jb21fMXM4M3NiZzc1dnY0aThpY2FiZDZvZ2xncW9AZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ|*Auckland Social Calendar.*>\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
const fruits = ['mango', 'papaya', 'pineapple', 'apple'];

// Iterate over fruits below
fruits.forEach(item => console.log(`I want to eat a ${item}.`));
<a class="icon-download btn btn-primary" href="https://[the URL]">Download</a></p>
const addTwo = num => {
  return num + 2;
}

const checkConsistentOutput = (func, val) => {
  let checkA = val + 2;
  let checkB = func(val);
  if (checkA === checkB) {
    return checkB;
  } else {
    console.log(`inconsistent results`);
  }
}

console.log(checkConsistentOutput(addTwo, 2));
<div class="content-box">
 <div class="grid-row">
  <div class="col-xs">
   <div class="styleguide-section__grid-demo-element">Column 1 content</div>
  </div>
  <div class="col-xs">
   <div class="styleguide-section__grid-demo-element">Column 2 content</div>
  </div>
  <div class="col-xs">
   <div class="styleguide-section__grid-demo-element">Column 3 content</div>
  </div>
 </div><!--end of grid row-->
</div><!--end of content box-->
Get-PSReadLineKeyHandler -Bound -Unbound

Key                   Function                Description
---                   --------                -----------
Enter                 AcceptLine              Accept the input or move to the next line if input is missing a closing token.
Shift+Enter           AddLine                 Move the cursor to the next line without attempting to execute the input
Escape                RevertLine              Equivalent to undo all edits (clears the line except lines imported from history)
LeftArrow             BackwardChar            Move the cursor back one character
RightArrow            ForwardChar             Move the cursor forward one character
Ctrl+LeftArrow        BackwardWord            Move the cursor to the beginning of the current or previous word
Ctrl+RightArrow       NextWord                Move the cursor forward to the start of the next word
Shift+LeftArrow       SelectBackwardChar      Adjust the current selection to include the previous character
Shift+RightArrow      SelectForwardChar       Adjust the current selection to include the next character
Ctrl+Shift+LeftArrow  SelectBackwardWord      Adjust the current selection to include the previous word
Ctrl+Shift+RightArrow SelectNextWord          Adjust the current selection to include the next word
UpArrow               PreviousHistory         Replace the input with the previous item in the history
DownArrow             NextHistory             Replace the input with the next item in the history
Home                  BeginningOfLine         Move the cursor to the beginning of the line
End                   EndOfLine               Move the cursor to the end of the line
Shift+Home            SelectBackwardsLine     Adjust the current selection to include from the cursor to the end of the line
Shift+End             SelectLine              Adjust the current selection to include from the cursor to the start of the line
Delete                DeleteChar              Delete the character under the cursor
Backspace             BackwardDeleteChar      Delete the character before the cursor
Ctrl+Spacebar         MenuComplete            Complete the input if there is a single completion, otherwise complete the input by selecting from a menu o...
Tab                   TabCompleteNext         Complete the input using the next completion
Shift+Tab             TabCompletePrevious     Complete the input using the previous completion
Ctrl+a                SelectAll               Select the entire line. Moves the cursor to the end of the line
Ctrl+c                CopyOrCancelLine        Either copy selected text to the clipboard, or if no text is selected, cancel editing the line with Cancel...
Ctrl+C                Copy                    Copy selected region to the system clipboard.  If no region is selected, copy the whole line
Ctrl+l                ClearScreen             Clear the screen and redraw the current line at the top of the screen
Ctrl+r                ReverseSearchHistory    Search history backwards interactively
...
$parameters = @{
  Name = "myNuGetSource"
  SourceLocation = "https://www.myget.org/F/powershellgetdemo/api/v2"
  PublishLocation = "https://www.myget.org/F/powershellgetdemo/api/v2/Packages"
  InstallationPolicy = 'Trusted'
}
Register-PSRepository @parameters
Get-PSRepository

Name                SourceLocation          OneGetProvider       InstallationPolicy
----                --------------          --------------       ------------------
PSGallery           http://go.micro...      NuGet                Untrusted
myNuGetSource       https://myget.c...      NuGet                Trusted
<div id="fhCalen">
<!-- FareHarbor calendar of item #548871 -->
<script src="https://fareharbor.com/embeds/script/calendar/rent2ridesardinia/items/548871/?fallback=simple&full-items=yes&flow=1188408"></script></div>
  
<script>jQuery(document).ready(function($){var cal = $('#fhCalen');$(' div.elementor-add-to-cart.elementor-product-variable').replaceWith(cal);});</script>
    
    
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
body
{
background: #000;
}
h1
{
	width: 900px;
    color: #164E63;
    text-transform: uppercase;
    font-size: 4.5em;
    border: 1px dotted #FFFFFF40;
    position: relative;
    text-align: center;
}
h1::before
{
	content: attr(data-txt);
    position: absolute;
    inset:0;
    margin:auto;
    text-align:center;
    transition: 300ms ease-in-out 500ms;
}
h1>span
{
	transition:transform ease-in 500ms;
    display:inline-block;
    transform-origin: center center;
    transform: rotateY(90deg)
}
h1:hover::before
{
	opacity:0;
    transform-delay:0ms;
}

h1:hover>span 
{
	transform: rotateY(0deg);
}
</style>
</head>
<body>

<h1 data-txt="Can you see me">Code The World!</h1>
<script>
const h1 = document.querySelector("h1");
const text = h1.textContent;
h1.innerHTML = '';

text.split('').forEach((char) => {
	const span = document.createElement("span");
    if (char === ' '){
    	span.innerHTML = '&nbsp';
    }else{
    	span.textContent = char;
    }
    h1.appendChild(span);
});
</script>
</body>
</html>
#2. Bar Plot
#used to compare diff categories
#Ex: Bar plot for sales by region
regions=["North","East","West","South"]
sales_by_region = [25000,31000,17000,19000]

plt.bar(regions,sales_by_region,color='yellow')
plt.title("Sales by Region")
plt.xlabel("Regions")
plt.ylabel("Sales($)")
plt.show()
****************************************
import pandas as pd
import seaborn as sns
#7.Heatmap
#Ex: Heatmap of correlations
data={
    'Sales':sales,
    ' Profit':profit,
    'Product Sold':products_sold
}
df=pd.DataFrame(data)
correlation_matrix=df.corr()
sns.heatmap(correlation_matrix,annot=True,cmap='coolwarm')
plt.title("Correlation Heatmap")
plt.show()

// Create WebSocket connection.
const socket = new WebSocket("ws://localhost:8080");

// Connection opened
socket.addEventListener("open", (event) => {
  socket.send("Hello Server!");
});

// Listen for messages
socket.addEventListener("message", (event) => {
  console.log("Message from server ", event.data);
});
/**
 * /**
 * @author      Justus van den Berg (jfwberg@gmail.com)
 * @date        August 2024
 * @copyright   (c) 2024 Justus van den Berg
 * @license     MIT (See LICENSE file in the project root)
 * @description Test Data generator for SoqlTableParser & SoqlMultiTableParser
 * @note        Create the test data, ideally run 1 by 1 to prevent govenor limits
 *              Run accounts and contacts first. Cases and opportunities require both
 *
 * - https://medium.com/@justusvandenberg/dynamically-handle-salesforce-soql-subquery-response-data-using-apex-8130bd0622aa
 * - https://www.thiscodeworks.com/apex-soqltableparser-soql-subqueries-to-a-single-flat-table/66ba81bc2e62a20014b9150c
 * - https://www.thiscodeworks.com/apex-soqlmultitableparser-soql-subqueries-to-multiple-individual-tables/66ba816f2e62a20014b913aa
 */
insertAccounts(0,10);
insertContacts(0,10,0,10);
insertCases(0,10,0,10);
insertOpportunities(0,10,0,10);
insertOpportunitContactRoles(0,10,0,10);

/**
 * @description Method to create Basic Test Contacts
 */
public void insertAccounts(Integer accountOffset, Integer numberOfAccounts){
    
    // List to store the new cases
    Account[] accounts = new Account[]{};

    // Loop for to create all top level accounts
    for (Integer i = accountOffset; i < numberOfAccounts; i++) {
    
        // A postfix to keep track of what item we're dealing with
        String postfix = String.valueOf(i+1).leftPad(4,'0');
        
        // Create a new account
        accounts.add(new Account(
            Name = 'LWT - Test - Account - ' + postfix
        ));
    }
    insert accounts;
}


/**
 * @description Method to create Basic Test Contacts
 */
public void insertContacts(Integer accountOffset, Integer numberOfAccounts, Integer contactOffset,Integer numberOfContacts){
    
    // Get the account and contact data
    Account[] accounts = [SELECT Id FROM Account WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfAccounts];
    
    // Basic error handling
    if(numberOfAccounts != accounts.size()){throw new StringException('Number of accounts does not match number returned by the query');}
    
    // List to store the new contacts
    Contact[] contacts = new Contact[]{};

    // Iterate the top level accounts
    for(Integer i=accountOffset; i<numberOfAccounts; i++){
        
        // Create a number of contacts for each account
        for(Integer j=contactOffset; j < numberOfContacts; j++){
        
            // Postfix to keep track of where we are
            String postfix = String.valueOf(i+1).leftPad(4,'0') + ' - ' + String.valueOf(j+1).leftPad(4,'0');
            
            // Add a new contact to the list
            contacts.add(new Contact(
                AccountId = accounts[i].Id,
                FirstName = 'LWT - Test - ' + postfix,
                LastName  = 'Contact - '    + postfix
            ));
        }
    }
    insert contacts;
}


/**
 * @description Method to create Basic Test Cases
 */
public void insertCases(Integer offset, Integer numberOfAccounts, Integer contactOffset, Integer numberOfContacts){

    // Get the account and contact data
    Account[] accounts = [SELECT Id FROM Account WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfAccounts];
    Contact[] contacts = [SELECT Id FROM Contact WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfContacts];

    // Basic error handling
    if(numberOfAccounts != accounts.size()){throw new StringException('Number of accounts does not match number returned by the query');}
    if(numberOfContacts != contacts.size()){throw new StringException('Number of contacts does not match number returned by the query');}

    // List to store the new cases
    Case[] cases = new Case[]{};

    // Iterate the top level accounts
    for(Integer i=offset; i<numberOfAccounts; i++){
        
        // Create a case for each contact in the account
        for(Integer j=offset; j<numberOfContacts; j++){
        
            // Postfix to keep track of where we are
            String postfix = String.valueOf(i+1).leftPad(4,'0') + ' - ' + String.valueOf(j+1).leftPad(4,'0');
            
            // Add a new case
            cases.add(new Case(
                AccountId = accounts[i].Id,
                ContactId = contacts[j].Id,
                Subject   = 'LWT - Test - Case - ' + postfix
            ));
        }
    }
    insert cases;
}


/**
 * @description Method to create Basic Test Opportunities
 */
public void insertOpportunities(Integer offset, Integer numberOfAccounts, Integer contactOffset, Integer numberOfContacts){
    
    // Get the account and contact data
    Account[] accounts = [SELECT Id FROM Account WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfAccounts];
    Contact[] contacts = [SELECT Id FROM Contact WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfContacts];

    // Basic error handling
    if(numberOfAccounts != accounts.size()){throw new StringException('Number of accounts does not match number returned by the query');}
    if(numberOfContacts != contacts.size()){throw new StringException('Number of contacts does not match number returned by the query');}
    
    // List to store the new cases
    Opportunity[] opportunities = new Opportunity[]{};

    // Iterate the top level accounts
    for(Integer i=offset; i<numberOfAccounts; i++){
        
        // Create an opportunity for each contact in the account
        for(Integer j=offset; j<numberOfContacts; j++){
        
            // Postfix to keep track of where we are
            String postfix = String.valueOf(i+1).leftPad(4,'0') + ' - ' + String.valueOf(j+1).leftPad(4,'0');
            
            // Add a new opportunity to the list
            opportunities.add(new Opportunity(
                AccountId      = accounts[i].Id,
                ContactId      = contacts[j].Id,
                Name           = 'LWT - Test - Opportunity - ' + postfix,
                StageName      = (Math.mod(j,2) == 0) ? 'New' : 'Closed/Won',
                CloseDate      = Date.today().addDays(j)
            ));
        }
    }
    insert opportunities;
}


/**
 * @description Method to create Basic Test Opportunities
 */
public void insertOpportunitContactRoles(Integer offset, Integer numberOfAccounts, Integer contactOffset, Integer numberOfContacts){
    
   // Get the account and contact data
    Account[]     accounts      = [SELECT Id FROM Account     WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfAccounts];
    Contact[]     contacts      = [SELECT Id FROM Contact     WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfContacts];
    Opportunity[] opportunities = [SELECT Id FROM Opportunity WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT :numberOfContacts];

    // Basic error handling
    if(numberOfAccounts != accounts.size()){     throw new StringException('Number of accounts does not match number returned by the query');}
    if(numberOfContacts != contacts.size()){     throw new StringException('Number of contacts does not match number returned by the query');}
    if(numberOfContacts != opportunities.size()){throw new StringException('Number of opportunities does not match number returned by the query');}
    
    // List to store the new cases
    OpportunityContactRole[] ocRoles = new OpportunityContactRole[]{};

    // Iterate the top level accounts
    for(Integer i=offset; i<numberOfContacts; i++){
        
        // Create an opportunity for each contact in the account
        for(Integer j=offset; j<numberOfContacts; j++){
        
            // Add a new opportunity to the list
            ocRoles.add(new OpportunityContactRole(
                ContactId      = contacts[j].Id,
                OpportunityId  = opportunities[j].Id
                
            ));
        }
    }
    insert ocRoles;
}
/**
 * /**
 * @author      Justus van den Berg (jfwberg@gmail.com)
 * @date        August 2024
 * @copyright   (c) 2024 Justus van den Berg
 * @license     MIT (See LICENSE file in the project root)
 * @description Test Data generator for SoqlTableParser & SoqlMultiTableParser
 * @note        Create the test data, ideally run 1 by 1 to prevent govenor limits
 *              Run accounts and contacts first. Cases and opportunities require both
 *
 * - https://medium.com/@justusvandenberg/dynamically-handle-salesforce-soql-subquery-response-data-using-apex-8130bd0622aa
 * - https://www.thiscodeworks.com/apex-soqltableparser-soql-subqueries-to-a-single-flat-table/66ba81bc2e62a20014b9150c
 * - https://www.thiscodeworks.com/apex-soqlmultitableparser-soql-subqueries-to-multiple-individual-tables/66ba816f2e62a20014b913aa
 * - https://www.thiscodeworks.com/apex-soqltableparser-soqlmultitableparser-test-data-generator/66ba8543f1197800148899c2
 */
SObject[] parentRecords = [
    SELECT 
        Id, Name,
        (
            SELECT 
                Id, CreatedDate, LastModifiedDate,
                Owner.Name, Owner.Profile.Name, 
                AccountId, FirstName, LastName
            FROM
                Contacts
            WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT 10
        ),
        (
            SELECT
                Id, CreatedDate, LastModifiedDate,
                Owner.Name, Owner.Profile.Name,
                CaseNumber, Subject, Status 
            FROM 
                Cases
            WHERE Subject LIKE 'LWT - Test - %' ORDER BY Subject ASC LIMIT 10
        ),
        (
            SELECT
                Id, CreatedDate, LastModifiedDate,
                Owner.Name, Owner.Profile.Name,
                Name, StageName, CloseDate,
                (
                    SELECT
                        Id, ContactId , OpportunityId, Opportunity.Account.Id 
                    FROM 
                        OpportunityContactRoles
                    LIMIT 10
                )
            FROM 
                Opportunities
            WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT 10
        )
    FROM 
        Account 
    WHERE Name LIKE 'LWT - Test - %' ORDER BY Name ASC LIMIT 10
];


// Example for single table (pretty slow 7 seconds for 1000 records)
List<Map<String,Object>> flatTableData = SoqlTableParser.create(
    (Object[]) JSON.deserializeUntyped(JSON.serialize(parentRecords))
);


// Example for multiple tables (Much faster: 2,8 seconds for 1000 records)
Map<String,List<Map<String,Object>>> multiTableData = SoqlMultiTableParser.create(
    (Object[]) JSON.deserializeUntyped(JSON.serialize(parentRecords))
);
/**
 * @author      Justus van den Berg (jfwberg@gmail.com)
 * @date        August 2024
 * @copyright   (c) 2024 Justus van den Berg
 * @license     MIT (See LICENSE file in the project root)
 * @description Class that converts JSON with nested objects to flat values and
 *              puts all values in a single, flat, combined tabled
 * @use case    The main use case is to transform SOQL query results that can be used
 *              for exporting CSV or XLSX data for external systems like analytics,
 *              security or Data Cloud Data Streams
 * - https://medium.com/@justusvandenberg/dynamically-handle-salesforce-soql-subquery-response-data-using-apex-8130bd0622aa
 */
@SuppressWarnings('PMD.OneDeclarationPerLine, PMD.AvoidGlobalModifier, PMD.CognitiveComplexity, PMD.ExcessiveParameterList')
public with sharing class SoqlTableParser {

    /** **************************************************************************************************** **
     **                                          PRIVATE CONSTANTS                                           **
     ** **************************************************************************************************** **/
    // Parameter names to be ignored when creating the data table
    private final static Set<String> ATTRIBUTE_FILTER = new Set<String>{'attributes','done','totalSize','nextRecordsUrl'};

    // List parameter names of this type will not be appended, this allows for a more flat table
    private final static Set<String> LIST_NAME_FILTER  = new Set<String>{'records'};


    /** **************************************************************************************************** **
     **                                       PUBLIC SUPPORT METHODS                                         **
     ** **************************************************************************************************** **/
    /**
     * @description Create table from an untyped Object list
     * @param input A list of Objects to traverse
     * @return      A list of flattened JSON records
     */
    public static List<Map<String,Object>> create(Object[] input){

        // Create a variable for the data output
        List<Map<String,Object>> output = new List<Map<String,Object>>();

        // Input validation, if the input is null, return an empty list
        if(input == null){return output;}

        // Populate the data by traversing the input and add the data to the output
        // Set the path to an empty string, as it is the top level we begin with
        traverseList(input, output, '');

        // Return the flat table
        return output;
    }


    /** **************************************************************************************************** **
     **                                       PRIVATE TRAVERSE METHODS                                       **
     ** **************************************************************************************************** **/
    /**
     * @description Traverse the parent list
     * @param input  The input to traverse
     * @param output The final output map
     * @param path   The location in the traverse path
     */
    private static void traverseList(Object[] input, List<Map<String,Object>> output, String path){

        // Having this type casting again seems redundant, but doing the check in here
        // saves having to do it twice, what on 10k+ statements gives a small performance improvement
        for(Integer i=0, max=input.size();i<max;i++){

            // Create a new row to combine the values in the list
            Map<String,Object> row = new Map<String,Object>();

            // Handle each child object according to it's type
            if(input[i] instanceof Map<String,Object>){
                traverseMap(
                    (Map<String,Object>) input[i],
                    output,
                    row,
                    path
                );

            // If the child is a list, traverse the child list
            }else if(input[i] instanceof Object[]){
                traverseList(
                    (Object[]) input[i],
                    output,
                    (LIST_NAME_FILTER.contains(path?.substringAfterLast('.'))) ?
                        path?.substringBeforeLast('.') :
                        path
                );

            // Anything other than objects and maps, primitive data types are not supported
            // i.e. String Lists ['a','b','c'] or [1,2,3,] etc. So simply ignore these values
            }else{
                continue;
            }

            // After the traversal is complete, Add the full row to the table
            if(!row.isEmpty()){output.add(row);}
        }
    }


    /**
     * @description Method to traverse a map
     * @param input  The input to traverse
     * @param output The final output map
     * @param row    The current row in the traverse path
     * @param path   The location in the traverse path
     */
    private static void traverseMap(Map<String,Object> input, List<Map<String,Object>> output, Map<String,Object> row, String path){

        // Iterate all the values in the input
        for(String key : input.keySet() ){

            // Continue if an attribute needs to be ignored
            if(ATTRIBUTE_FILTER.contains(key)){continue;}

            // Create the path for the specfic child node
            String childPath = (String.isNotBlank(path) ? path + '.' + key : key);

            // If the child node is an object list, traverse as list
            if(input.get(key) instanceof Object[]){
                traverseList(
                    (Object[]) input.get(key),
                    output,
                    (LIST_NAME_FILTER.contains(childPath?.substringAfterLast('.'))) ?
                        childPath?.substringBeforeLast('.') :
                        childPath
                );

            // If the child node is an object, (i.e. owner.name), traverse as map
            }else if(input.get(key) instanceof Map<String,Object>){
                traverseMap(
                    (Map<String,Object>) input.get(key),
                    output,
                    row,
                    childPath
                );

            // If it's not a map nor a list, it must be a value, so add the value to row
            }else{
                populateRow(
                    input.get(key),
                    childPath,
                    row
                );
            }
        }
    }


    /**
     * @description Method to add the value to a row at the end of a traversel path
     * @param input    The input to traverse
     * @param path     The location in the traverse path
     * @param row      The current row in the traverse path
     */
    private static void populateRow(Object input, String path, Map<String,Object> row){

        // Add the value to the row
        row.put(path,input);
    }
}
/**
 * @author      Justus van den Berg (jfwberg@gmail.com)
 * @date        August 2024
 * @copyright   (c) 2024 Justus van den Berg
 * @license     MIT (See LICENSE file in the project root)
 * @description Class that converts JSON with nested objects to flat values and splits out
 *              each child list to it's own individual list using the path as map key
 *              The parent map key is called "parent", child map keys are based on the
 *              path like: "Opportunities" or Opportunities.OpportunityContactRoles
 * @use case    The main use case is to transform SOQL query results that can be used
 *              for exporting CSV or XLSX data that require individual tables for child lists.
 *              A secondary use is to store related data for archiving purposes where a 
 *              potential reverse loading of related data might be required.
 * - https://medium.com/@justusvandenberg/dynamically-handle-salesforce-soql-subquery-response-data-using-apex-8130bd0622aa
 */
public with sharing class SoqlMultiTableParser {

    /** **************************************************************************************************** **
     **                                          PRIVATE CONSTANTS                                           **
     ** **************************************************************************************************** **/
    // Parameter names to be ignored when creating the data table
    private final static Set<String> ATTRIBUTE_FILTER = new Set<String>{'attributes','done','totalSize','nextRecordsUrl'};

    // List parameter names of this type will not be appended, this allows for a more flat table
    private final static Set<String> LIST_NAME_FILTER  = new Set<String>{'records'};

    
    /** **************************************************************************************************** **
     **                                       PUBLIC SUPPORT METHODS                                         **
     ** **************************************************************************************************** **/
    /**
     * @description  Create table from an untyped Object list
     * @param input  A list of Objects to traverse
     * @param output The final output map
     * @return       A list of flattened JSON records
     */
    public static Map<String,List<Map<String,Object>>> create(Object[] input){

        // Create a variable for the data output
        Map<String,List<Map<String,Object>>> output = new Map<String,List<Map<String,Object>>>();

        // Input validation, if the input is null, return an empty list
        if(input == null){return output;}

        // Populate the data by traversing the input and add the data to the output
        // Set the path to an empty string, as it is the top level we begin with
        traverseList(input, output, 'parent');

        // Return the flat table
        return output;
    }


    /** **************************************************************************************************** **
     **                                       PRIVATE TRAVERSE METHODS                                       **
     ** **************************************************************************************************** **/
    /**
     * @description Traverse the parent list 
     * @param input  The input to traverse
     * @param output The final output map
     * @param path   The location in the traverse path
     */
    private static void traverseList(Object[] input, Map<String,List<Map<String,Object>>> output, String path){

        // Each list goes into it's own flat table, so create the empty set, map and 
        // populate the lists paths
        if(!output.containsKey(path)){
            output.put(path, new List<Map<String,Object>>());
        }
        
        // Having this type casting again seems redundant, but doing the check in here
        // saves having to do it twice, what on 10k+ statements gives a small performance improvement
        for(Integer i=0, max=input.size();i<max;i++){

            // Create a new row to combine the values in the list
            Map<String,Object> row = new Map<String,Object>();

            // Handle each child object according to it's type
            if(input[i] instanceof Map<String,Object>){
                traverseMap((Map<String,Object>) input[i], output, row, path, path);
            
            // If the child is a list, traverse the child list
            }else if(input[i] instanceof Object[]){
                traverseList(
                    (Object[]) input[i],
                    output,
                    (LIST_NAME_FILTER.contains(path?.substringAfterLast('.'))) ?
                        path?.substringBeforeLast('.') :
                        path
                );
            // Anything other than objects and maps, primitive data types are not supported
            // i.e. String Lists ['a','b','c'] or [1,2,3,] etc. So simply ignore these values
            }else{
                continue;
            }
            
            // After the traversal is complete, Add the full row to the table
            if(!row.isEmpty()){output.get(path).add(row);}
        }
    }


    /**
     * @description Method to traverse a map
     * @param input    The input to traverse
     * @param output   The final output map
     * @param row      The current row in the traverse path
     * @param path     The location in the traverse path
     * @param listPath The current list path (map key) in the traverse path
     */
    private static void traverseMap(Map<String,Object> input, Map<String,List<Map<String,Object>>> output, Map<String,Object> row, String path, String listPath){
        
        // Iterate all the values in the input
        for(String key : input.keySet() ){

            // Continue if an attribute needs to be ignored
            if(ATTRIBUTE_FILTER.contains(key)){continue;}

            // Create the path for the specfic child node
            String childPath = ((String.isNotBlank(path) && path != 'parent') ? path + '.' + key : key);

            // If the child node is an object list, traverse as list
            if(input.get(key) instanceof Object[]){
                traverseList(
                    (Object[]) input.get(key),
                    output,
                    (LIST_NAME_FILTER.contains(childPath?.substringAfterLast('.'))) ?
                        childPath?.substringBeforeLast('.') :
                        childPath
                );
            
            // If the child node is an object, (i.e. owner.name), traverse as map
            }else if(input.get(key) instanceof Map<String,Object>){
                traverseMap(
                    (Map<String,Object>) input.get(key),
                    output,
                    row,
                    childPath,
                    listPath
                );

            // If it's not a map or a list, it must a value, so add the value to row
            }else{
                populateRow(
                    input.get(key),
                    childPath,
                    row,
                    listPath
                );
            }
        }
    }


    /**
     * @description Method to add the value to a row at the end of a traversel path
     * @param input    The input to traverse
     * @param path     The location in the traverse path
     * @param row      The current row in the traverse path
     * @param listPath The current list path (map key) in the traverse path
     */
    private static void populateRow(Object input, String path, Map<String,Object> row, String listPath){
        
        // Add the value to the row		
        row.put(path.removeStart(listPath).removeStart('.'),input);
    }

}
let cupsOfSugarNeeded = 2;
let cupsAdded = 0;

do {
  cupsOfSugarNeeded = cupsOfSugarNeeded - cupsAdded;
  cupsAdded++;
  console.log(`Needed: ${cupsOfSugarNeeded}\n Added: ${cupsAdded}`);
} while (cupsAdded < cupsOfSugarNeeded);
# Replace the placeholder information for the following variables:
$ipaddr = '<Nano Server IP address>'
$credential = Get-Credential # <An Administrator account on the system>
$zipfile = 'PowerShell-7.4.4-win-x64.zip'
# Connect to the built-in instance of Windows PowerShell
$session = New-PSSession -ComputerName $ipaddr -Credential $credential
# Copy the file to the Nano Server instance
Copy-Item $zipfile c:\ -ToSession $session
# Enter the interactive remote session
Enter-PSSession $session
# Extract the ZIP file
Expand-Archive -Path C:\PowerShell-7.4.4-win-x64.zip -DestinationPath 'C:\Program Files\PowerShell 7'
# Be sure to use the -Configuration parameter. If you omit it, you connect to Windows PowerShell 5.1
Enter-PSSession -ComputerName $deviceIp -Credential Administrator -Configuration PowerShell.7.4.4
# Replace the placeholder information for the following variables:
$deviceip = '<device ip address'
$zipfile = 'PowerShell-7.4.4-win-arm64.zip'
$downloadfolder = 'u:\users\administrator\Downloads'  # The download location is local to the device.
    # There should be enough  space for the zip file and the unzipped contents.

# Create PowerShell session to target device
Set-Item -Path WSMan:\localhost\Client\TrustedHosts $deviceip
$S = New-PSSession -ComputerName $deviceIp -Credential Administrator
# Copy the ZIP package to the device
Copy-Item $zipfile -Destination $downloadfolder -ToSession $S

#Connect to the device and expand the archive
Enter-PSSession $S
Set-Location u:\users\administrator\Downloads
Expand-Archive .\PowerShell-7.4.4-win-arm64.zip

# Set up remoting to PowerShell 7
Set-Location .\PowerShell-7.4.4-win-arm64
# Be sure to use the -PowerShellHome parameter otherwise it tries to create a new
# endpoint with Windows PowerShell 5.1
.\Install-PowerShellRemoting.ps1 -PowerShellHome .
$ git clone https://github.com/docker/docker-nodejs-sample
1.- de esta manera: 
'modules' => [
    'gridview' =>  [
        'class' => '\kartik\grid\Module',
                    ],
     'redactor' => [
            'class' => '\yii\redactor\RedactorModule',
            'uploadDir' => '@webroot/path/to/uploadfolder',
            'uploadUrl' => '@web/path/to/uploadfolder',
            'imageAllowExtensions'=>['jpg','png','gif']
        ]
        ],
  
2.- O de esta otra manera:
  return [
    'id' => 'app-backend',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'bootstrap' => ['log'],
    'modules' => [ 'redactor' => 'yii\redactor\RedactorModule'], /* el redactor esta aqui */
    'components' => [
        'request' => [
            'csrfParam' => '_csrf-backend',
        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
            'authTimeout' => 60 * 10, // auth expire 
        ],
        'session' => [
            // this is the name of the session cookie used for login on the backend
            'name' => 'advanced-backend',
            'cookieParams' => [/*'httponly' => true,*/'lifetime' => 60 * 10//3600 * 24 * 30
            ],
            'timeout' => 60 * 10,//3600 * 24 * 30,
            'class' => 'yii\web\DbSession',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        /*
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
            ],
        ],
        */
    'site/captcha/<refresh:\d+>' => 'site/captcha',
    'site/captcha/<v:\w+>' => 'site/captcha',
    ],
    'params' => $params,
];
 
class DSU {
public:
    vector<int> parent, rank;

    DSU(int n) {
        parent.resize(n);
        rank.resize(n, 0);
        for (int i = 0; i < n; i++) {
            parent[i] = i;
        }
    }

    int find(int x) {
        if (x != parent[x]) {
            parent[x] = find(parent[x]);
        }
        return parent[x];
    }

    void union_sets(int x, int y) {
        int rootX = find(x);
        int rootY = find(y);
        if (rootX != rootY) {
            if (rank[rootX] > rank[rootY]) {
                parent[rootY] = rootX;
            } else if (rank[rootX] < rank[rootY]) {
                parent[rootX] = rootY;
            } else {
                parent[rootY] = rootX;
                rank[rootX]++;
            }
        }
    }
};  
	    add_filter('use_block_editor_for_post', '__return_false', 10);
    add_filter( 'use_widgets_block_editor', '__return_false' );
/*

This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to
that colour and the font colour will be changed to the inverse colour for readability.

To use this script in a Google Sheets spreadsheet:
1. go to Tools » Script Editor » Spreadsheet;
2. erase everything in the text editor;
3. change the title to "Set colour preview on edit";
4. paste this code in;
5. click File » Save.
*/

/*********
** Properties
*********/
/**
 * A regex pattern matching a valid CSS hex colour code.
 */
var colourPattern = /^#([0-9a-f]{3})([0-9a-f]{3})?$/i;


/*********
** Event handlers
*********/
/**
 * Sets the foreground or background color of a cell based on its value.
 * This assumes a valid CSS hexadecimal colour code like #FFF or #FFFFFF.
 */
function onEdit(e){
  // iterate over cell range  
  var range = e.range;
  var rowCount = range.getNumRows();
  var colCount = range.getNumColumns();
  for(var r = 1; r <= rowCount; r++) {
    for(var c = 1; c <= colCount; c++) {
      var cell = range.getCell(r, c);
      var value = cell.getValue();

      if(isValidHex(value)) {
        cell.setBackground(value);
        cell.setFontColor(getContrastYIQ(value));
      }
      else {
        cell.setBackground('white');
        cell.setFontColor('black');
      }
    }
  }
};


/*********
** Helpers
*********/
/**
 * Get whether a value is a valid hex colour code.
 */
function isValidHex(hex) {
  return colourPattern.test(hex);
};

/**
 * Change text color to white or black depending on YIQ contrast
 * https://24ways.org/2010/calculating-color-contrast/
 */
function getContrastYIQ(hexcolor){
    var r = parseInt(hexcolor.substr(1,2),16);
    var g = parseInt(hexcolor.substr(3,2),16);
    var b = parseInt(hexcolor.substr(5,2),16);
    var yiq = ((r*299)+(g*587)+(b*114))/1000;
    return (yiq >= 128) ? 'black' : 'white';
}
Udemy Clone Software! Our powerful Learning Management Software enables you to create a feature-packed eLearning website that's easy to use and navigate. In short, our Udemy Clone Script, Expert plus LMS, is the perfect ready-made solution to quickly launch your eLearning platform without having to build from scratch.
Gear up your business with immutable, decentralized, and secure blockchain technologies. As the best-in-class blockchain development company, we help startups, firms, and enterprises build more automated, transparent, and effective versions of their businesses with our wide variety of blockchain development services.
Starting an online poker game development software involves several key steps, from planning to execution. Here's a general guide:

1. Market Research
Understand the Market: Study the online poker industry, including current trends, popular games, target audience, and competitors.
Legal Considerations: Research the legal requirements for operating an online poker game in your target regions.
2. Define Your Game Concept
Game Type: Decide on the type of poker game (e.g., Texas Hold'em, Omaha, etc.).
Unique Features: Identify features that will set your game apart, such as multi-table tournaments, customizable avatars, or social interaction features.
3. Choose the Right Technology
Programming Languages: Select appropriate languages (e.g., JavaScript, C#, or Unity) based on your team's expertise.
Platform: Decide whether your game will be web-based, mobile, or desktop.
Server Infrastructure: Choose a reliable server to handle real-time data processing and secure user transactions.
4. Develop the Game
UI/UX Design: Create an intuitive and visually appealing interface.
Game Logic Development: Write the core game algorithms, including card shuffling, dealing, and player interactions.
Integration of Features: Implement payment gateways, anti-fraud mechanisms, and social media integrations.
5. Testing
Beta Testing: Conduct thorough testing to identify bugs, ensure fairness in gameplay, and optimize performance.
Feedback: Collect feedback from testers to make necessary improvements.
6. Launch and Marketing
Soft Launch: Start with a soft launch to gather initial user feedback.
Marketing Strategy: Develop a marketing plan to promote your poker game, including SEO, social media campaigns, and partnerships with influencers.
7. Post-Launch Support
Regular Updates: Continuously update the game with new features, bug fixes, and improvements.
Customer Support: Provide robust customer support to assist players with any issues.
8. Monetization
In-Game Purchases: Offer virtual goods or premium memberships.
Advertising: Consider in-game advertising to generate additional revenue.
Starting an online poker game development software requires a well-thought-out plan, a skilled development team, and a solid understanding of the market. By following these steps, you can build a successful online poker platform.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            background-color: antiquewhite;
            color: black;
            text-align: center;
        }
    </style>
</head>
<body>
    <script>
                console.log("K before declaring=",k);
                var k;  
               function vardemo()
                 { 
                    {
                    var k=7;
                    console.log("K after decalring in function=",k);
                    var k=77;
                 }
                      console.log("K value after assigning value in same block",k);
                      }
                      vardemo();
            console.log("k after funtion=",k);           
            var k=8;
            console.log("K after assigning value =",k);    
            
            
            let a;
            console.log("a before intlization=",a);
            a=15;
            console.log("after declaration a=",a)
            function f()
            {
                let a=10;
                if(true)
                {
                    let a=20;
                    console.log("a after declaring in function=",a);
                }
                console.log("after block a=",a);
            }
            f();
            a=16;
            console.log("after declaring again a=",a);

            try {
                    const n=90;
                    console.log(" constant n=",n);
                    n=89;
                    console.log(" constant number after assigning again=",n);
                    
            }catch(e){ 
                       {console.log("Error :",e.message);}

                    } 
                   
    </script>
    
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Notice</h2>
  <!-- Button to Open the Modal -->
  <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">
    click
  </button>

  <!-- The Modal -->
  <div class="modal fade" id="myModal">
    <div class="modal-dialog modal-lg"> 
        <div class="modal-header">
          <h4 class="modal-title">Information</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
      <div class="modal-content">
              <!-- Modal body -->
      
        
       


        <div class="container">
            <h2>Inline form</h2>
            <p>Make the viewport larger than 576px wide to see that all of the form elements are inline and left-aligned. On small screens, the form groups will stack horizontally.</p>
            <form class="form-inline" action="/action_page.php">
              <label for="email">Email:</label>
              <input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
              <label for="pwd">Password:</label>
              <input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pswd">
              <div class="form-check">
                <label class="form-check-label">
                  <input class="form-check-input" type="checkbox" name="remember"> Remember me
                </label>
              </div>
              <button type="submit" class="btn btn-primary">Submit</button>
            </form>
          </div>


           <!-- Modal footer -->
        <div class="modal-footer">
            <button type="button" class="btn btn-s" data-dismiss="modal">ok</button>
          </div>
        
      </div>
    </div>
  </div>
  
</div>

</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Button group</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
   



<div class="container">



<h4>Hey I am a collapsable button and click me to see the effects</h2>






    <button type="button" class="btn btn-primary" data-toggle="collapse" data-target="#demo">Submit</button>
    <div id="demo" class="collapse">
    you successfully submitted  the form
  </div>

  <h4>button group-outlined</h4>

  <div class="btn-group" role="group" aria-label="Basic outlined example">
      <button type="button" class="btn btn-outline-primary">First</button>
      <button type="button" class="btn btn-outline-primary">Second</button>
      <button type="button" class="btn btn-outline-primary">Third</button>
    </div>
</div>



   
<div class="container mt-5">
    <h4>Checkbox type buttons</h4>
    <div class="btn-group" role="group" aria-label="Basic checkbox toggle button group">
        <input type="checkbox" class="btn-check" id="btncheck1" autocomplete="off">
        <label class="btn btn-outline-primary" for="btncheck1">Checkbox 1</label>
      
        <input type="checkbox" class="btn-check" id="btncheck2" autocomplete="off">
        <label class="btn btn-outline-primary" for="btncheck2">Checkbox 2</label>
      
        <input type="checkbox" class="btn-check" id="btncheck3" autocomplete="off">
        <label class="btn btn-outline-primary" for="btncheck3">Checkbox 3</label>
      </div>

<h4>
    Radio type button group
</h4>
      <div class="btn-group" role="group" aria-label="Basic radio toggle button group">
        <input type="radio" class="btn-check" name="btnradio" id="btnradio1" autocomplete="off" checked>
        <label class="btn btn-outline-primary" for="btnradio1">Morning</label>
      
        <input type="radio" class="btn-check" name="btnradio" id="btnradio2" autocomplete="off">
        <label class="btn btn-outline-primary" for="btnradio2">Afternoon</label>
      
        <input type="radio" class="btn-check" name="btnradio" id="btnradio3" autocomplete="off">
        <label class="btn btn-outline-primary" for="btnradio3">Evening</label>
        <input type="radio" class="btn-check" name="btnradio" id="btnradio4" autocomplete="off" checked>
        <label class="btn btn-outline-primary" for="btnradio4">Night</label>
      </div>
      

</div>

 


    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Please see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-29: Monday, 29th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*.\n:Lunch: *Lunch*: from *12pm* in the kitchen.\n:massage:*Wellbeing*: Pilates at *SP Brisbane City* is bookable every Monday! Watch this channel on how to book."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-31: Wednesday,31st July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*.\n:late-cake: *Morning Tea*:from *10am* in the kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Wednesday, 21nd August*\n :blob-party: *Social +*: Drinks, food, and engaging activities bringing everyone together."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19uY2M4cDN1NDRsdTdhczE0MDhvYjZhNnRjb0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Brisbane Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Please see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-31: Wednesday, 14 August",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café Partnership: Enjoy free coffee and café-style beverages from our partner, *Elixir Sabour*, which used to be called Hungry Bean.\n:breakfast: *Morning Tea*: Provided by *Elixir Sabour* from *9AM - 10AM* in the All Hands.\n:massage:*Wellbeing*: Crossfit class at *Be Athletic* from 11am."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-1: Thursday, 15th August",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Café Partnership: Enjoy coffee and café-style beverages from our partner, *Elixir Sabour*, which used to be called Hungry Bean.\n:late-cake: *Lunch*: Provided by *Elixir Sabour* from *12:30PM - 1:30PM* in the All Hands."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Thursday, 22nd August*\n :blob-party: *Social +*: Drinks, food, and engaging activities bringing everyone together."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0/r?cid=Y185aW90ZWV0cXBiMGZwMnJ0YmtrOXM2cGFiZ0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Sydney Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
function changeColor() {
    
    const randomColor = Math.floor(Math.random() * 16777215).toString(16);

    if (document.body.style.backgroundColor !== 'black') {
        document.body.style.backgroundColor = randomColor;
    }
    
    document.body.style.backgroundColor = '#' + randomColor;
    console.log(randomColor);
}
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from transformers import BertTokenizer, BertForSequenceClassification
from transformers import Trainer, TrainingArguments
import torch
from sklearn.metrics import accuracy_score

# Step 1: Load the dataset
file_path = './dataset/Amazon-Product-Reviews - Amazon Product Review (1).csv'
df = pd.read_csv(file_path)

# Step 2: Check the first few rows and column names
print("First few rows of the dataset:")
print(df.head())

print("\nColumns in the dataset:")
print(df.columns)

# Step 3: Handling missing values
df = df.dropna()

# Step 4: Convert categorical variables to numeric
categorical_columns = ['marketplace', 'product_id', 'product_title', 'product_category', 'vine', 'verified_purchase', 'review_headline']
label_encoders = {}

for column in categorical_columns:
    if column in df.columns:
        le = LabelEncoder()
        df[column] = le.fit_transform(df[column])
        label_encoders[column] = le

# Step 5: Feature Engineering
if 'review_date' in df.columns:
    df['Year'] = pd.to_datetime(df['review_date']).dt.year

# Extract features and target
X_text = df['review_body']  # Textual data
y = df['sentiment']

# Split the data
X_train_text, X_test_text, y_train, y_test = train_test_split(
    X_text, y, test_size=0.2, random_state=42
)

# Step 6: Prepare data for BERT
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')

def tokenize_function(texts):
    return tokenizer(texts, padding='max_length', truncation=True, max_length=512)

train_encodings = tokenize_function(X_train_text.tolist())
test_encodings = tokenize_function(X_test_text.tolist())

class SentimentDataset(torch.utils.data.Dataset):
    def __init__(self, encodings, labels):
        self.encodings = encodings
        self.labels = labels

    def __getitem__(self, idx):
        item = {key: torch.tensor(val[idx]) for key, val in self.encodings.items()}
        item['labels'] = torch.tensor(self.labels.iloc[idx])
        return item

    def __len__(self):
        return len(self.labels)

train_dataset = SentimentDataset(train_encodings, y_train)
test_dataset = SentimentDataset(test_encodings, y_test)

# Step 7: Train a BERT model
model = BertForSequenceClassification.from_pretrained('bert-base-uncased', num_labels=2)

training_args = TrainingArguments(
    output_dir='./results',
    num_train_epochs=3,
    per_device_train_batch_size=8,
    per_device_eval_batch_size=8,
    warmup_steps=500,
    weight_decay=0.01,
    logging_dir='./logs',
    logging_steps=10,
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=train_dataset,
    eval_dataset=test_dataset,
)

trainer.train()

# Step 8: Evaluate the model
predictions = trainer.predict(test_dataset)
preds = predictions.predictions.argmax(axis=1)
accuracy = accuracy_score(y_test, preds)

print(f"\nAccuracy of the BERT model: {accuracy:.4f}")
#include<iostream>
using namespace std;
int main()
{
    int age;
    cout<<"enter the age";
    cin>>age;
    if (age>18)
    {
        cout<<"valid for vote";
    }
    else
    {
        cout<<"not valid for vote";
    }
    return 0;
}
Open the Windows Registry Editor (regedit), and go to the following key:
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/FileSystem
Set the value of the NtfsDisable8dot3NameCreation key to 1.
Restart the system.
star

Wed Aug 14 2024 03:48:21 GMT+0000 (Coordinated Universal Time)

@NoFox420 #css

star

Tue Aug 13 2024 23:41:56 GMT+0000 (Coordinated Universal Time) https://app.slack.com/block-kit-builder/T49PT3R50#%7B%22blocks%22:%5B%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22:star:%20Boost%20Days%20-%20What's%20on%20this%20week!%20:star:%22%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22Welcome%20to%20another%20fantastic%20week%20Auckland!%5CnWe're%20excited%20to%20jump%20back%20into%20another%20week%20in%20the%20office%20with%20our%20new%20Boost%20Day%20Program.%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22:calendar-date-20:%20Tuesday,%2020th%20August%22,%22emoji%22:true%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22%5Cn:coffee:%20*Xero%20Caf%C3%A9*:%20Caf%C3%A9-style%20beverages%20and%20sweet%20treats.%5Cn:four_leaf_clover:%20*Weekly%20Caf%C3%A9%20Special*:%20_Irish%20Coffee%20Flavoured%20Latte_.%5Cn:breakfast:%20*Breakfast*:%20Provided%20by%20*CBD%20Catering*%20from%20*8.30AM%20-%2010.30AM*%20in%20All%20Hands.%5Cn:nails-black:*Manicures:*%20Emma%20from%20Tipsity%20is%20back%20offering%20manicures.%20%3Chttps://docs.google.com/spreadsheets/d/1pTGAD8oFXmPF890Uzj4d-Crfch8muuzEzDnNyBA9ReY/edit?gid=784936123#gid=784936123%7C*treat%20yourself%20here*%3E!%22%7D%7D,%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22:calendar-date-22:%20Thursday,%2022nd%20August%22,%22emoji%22:true%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22:coffee:%20*Xero%20Caf%C3%A9*:%20Caf%C3%A9-style%20beverages%20and%20sweet%20treats.%5Cn*Please%20note:*%20this%20time%20in%20the%20Small%20Kitchen%20on%20level%203:comicsans-_exclamation:%5Cn%5Cn:four_leaf_clover:%20*Weekly%20Caf%C3%A9%20Special*:%20_Irish%20Coffee%20Flavoured%20Latte_.%5Cn:late-cake:%20*Afternoon%20Tea*:%20Provided%20by%20*Sticky%20Fingers*%20from%20%5Cn*2pm%20-%203pm*%20in%20All%20Hands.%5Cn*Please%20note:*%20this%20time%20in%20the%20Small%20Kitchen%20on%20level%203:comicsans-_exclamation:%5Cn%5Cn:massage:%20*Wellness:*%20Massage%20Therapy%20by%20Hamish%20in%20the%20Gym.%20Sign%20up%20%3Chttps://corporate-massage.co.nz/bookable/make/appt/booking.php?c=godrjn%7C*here*%3E!%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*What%20else%20is%20on?*%22%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22%5Cn:handshake:%20Global%20All%20Hands%20on%20*Tuesday,%2020th%20August%20at%201pm.*%20Please%20join%20us%20in%20All%20Hands%20to%20watch%20the%20live%20streaming%20of%20this%20months%20GAH.%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22Stay%20tuned%20to%20this%20channel%20for%20more%20details,%20check%20out%20the%20%3Chttps://calendar.google.com/calendar/u/0?cid=eGVyby5jb21fMXM4M3NiZzc1dnY0aThpY2FiZDZvZ2xncW9AZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ%7C*Auckland%20Social%20Calendar.*%3E%5Cn%5CnLove,%5CnWX%20Team%20:party-wx:%22%7D%7D%5D%7D

@FOHWellington

star

Tue Aug 13 2024 20:05:41 GMT+0000 (Coordinated Universal Time) www.codecademy.com

@thecowsays #javascript

star

Tue Aug 13 2024 18:46:52 GMT+0000 (Coordinated Universal Time) https://maricopa.instructure.com/styleguide

@cherylcolan #html #css #hyperlink #button #colors #icons

star

Tue Aug 13 2024 18:45:06 GMT+0000 (Coordinated Universal Time) https://verbose-tribble-pjjxpj744p74frvvw.github.dev/?autoStart

@laith #personal

star

Tue Aug 13 2024 17:36:50 GMT+0000 (Coordinated Universal Time) www.codecademy.com

@thecowsays #javascript

star

Tue Aug 13 2024 16:53:16 GMT+0000 (Coordinated Universal Time) https://maricopa.instructure.com/styleguide

@cherylcolan #html

star

Tue Aug 13 2024 15:51:47 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/powershell/module/psreadline/get-psreadlinekeyhandler?view

@baamn #powershell #psreadline

star

Tue Aug 13 2024 15:07:58 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/powershell/module/powershellget/register-psrepository?view

@baamn

star

Tue Aug 13 2024 13:56:29 GMT+0000 (Coordinated Universal Time)

@Shira

star

Tue Aug 13 2024 13:00:04 GMT+0000 (Coordinated Universal Time) https://x-space.alibabacloud.com/#/system/IM

@Piolo

star

Tue Aug 13 2024 12:54:09 GMT+0000 (Coordinated Universal Time) https://x-space.alibabacloud.com/

@Piolo

star

Tue Aug 13 2024 11:18:52 GMT+0000 (Coordinated Universal Time)

@ahmad_raza #undefined

star

Tue Aug 13 2024 09:07:30 GMT+0000 (Coordinated Universal Time)

@signup

star

Tue Aug 13 2024 08:07:17 GMT+0000 (Coordinated Universal Time) https://developer.mozilla.org/en-US/docs/Web/API/WebSocket

@theshyxin

star

Tue Aug 13 2024 03:08:18 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/azure/virtual-machines/linux/create-ssh-keys-detailed

@acassell

star

Mon Aug 12 2024 21:57:23 GMT+0000 (Coordinated Universal Time)

@Justus

star

Mon Aug 12 2024 21:47:43 GMT+0000 (Coordinated Universal Time)

@Justus

star

Mon Aug 12 2024 21:42:20 GMT+0000 (Coordinated Universal Time)

@Justus

star

Mon Aug 12 2024 21:41:03 GMT+0000 (Coordinated Universal Time)

@Justus

star

Mon Aug 12 2024 19:26:45 GMT+0000 (Coordinated Universal Time) https://www.codecademy.com

@thecowsays #javascript

star

Mon Aug 12 2024 17:48:11 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/es-es/powershell/scripting/install/installing-powershell-on-windows?view

@angel_leonardo1

star

Mon Aug 12 2024 17:48:01 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/es-es/powershell/scripting/install/installing-powershell-on-windows?view

@angel_leonardo1

star

Mon Aug 12 2024 17:47:53 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/es-es/powershell/scripting/install/installing-powershell-on-windows?view

@angel_leonardo1

star

Mon Aug 12 2024 17:47:38 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/es-es/powershell/scripting/install/installing-powershell-on-windows?view

@angel_leonardo1

star

Mon Aug 12 2024 17:38:38 GMT+0000 (Coordinated Universal Time) https://docs.docker.com/language/nodejs/containerize/

@angel_leonardo1

star

Mon Aug 12 2024 16:04:15 GMT+0000 (Coordinated Universal Time) https://coefficient.io/google-sheets-tutorials/how-to-combine-text-from-two-cells-in-google-sheets

@baamn

star

Mon Aug 12 2024 14:39:21 GMT+0000 (Coordinated Universal Time) https://vuejs.org/guide/quick-start

@hammad

star

Mon Aug 12 2024 14:17:25 GMT+0000 (Coordinated Universal Time)

@leamiz100

star

Mon Aug 12 2024 14:17:23 GMT+0000 (Coordinated Universal Time)

@leamiz100

star

Mon Aug 12 2024 13:52:04 GMT+0000 (Coordinated Universal Time)

@jrg_300i #undefined

star

Mon Aug 12 2024 13:46:55 GMT+0000 (Coordinated Universal Time)

@gohilghanu

star

Mon Aug 12 2024 13:28:56 GMT+0000 (Coordinated Universal Time)

@BilalRaza12

star

Mon Aug 12 2024 12:23:41 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/46427564/set-the-background-color-to-a-cell-based-on-a-hex-value

@baamn #javascript

star

Mon Aug 12 2024 12:13:04 GMT+0000 (Coordinated Universal Time)

@baamn #sheets

star

Mon Aug 12 2024 11:29:41 GMT+0000 (Coordinated Universal Time) https://www.bsetec.com/udemy-clone

@bsetec #lmsclone #lmsclonescript #udemycloneapp #udemyclonescript #udemyclonesoftware #udemyclone

star

Mon Aug 12 2024 11:27:53 GMT+0000 (Coordinated Universal Time) https://www.bsetec.com/blockchain-development-company

@bsetec #blockchain #blockchaindevelopmentcompany #blockchaindevelopmentcompanyandweb3services #blockchainservices #blockchainsoftwarecompany

star

Mon Aug 12 2024 06:59:30 GMT+0000 (Coordinated Universal Time) https://creatiosoft.com/poker-game-development

@Rishabh

star

Mon Aug 12 2024 05:52:35 GMT+0000 (Coordinated Universal Time)

@signup

star

Mon Aug 12 2024 05:38:02 GMT+0000 (Coordinated Universal Time)

@signup

star

Mon Aug 12 2024 04:44:12 GMT+0000 (Coordinated Universal Time)

@signup

star

Sun Aug 11 2024 23:39:37 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Sun Aug 11 2024 23:29:20 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Sun Aug 11 2024 21:31:08 GMT+0000 (Coordinated Universal Time)

@destinyChuck #json #vscode

star

Sun Aug 11 2024 19:26:39 GMT+0000 (Coordinated Universal Time) https://m.facebook.com/100092516409347/

@Elshadow

star

Sun Aug 11 2024 19:14:39 GMT+0000 (Coordinated Universal Time) https://m.facebook.com/login/identify/

@Elshadow

star

Sun Aug 11 2024 15:57:59 GMT+0000 (Coordinated Universal Time) https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics

@DevomdDOM93

star

Sun Aug 11 2024 10:40:48 GMT+0000 (Coordinated Universal Time)

@christiana

star

Sun Aug 11 2024 09:37:06 GMT+0000 (Coordinated Universal Time)

@prawarjain

star

Sun Aug 11 2024 06:03:08 GMT+0000 (Coordinated Universal Time) https://support.oracle.com/knowledge/Middleware/2083752_1.html

@Curable1600 #windows

Save snippets that work with our extensions

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