Snippets Collections
// in code snippet.
function sptp_suppress_filters_mod( $suppress_filters){
	if (defined('DOING_AJAX') && DOING_AJAX) {
	 	$suppress_filters = true;
	 } else {
	 	$suppress_filters = false;
	}

	return $suppress_filters;
}
add_filter( 'sptp_suppress_filters', 'sptp_suppress_filters_mod');

function sptp_filter_groups_mod( $group, $shortcode_id ){
	if('' == $group ){
		$sptp_group = get_terms(array(
			'taxonomy' => 'sptp_group',
			'hide_empty' => false,
		));
		$group = array();
		foreach($sptp_group as $category) {
			$group[] = $category->slug;
		}
	}
	return $group;
}
add_filter( 'sptp_filter_groups', 'sptp_filter_groups_mod', 10, 2);

// New hook in ajax search funtion.
$group = apply_filters( 'sptp_filter_groups', $group, $generator_id );

// Helper.php in sptp_query funtion
if ( isset( $group ) && ! empty( $group ) ) {
			$args['tax_query'] = array(
				array(
					'taxonomy' => 'sptp_group',
					'field'    => 'slug',
					'terms'    => $group,
				),
			);
		}
SELECT cLastName, cFirstName, cPhone
  FROM customers
  WHERE cZipCode = '90840'
  ORDER BY cLastName ASC, cFirstName ASC;
SELECT cLastName, cFirstName, cPhone
  FROM customers
  WHERE cZipCode = '90840';
SELECT {attribute}+
  FROM {table}+
  [ WHERE {boolean predicate to pick rows} ]
  [ ORDER BY {attribute}+ ];
     let currentSelectedCell = playersTableView.cellForRow(at: indexPath) as! PlayerDetailsTableViewCell
        
        if selectedRow == -1 {
            currentSelectedCell.playerDetailsView.layer.borderColor = hexStringToUIColor(hex: "F34141").cgColor
            currentSelectedCell.playerDetailsView.layer.borderWidth = 1
            selectedRow = indexPath.row
        } else if indexPath.row == selectedRow {
            currentSelectedCell.playerDetailsView.layer.borderWidth = 0
            selectedRow = -1
        } else {
            currentSelectedCell.playerDetailsView.layer.borderColor = hexStringToUIColor(hex: "F34141").cgColor
            currentSelectedCell.playerDetailsView.layer.borderWidth = 1
            
            let newIndexPath = IndexPath(item: selectedRow, section: 0)
            if let cell = playersTableView.cellForRow(at: newIndexPath) as? PlayerDetailsTableViewCell {
                cell.playerDetailsView.layer.borderWidth = 0
            }
            selectedRow = indexPath.row
        }
        DELETE FROM <table name>
        WHERE <condition>;
        UPDATE <table name>
        SET <attribute> = <expression>
        WHERE <condition>;
        INSERT INTO <table name>
        VALUES (<value 1>, ... <value n>);
        DROP TABLE <table name>;

        ALTER TABLE <table name>
        DROP CONSTRAINT <constraint name>;
System.out.printf("--------------------------------%n");
System.out.printf(" Java's Primitive Types         %n");
System.out.printf(" (printf table example)         %n");

System.out.printf("--------------------------------%n");
System.out.printf("| %-10s | %-8s | %4s |%n", "CATEGORY", "NAME", "BITS");
System.out.printf("--------------------------------%n");

System.out.printf("| %-10s | %-8s | %04d |%n", "Floating", "double",  64);
System.out.printf("| %-10s | %-8s | %04d |%n", "Floating", "float",   32);
System.out.printf("| %-10s | %-8s | %04d |%n", "Integral", "long",    64);
System.out.printf("| %-10s | %-8s | %04d |%n", "Integral", "int",     32);
System.out.printf("| %-10s | %-8s | %04d |%n", "Integral", "char",    16);
System.out.printf("| %-10s | %-8s | %04d |%n", "Integral", "short",   16);
System.out.printf("| %-10s | %-8s | %04d |%n", "Integral", "byte",    8);
System.out.printf("| %-10s | %-8s | %04d |%n", "Boolean",  "boolean", 1);

System.out.printf("--------------------------------%n");
int motor1pin1 = 2;
int motor1pin2 = 3;

int motor2pin1 = 4;
int motor2pin2 = 5;


void setup() {
  // put your setup code here, to run once:
  pinMode(motor1pin1,OUTPUT);
  pinMode(motor1pin2,OUTPUT);
  pinMode(motor2pin1,OUTPUT);
  pinMode(motor2pin2,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(motor1pin1,HIGH);
  digitalWrite(motor1pin2,LOW);

  digitalWrite(motor2pin1,HIGH);
  digitalWrite(motor2pin2,LOW);  
 
}
$("#uiLocation").find('thead').prepend(`
      <tr> +
        <th class="t-Report-colHead" align="center" colspan="1"></th> +
        <th class="t-Report-colHead" align="center" colspan="2">Running Totals</th> +
        <th class="t-Report-colHead" align="center" colspan="2">End of Last Period</th> +
        <th class="t-Report-colHead" align="center" colspan="2">Stock Count
      </tr>`
    );
reate a new branch named Homework17 using GitHub Desktop.

2. Create a new file, Homework17.java in IntelliJ IDEA.

3. Create a test case, addSongToPlaylist() using @Test annotation
and the helper/reusable methods we created.

4. Navigate to "https://bbb.testpro.io/".

5. Log in with your credentials.

6. Search for a song (choose any song of your choice).

7. Click View All to display the search results.

8. Click the first song in the search results.

9. Click ADD TO...

10. Choose the playlist to add it to, (we can create a new one with a unique name).

11. Verify that the notification message appears.

12. Verify that notification message has the text, "Added 1 song into {your playlist}".

13. Commit your changes to the new branch Homework17.

14. Push your code to the remote repository.

15. Create a pull request.


Note: Your work will be auto graded so you can continue with the next assignment in less than a minute (just refresh the results page).
tcp
udp
tcp.port == 80 || udp.port == 80
http
not arp and not (udp.port == 53)
import BaseTreatment, { teardownWithOptimizelyPages } from 'cromedics/classes/BaseTreatment';
import { pages } from 'optimizely.json';


class BasicTreatment extends BaseTreatment {
  constructor(variation) {
    super();
    this.variation = variation;
    teardownWithOptimizelyPages(this, pages);
  }
  apply() {
    super.apply();
    this.applyClass(TAG + this.variation); 

// code here
// use this.variation to access variation variable
//

  }
  teardown() {
    super.teardown();
  }
}

SHARED.applyTreatment = (variation) => {
  SHARED.treatment = SHARED.treatment || (SHARED.treatment = new BasicTreatment(variation));
  SHARED.treatment.on();
};
npm create vite@latest name-of-your-project -- --template react
# follow prompts
cd <your new project directory>
npm install react-router-dom localforage match-sorter sort-by
npm run dev


//root router
//main jsx
import React from "react";
import ReactDOM from "react-dom/client";
import {
  createBrowserRouter,
  RouterProvider,
} from "react-router-dom";
import "./index.css";

import Root from "./routes/Root";

const router = createBrowserRouter([
  {
    path: "/",
    element: <Root />,
    errorElement: <ErrorPage />,
  },
]);

ReactDOM.createRoot(document.getElementById("root")).render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>
);

ReactDOM.createRoot(document.getElementById("root")).render(
  <React.StrictMode>
    <RouterProvider router={router} />
  </React.StrictMode>
);

// En src/routes/root.jsx

export default function Root() {
  return (
    <>
      <div id="sidebar">
        <h1>React Router Contacts</h1>
        <div>
          <form id="search-form" role="search">
            <input
              id="q"
              aria-label="Search contacts"
              placeholder="Search"
              type="search"
              name="q"
            />
            <div
              id="search-spinner"
              aria-hidden
              hidden={true}
            />
            <div
              className="sr-only"
              aria-live="polite"
            ></div>
          </form>
          <form method="post">
            <button type="submit">New</button>
          </form>
        </div>
        <nav>
          <ul>
            <li>
              <a href={`/contacts/1`}>Your Name</a>
            </li>
            <li>
              <a href={`/contacts/2`}>Your Friend</a>
            </li>
          </ul>
        </nav>
      </div>
      <div id="detail"></div>
    </>
  );
}

// create src/error-page.jsx
import { useRouteError } from "react-router-dom";

export default function ErrorPage() {
  const error = useRouteError();
  console.error(error);

  return (
    <div id="error-page">
      <h1>Oops!</h1>
      <p>Sorry, an unexpected error has occurred.</p>
      <p>
        <i>{error.statusText || error.message}</i>
      </p>
    </div>
  );
}


// create src/routes/contact.jsx
class Solution {
public:
    int minSubArrayLen(int target, vector<int>& nums) {
        int n=nums.size();
        int l=0,r=0;
        int sum=0, ans=INT_MAX;
        while(r < n)
        {
            sum+=nums[r];
            while(sum >= target) 
            {
                //if(sum==target)
                ans = min(ans, r-l+1);
                sum -= nums[l];
                l++;
            }
            r++;
        }
        if (ans == INT_MAX) return 0;
        return ans;
    }
};
#!/usr/bin/env python3
import subprocess
import sys

arg = sys.argv[1]

screeninfo = [
    s for s in subprocess.check_output("xrandr").decode("utf-8").split()\
    if s.count("+") == 2
    ]

if arg == "left":
    match = [s for s in screeninfo if s.endswith("+0+0")][0]
elif arg == "right":
    match = [s for s in screeninfo if not s.endswith("+0+0")][0]

data = [item.split("x") for item in match.split("+")]
numbers = [int(n) for n in [item for sublist in data for item in sublist]]
coord = [str(int(n)) for n in [(numbers[0]/2)+numbers[2], (numbers[1]/2)+numbers[3]]]

subprocess.Popen(["xdotool", "mousemove", coord[0], coord[1]])
// Online C++ compiler to run C++ program online
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
  
  int n , m , q  ; 
  cin >> n >> m >> q ; 
 
 long long a[n+1][m+1] , f2[n+1][m+1] = {0}  , f[n+1][m+1] = {0} ; 
 
 for ( int i = 1 ; i <= n ; i ++)
 {
     for (int j = 1 ; j <=m ; j ++)
     {
          cin >>a[i][j] ; 
         if ( j != 1 )
         f[i][j] = a[i][j] + f[i][j-1] ; 
         else 
         f[i][j] = a[i][j] ; 
          cout <<f[i][j]<<" " ; 
          
     }
   cout <<"\n" ; 
 }
 
     for ( int i = 1 ; i <= m ; i ++ )
     {
         for ( int j = 1 ; j <= n ; j ++)
 {
           if ( j != 1 )
         f2[j][i] = a[j][i] + f2[j-1][i] ; 
         else 
         f2[j][i] = a[j][i] ; 
         cout <<f2[j][i]<<" " ; 
     }
     cout <<"\n" ; 
   
 }
  
             
 
 while (q -- )
 {
     int x , y , x1 , y1 , sum = 0 ; 
     cin >> x >> y >> x1 >> y1; 
     
     for ( int col = x ; col <= x1 ; col ++ )
     {
         if ( y == 1 )
         sum += f[col ][y1 ] ; 
         else 
         sum += f[col ][y1 ] -  f[col ][y ]  + a[col ][y ];
     }
      cout <<sum <<"\n" ;
      
 }
 
 
    return 0;
}
var message = new MailMessage();
message.From = new MailAddress("sender@foo.bar.com");

message.To.Add(new MailAddress("5551234567@txt.att.net"));//See carrier destinations below
//message.To.Add(new MailAddress("5551234568@txt.att.net"));

//message.CC.Add(new MailAddress("carboncopy@foo.bar.com"));
message.Subject = "This is my subject";
message.Body = "This is the content";

var client = new SmtpClient();
client.Send(message);
string[] strängVektor = new string[5];
bool minBool = true;
int input = 0;
string föremål;

while (minBool)
{
    Console.WriteLine("Välkommen till ryggsäcken!");

    Console.WriteLine("[1] Lägg till fem föremål i ryggsäcken");
    Console.WriteLine("[2] Skriv ut dina fem föremål");
    Console.WriteLine("[3] Sök i ryggsäcken");
    Console.WriteLine("[4] Avsluta programmet");
    input = Convert.ToInt32(Console.ReadLine());


    switch (input)
    {
        case 1:
            for (int i = 0; i < 6; i++)
            {
                Console.WriteLine(strängVektor[i]);
            }

            break;



    }
SmtpClient smtpClient = new SmtpClient();
NetworkCredential smtpCredentials = new NetworkCredential("email from","password");

MailMessage message = new MailMessage();
MailAddress fromAddress = new MailAddress("email from");
MailAddress toAddress = new MailAddress("email to");

smtpClient.Host = "smpt host address";
smtpClient.Port = your_port;
smtpClient.EnableSsl = true;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = smtpCredentials;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.Timeout = 20000;

message.From = fromAddress;
message.To.Add(toAddress);
message.IsBodyHtml = false;
message.Subject = "example";
message.Body = "example";

smtpClient.Send(message);
setInterval(() => {
    var definition = document.getElementsByClassName('StudentPrompt-text')[0].childNodes[0].innerHTML
    var wordsDict = JSON.parse(window.localStorage.getItem("wordsDict"));
    var answer;
    if (wordsDict['definition'].indexOf(definition) >= 0){
        answer = wordsDict['meaning'][wordsDict['definition'].indexOf(definition)]
    } else {
        answer = wordsDict['definition'][wordsDict['meaning'].indexOf(definition)]
    }

    var answers = document.getElementsByClassName('StudentAnswerOption-text')
    
    for (i = 0; i < answers.length; i++){
        console.log(answer)
        if (answer == answers[i].childNodes[0].innerHTML){
            answers[i].parentNode.parentNode.click()
        }
    }
}, 100)
SELECT entity.value:id::STRING AS entity_id, record.value:data:id::STRING AS entity_record_id, record.value:data:first_name::STRING AS first_name, record.value:data:last_name::STRING AS last_name, record.value:data:name::STRING AS name, record.value:data:payment_default::BOOLEAN AS payment_default
  FROM (SELECT tilores_search({'name': 'John Smiith'}) AS entities),
  LATERAL FLATTEN (INPUT => entities) AS entity,
  LATERAL FLATTEN (INPUT => entity.value:records) AS record;
SELECT "id" AS search_id, tilores.entity:id::STRING AS entity_id, record.value:data:id::STRING AS entity_record_id, record.value:data:first_name::STRING AS first_name, record.value:data:last_name::STRING AS last_name, record.value:data:name::STRING AS name
  FROM (SELECT "id" FROM orders LIMIT 1),
  LATERAL (SELECT tilores_entity_by_record_id("id") AS entity) AS tilores,
  LATERAL FLATTEN (INPUT => entity:records) AS record;
SELECT tilores_entity_by_record_id("id") AS entity FROM orders LIMIT 1;
SELECT tilores_ingest(OBJECT_CONSTRUCT( * )) AS ingested FROM orders;


SELECT tilores_ingest(OBJECT_CONSTRUCT( * )) AS ingested FROM newsletter_subscriptions;
{
    "first_name": "John",
    "last_name": "Smith"
}
{
    "email": "somemail@exampleemail.com"
}
(SELECT "id", "first_name", "last_name", NULL AS "name", "email", "payment_default" FROM orders LIMIT 1)
UNION
(SELECT "id", NULL AS "first_name", NULL AS "last_name", "name", "email", NULL AS "payment_default" FROM newsletter_subscriptions LIMIT 1);
CREATE TABLE newsletter_subscriptions (
	"id" VARCHAR,
    "name" VARCHAR,
    "email" VARCHAR
);


INSERT INTO newsletter_subscriptions VALUES
('72ff220f-af81-45c6-a9ab-ae406ef9cf0b', 'John Smith', 'john.smith@example.com'),
('5d974e06-a94b-4dbf-93d3-88bdb911c145', 'John Robert Smith', 'js@example.com'),
('d3dcb867-5f90-456a-a10b-8cdc42c47ee7', 'Jane Doe', 'jane@example.com'),
('03f7c5d4-0a12-456e-9412-cf304c8501f4', 'J. Robert Smith', 'js@example.com');
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

    <c:set var="abc" value="20"/>
    
    <c:if test="${abc>15}">
         <c:redirect url="http://www.google.com"/>    
    </c:if>
    
    <c:if test="${abc<15}">
         <c:redirect url="http://www.micromsol.com"/>
    </c:if>

</body>
</html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>JSTL forTokens tag</title>
</head>
<body>

     <c:forTokens items="www.java.util.package.com" delims="." var="x">
       <c:out value="${x}"/> <br/>
     </c:forTokens>
    
      
      

</body>
</html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>forEach tag</title>
</head>
<body>
    <c:forEach var="counter" begin="1" end="10">
        <c:out value="${counter}"/> <br/>
    </c:forEach>

</body>
</html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
   
    <c:set var="age" value="26"/>
    
    <c:if test="${age<18}">
       <c:out value="You are not eligible for DL"/>
    </c:if>
    
    <c:if test="${age>=18}">
        <c:out value="You are eligible for DL"/>
    </c:if>

</body>
</html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

   <c:set var="abc" value="alpha 1"/>
   <c:out value="${abc}"/>
   
   <c:set var="def" value="alpha 2"/>
   <c:remove var="def"/>
   <c:out value="${def}"/>


</body>
</html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

   <c:set var="abc" value="alpha 1"/>
   <c:out value="${abc}"/>
   
   <c:set var="def" value="alpha 2"/>
   <c:remove var="def"/>
   <c:out value="${def}"/>


</body>
</html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="a" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

    <a:out value="Hello JSTL"/>

</body>
</html>
function longest(s1, s2) {
  const totalString = (s1+s2).split('').sort()
  for (let i=0; i < totalString.length; i++) {
    while(totalString[i] === totalString[i+1]) totalString.splice(i+1, 1)
  }
    return totalString.join('')
}
function countSheeps(arrayOfSheep) {
  let count = 0
  for (const sheep of arrayOfSheep)
    if (sheep === true) {
      count++
    }
  
  return count
}

function countSheeps(arrayOfSheep) {
  return arrayOfSheep.filter(sheep => sheep).length
}

function countSheeps(arrayOfSheep) {
  //return arrayOfSheep.filter(sheep => sheep).length
  return arrayOfSheep.reduce((total, sheep)=>{
    return sheep ? total+=1 : total
  }, 0)
}
CREATE DATABASE EXAMPLE;

USE DATABASE EXAMPLE;

CREATE TABLE orders (
	"id" VARCHAR,
    "first_name" VARCHAR,
    "last_name" VARCHAR,
    "email" VARCHAR,
    "payment_default" BOOLEAN
);

INSERT INTO orders VALUES
('8e6189fa-8caf-4fd2-b648-07570a3e1a82', 'Jon', 'Smith', 'john.smith@example.com', false),
('a1aa064c-6065-43bd-a834-1a212b2dfb60', 'Robert', 'Smith', 'fraudster@example.com', true),
('8568ee21-e745-4db2-8f17-72e77396a591', 'John', 'Smith', 'john@example.com', false),
('b3c5108c-832e-479f-80d9-c2997ec93797', 'J. Marry', 'Doe', 'jane@example.com', false);
String.prototype.toJadenCase = function () { 
  const words = this.split(' ')

  for(let i = 0; i < words.length; i++){
    const wordArr = words[i].split('')
    wordArr[0] = wordArr[0].toUpperCase()
    words[i] = wordArr.join('')
  }
 return words.join(' ')
  
  }
if(not empty(prop("Pages")) and not empty(prop("Date Range")), "Progress: " + format(slice("‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒", 0, floor(20 * prop("Page On") / prop("Pages"))) + "📗" + slice("‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒", 0, 20 - floor(20 * prop("Page On") / prop("Pages"))) + " " + format(floor(100 * prop("Page On") / prop("Pages"))) + "%") + "\nDeadline: " + format(if(dateBetween(start(prop("Date Range")), now(), "days") > 0, "⭕‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒ 0%", if(dateBetween(end(prop("Date Range")), now(), "days") > -1, slice("‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒", 0, floor(20 * dateBetween(now(), start(prop("Date Range")), "days") / dateBetween(end(prop("Date Range")), start(prop("Date Range")), "days"))) + "⭕" + slice("‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒", 0, 20 - floor(20 * dateBetween(now(), start(prop("Date Range")), "days") / dateBetween(end(prop("Date Range")), start(prop("Date Range")), "days"))) + " " + format(floor(100 * dateBetween(now(), start(prop("Date Range")), "days") / dateBetween(end(prop("Date Range")), start(prop("Date Range")), "days"))) + "%", "‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒‒⭕ 100%"))), "")
if(not empty(prop("Due Date")), if(prop("Done"), "✅ Complete", if(formatDate(prop("Due Date"), "L") == formatDate(now(), "L"), "🚧 Due Today", if(prop("Due Date") < now() and prop("Done") == false, "❌ Overdue", "🗓 Due Later"))), "")
#fbuilder, #fbuilder label,
#fbuilder span { color: #00f; }
	
		var cff_metabox_nonce = 'e40c39c074';
		try
		{
			function calculatedFieldsFormReady()
			{
				/* Revisions code */
				$calculatedfieldsfQuery('[name="cff_apply_revision"]').click(
					function(){
						var revision = $calculatedfieldsfQuery('[name="cff_revision_list"]').val();
						if(revision*1)
						{
							result = window.confirm('The action will load the revision selected, the data are not stored will be lose. Do you want continue?');
							if(result)
							{
								$calculatedfieldsfQuery('<form method="post" action="" id="cpformconf" name="cpformconf" class="cff_form_builder"><input type="hidden" name="_cpcff_nonce" value="e55947e105" /><input name="cp_calculatedfieldsf_id" type="hidden" value="9" /><input type="hidden" name="cpcff_revision_to_apply" value="'+esc_attr( revision )+'"></form>').appendTo('body').submit();
							}
						}
					}
				);

				// Form builder code

				var f;
				function run_fbuilder($)
				{
					f = $("#fbuilder").fbuilder();
					window['cff_form'] = f;
					f.fBuild.loadData( "form_structure", "templates" );
				};

				if(!('fbuilder' in $calculatedfieldsfQuery.fn))
				{
					$calculatedfieldsfQuery.getScript(
						location.protocol + '//' + location.host + location.pathname+'?page=cp_calculated_fields_form&cp_cff_resources=admin',
						function(){run_fbuilder(fbuilderjQuery);}
					);
				}
				else
				{
					run_fbuilder($calculatedfieldsfQuery);
				}

				$calculatedfieldsfQuery(".itemForm").click(function() {
				   f.fBuild.addItem($calculatedfieldsfQuery(this).attr("id"));
				})
				.draggable({
					connectToSortable: '#fbuilder #fieldlist',
					delay: 100,
					helper: function() {
						var $ = $calculatedfieldsfQuery,
							e = $(this),
							width = e.outerWidth(),
							text = e.text(),
							type = e.attr('id'),
							el = $('<div class="cff-button-drag '+type+'">');

						return el.html( text ).css( 'width', width ).attr('data-control',type);
					},
					revert: 'invalid',
					cancel: false,
					scroll: false,
					opacity: 1,
					containment: 'document',
					stop: function(){$calculatedfieldsfQuery('.ctrlsColumn .itemForm').removeClass('button-primary');}
				});

				jQuery(".metabox_disabled_section .inside")
				.click( function(){
				  if(confirm("These features aren\'t available in this version. Do you want to open the plugin\'s page to check other versions?"))
					  document.location = 'https://cff.dwbooster.com/';
				})
				.find('*')
				.prop('disabled', true);
			};
		}
		catch( err ){}
		try{$calculatedfieldsfQuery = jQuery.noConflict();} catch ( err ) {}
		if (typeof $calculatedfieldsfQuery == 'undefined')
		{
			 if(window.addEventListener){
				window.addEventListener('load', function(){
					try{$calculatedfieldsfQuery = jQuery.noConflict();} catch ( err ) {return;}
					calculatedFieldsFormReady();
				});
			}else{
				window.attachEvent('onload', function(){
					try{$calculatedfieldsfQuery = jQuery.noConflict();} catch ( err ) {return;}
					calculatedFieldsFormReady();
				});
			}
		}
		else
		{
			$calculatedfieldsfQuery(document).ready( calculatedFieldsFormReady );
		}
	 
	 
#include <stdio.h>

/*Write C code that does the following operation. 
-	Asks and gets the number of WINs (3 points/win), DRAWs (1 points/draw) and LOSSes (0 points/loss) for four football teams. 
-	Records them in a multidimensional array. 
-	Calculates the total scores. 
-	Reports the score table.*/


int main() {
    int score[3][3];
    for(int i=0;i<3;i++)
    {
        printf("enter win draw and loss of team %d: ",i+1);
        scanf("%d %d %d ",&score[i][0],&score[i][1],&score[i][2]);
    }
    printf("team name\t  win\t draw\t loss\t points\n");
    for(int i=0;i<3;i++)
    {
        int points=score[i][0]*3+score[i][1]*1;
        printf("\nteam %d\t\t  %d\t\t  %d\t\t %d\t\t  %d\n",i+1,score[i][0],score[i][1],score[i][2],points);
    }
    
    
    return 0;
}


output:

enter win draw and loss of team 1: 2
1
1
1
enter win draw and loss of team 2: 2
3
1
enter win draw and loss of team 3: 3
3
2
team name	  win	 draw	 loss	 points

team 1		  2		  1		 1		  7

team 2		  1		  2		 3		  5

team 3		  1		  3		 3		  6
star

Wed Mar 01 2023 09:14:22 GMT+0000 (Coordinated Universal Time) https://codeshare.io/RbvqEL

@hasan1d2d #undefined

star

Wed Mar 01 2023 09:00:04 GMT+0000 (Coordinated Universal Time) https://web.csulb.edu/colleges/coe/cecs/dbdesign/dbdesign.php?page

@DELIGHTSOME

star

Wed Mar 01 2023 08:58:39 GMT+0000 (Coordinated Universal Time) https://web.csulb.edu/colleges/coe/cecs/dbdesign/dbdesign.php?page

@DELIGHTSOME

star

Wed Mar 01 2023 08:18:34 GMT+0000 (Coordinated Universal Time) https://web.csulb.edu/colleges/coe/cecs/dbdesign/dbdesign.php?page

@DELIGHTSOME

star

Wed Mar 01 2023 07:59:07 GMT+0000 (Coordinated Universal Time) https://web.csulb.edu/colleges/coe/cecs/dbdesign/dbdesign.php?page

@DELIGHTSOME

star

Wed Mar 01 2023 07:58:59 GMT+0000 (Coordinated Universal Time) https://web.csulb.edu/colleges/coe/cecs/dbdesign/dbdesign.php?page

@DELIGHTSOME

star

Wed Mar 01 2023 07:58:52 GMT+0000 (Coordinated Universal Time) https://web.csulb.edu/colleges/coe/cecs/dbdesign/dbdesign.php?page

@DELIGHTSOME

star

Wed Mar 01 2023 07:58:12 GMT+0000 (Coordinated Universal Time) https://web.csulb.edu/colleges/coe/cecs/dbdesign/dbdesign.php?page

@DELIGHTSOME

star

Wed Mar 01 2023 07:30:23 GMT+0000 (Coordinated Universal Time) https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/Java-print-table-format-printf-chart-console-scanner-println-line

@L0uJ1rky45M #java

star

Wed Mar 01 2023 07:10:18 GMT+0000 (Coordinated Universal Time)

@Jackv

star

Wed Mar 01 2023 04:53:49 GMT+0000 (Coordinated Universal Time)

@Reemhel #javascript

star

Wed Mar 01 2023 04:43:56 GMT+0000 (Coordinated Universal Time)

@Batmansbitch79

star

Wed Mar 01 2023 03:36:06 GMT+0000 (Coordinated Universal Time) https://hackertarget.com/wireshark-tutorial-and-cheat-sheet/

@BigHoss85ca

star

Wed Mar 01 2023 01:52:04 GMT+0000 (Coordinated Universal Time) https://developer.okta.com/blog/2019/03/12/oauth2-spring-security-guide

@namnt

star

Tue Feb 28 2023 23:02:34 GMT+0000 (Coordinated Universal Time)

@markporo #teardown #base #treatment

star

Tue Feb 28 2023 21:31:59 GMT+0000 (Coordinated Universal Time)

@adelphin

star

Tue Feb 28 2023 18:51:46 GMT+0000 (Coordinated Universal Time) https://leetcode.com/problems/minimum-size-subarray-sum/

@Ranjan_kumar #c++

star

Tue Feb 28 2023 18:14:22 GMT+0000 (Coordinated Universal Time) https://askubuntu.com/questions/862254/how-to-move-the-mouse-cursor-between-monitors-with-keys-in-gnome3

@DELIGHTSOME #python

star

Tue Feb 28 2023 17:09:19 GMT+0000 (Coordinated Universal Time) https://www.c-sharpcorner.com/article/send-text-message-to-cell-phones-from-a-C-Sharp-application/

@javicinhio

star

Tue Feb 28 2023 17:07:52 GMT+0000 (Coordinated Universal Time)

@soso

star

Tue Feb 28 2023 16:37:59 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/31246531/can-i-send-sms-messages-from-a-c-sharp-application

@javicinhio

star

Tue Feb 28 2023 15:48:39 GMT+0000 (Coordinated Universal Time)

@Goof3y #c#

star

Tue Feb 28 2023 15:41:48 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/25545649/send-email-with-c-sharp-cpanel-hosting

@javicinhio #cs

star

Tue Feb 28 2023 15:39:23 GMT+0000 (Coordinated Universal Time)

@LocalPsycho

star

Tue Feb 28 2023 13:36:38 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 13:33:58 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 13:33:07 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 13:32:21 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 13:30:25 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 13:29:03 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 13:27:16 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 13:25:59 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 13:20:35 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 12:53:09 GMT+0000 (Coordinated Universal Time)

@Abhishek_Dubey

star

Tue Feb 28 2023 12:52:37 GMT+0000 (Coordinated Universal Time)

@Abhishek_Dubey

star

Tue Feb 28 2023 12:51:55 GMT+0000 (Coordinated Universal Time)

@Abhishek_Dubey

star

Tue Feb 28 2023 12:51:19 GMT+0000 (Coordinated Universal Time)

@Abhishek_Dubey

star

Tue Feb 28 2023 12:50:37 GMT+0000 (Coordinated Universal Time)

@Abhishek_Dubey

star

Tue Feb 28 2023 12:49:19 GMT+0000 (Coordinated Universal Time)

@Abhishek_Dubey

star

Tue Feb 28 2023 12:44:48 GMT+0000 (Coordinated Universal Time)

@Abhishek_Dubey

star

Tue Feb 28 2023 12:42:14 GMT+0000 (Coordinated Universal Time)

@AlanaBF #javascript

star

Tue Feb 28 2023 12:41:41 GMT+0000 (Coordinated Universal Time)

@AlanaBF #javascript

star

Tue Feb 28 2023 12:12:35 GMT+0000 (Coordinated Universal Time)

@Tilores

star

Tue Feb 28 2023 12:11:24 GMT+0000 (Coordinated Universal Time)

@AlanaBF #javascript

star

Tue Feb 28 2023 11:29:42 GMT+0000 (Coordinated Universal Time) https://www.redgregory.com/notion/2021/2/11/notion-formula-double-progress-bar

@YR3

star

Tue Feb 28 2023 11:29:26 GMT+0000 (Coordinated Universal Time) https://www.redgregory.com/notion/2022/11/6/push-overdue-tasks-to-today-in-notion

@YR3

star

Tue Feb 28 2023 11:13:55 GMT+0000 (Coordinated Universal Time) https://cff.dwbooster.com/faq#q82

@markyuri

star

Tue Feb 28 2023 10:49:01 GMT+0000 (Coordinated Universal Time) https://swisssystem.co.il/smartbed/wp-admin/admin.php?page

@markyuri

star

Tue Feb 28 2023 10:24:54 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #c

Save snippets that work with our extensions

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