Snippets Collections
#include <iostream>
using namespace std;

bool allocationIsPossible(int arr[], int n, int m, int mid) {
    int sum = 0;
    int studentCount = 1;
    for (int i = 0; i < n; i++) {
        if (sum + arr[i] <= mid) {
            sum += arr[i];
        } else {
            studentCount++;
            if (studentCount > m || arr[i] > mid) {
                return false;
            }
            sum = arr[i];
        }
    }
    return true;
}

int bookAllocate(int arr[], int n, int m) {
    int start = 0;
    int sum = 0;
    for (int i = 0; i < n; i++) {
        sum += arr[i];
    }
    int end = sum;
    int mid = start + (end - start) / 2;
    int ans = -1;
    while (start <= end) {
        if (allocationIsPossible(arr, n, m, mid)) {
            ans = mid;
            end = mid - 1;
        } else {
            start = mid + 1;
        }
        mid = start + (end - start) / 2;
    }
    return ans;
}

int main() {
    int arr[4] = {10, 20, 30, 40};
    int ans = bookAllocate(arr, 4, 2);
    cout << "Minimum pages: " << ans << endl;
    return 0;
}
  

// output is 60
#include <iostream>
using namespace std;

bool allocationIsPossible(int arr[], int n, int m, int mid) {
    int sum = 0;
    int studentCount = 1;
    for (int i = 0; i < n; i++) {
        if (sum + arr[i] <= mid) {
            sum += arr[i];
        } else {
            studentCount++;
            if (studentCount > m || arr[i] > mid) {
                return false;
            }
            sum = arr[i];
        }
    }
    return true;
}

int bookAllocate(int arr[], int n, int m) {
    int start = 0;
    int sum = 0;
    for (int i = 0; i < n; i++) {
        sum += arr[i];
    }
    int end = sum;
    int mid = start + (end - start) / 2;
    int ans = -1;
    while (start <= end) {
        if (allocationIsPossible(arr, n, m, mid)) {
            ans = mid;
            end = mid - 1;
        } else {
            start = mid + 1;
        }
        mid = start + (end - start) / 2;
    }
    return ans;
}

int main() {
    int arr[4] = {10, 20, 30, 40};
    int ans = bookAllocate(arr, 4, 2);
    cout << "Minimum pages: " << ans << endl;
    return 0;
}
  

// output is 60
/**
 * @snippet       Remove Zoom, Gallery @ Single Product Page
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @testedwith    WooCommerce 5
 * @community     https://businessbloomer.com/club/
 */
  
//add_action( 'wp', 'bbloomer_remove_zoom_lightbox_theme_support', 99 );
  
function bbloomer_remove_zoom_lightbox_theme_support() { 
    //remove_theme_support( 'wc-product-gallery-zoom' );
    //remove_theme_support( 'wc-product-gallery-lightbox' );
    remove_theme_support( 'wc-product-gallery-slider' );
}

////Remove actions for single product
remove_action('woocommerce_before_main_content','woocommerce_breadcrumb',20);
remove_action('woocommerce_single_product_summary','woocommerce_template_single_meta',40);
remove_action('woocommerce_single_product_summary','woocommerce_template_single_excerpt',20);
remove_action('woocommerce_after_single_product_summary','woocommerce_output_product_data_tabs',10);
remove_action('woocommerce_after_single_product_summary','woocommerce_upsell_display',15);
remove_action('woocommerce_after_single_product_summary','woocommerce_output_related_products',20);
//Add actions for single product
add_action('woocommerce_single_product_summary','woocommerce_template_single_excerpt',35);

function addTHCForSingleProduct(){
	$thc = get_field('thc');
	if(!empty($thc)) echo '<h4 class="single-product-thc">'.$thc.'</h4>';
}
add_action('woocommerce_single_product_summary','addTHCForSingleProduct',6);
function customTabForSingleProduct(){
?>
<div class="rst-accordion-description">
	<?php if($ingredient = get_field('ingredient_field_name')):?>
	<div class="rst-item-accordion-description">
		<h3 class="rst-heading-item-accordion-description rst-heading-item-toggle">
			Ingredients
			<span>
				<img src="https://sweedies.co/wp-content/uploads/2024/05/arrows-down.png" />
			</span>
		</h3>
		<div class="rst-content-item-accordion-description">
			<?php echo $ingredient; ?>
		</div>
	</div>
	<?php endif;?>
	<?php  $lab_test_report = get_field('lab_test_report');if(!empty($lab_test_report)):?>
	<div class="rst-item-accordion-description">
		<a class="rst-heading-item-accordion-description" href="<?php echo $lab_test_report['url']; ?>" download>
			Lab test report
			<span>
				<img src="https://sweedies.co/wp-content/uploads/2024/05/PDF-Print-Icon.png" />
			</span>
		</a>
	</div>
	<?php endif;?>
</div>
<script>
	(function($){
		$('.rst-heading-item-toggle').click(function(){
			if($(this).hasClass('active')){
				$(this).parent().find('.rst-content-item-accordion-description').slideUp();
				$(this).removeClass('active');
			}else{
				$('.rst-content-item-accordion-description').slideUp();
				$(this).parent().find('.rst-content-item-accordion-description').slideDown();
				$('.rst-heading-item-toggle').removeClass('active');
				$(this).addClass('active');
			}
			return false;
		});
	})(jQuery)
</script>
<?php
}
add_action('woocommerce_single_product_summary','customTabForSingleProduct',45);

function customBestSellerForShop(){
?>
<?php 
	$args = [
		'post_type' => 'product',
		'posts_per_page' => 15,
		'meta_key' => 'total_sales',
		'orderby' => 'meta_value_num',
		'order' => 'DESC',
	];
	$the_query = new WP_Query($args);
	if($the_query->have_posts()):
?>
<div class="customBestSellerForSingleProduct" style="clear: both;">
	<div class="customBestSellerForSingleProduct-head">
		<h2 class="nt-heading">
			Best Sellers
		</h2>
	</div>
	<div class="customBestSellerForSingleProduct-list">
		<div class="slider-product custom-slider-product-bestSellers">
			<div class="swiper-wrapper">
				<?php
                while ($the_query->have_posts()):
                    $the_query->the_post();
                    $product = wc_get_product(get_the_ID());
                    $categories = wp_get_post_terms(get_the_ID(), 'product_cat');
                    $category_name = !empty($categories) ? $categories[0]->name : '';
                    $rating_count = $product->get_rating_count();
                    $average = $product->get_average_rating();
                    $regular_price = $product->get_regular_price();
                    $sale_price = $product->get_sale_price();
                    ?>

                    <div class="swiper-slide">
                        <div class="slider-product-item">
                            <a class="product-link" href="<?php the_permalink(); ?>">
                                <div class="slider-product-image">
                                    <?php echo woocommerce_get_product_thumbnail('shop_catalog'); ?>

                                    <div class="add-to-cart-btn">
                                        <?php //echo $this->get_add_to_cart_button(get_the_ID()); ?>
                                    </div>
                                </div>
                            </a>
                            <div class="slider-product-details">
                                <div class="product-category"><?php echo esc_html($category_name); ?></div>
								<a href="<?php the_permalink(); ?>">
									<h2 class="slider-product-title">
										<?php the_title(); ?>
									</h2>
								</a>
                                <div class="slider-product-description"><?php echo wp_trim_words(get_the_excerpt(), 15); ?></div>
								<div class="product-rating">
									<?php
									$rating = $average; 
									$full_stars = floor($rating);
									$half_star = ($rating - $full_stars >= 0.5) ? 1 : 0;
									$empty_stars = 5 - $full_stars - $half_star;

									
									for ($i = 0; $i < $full_stars; $i++) {
										echo '<i class="fa-solid fa-star"></i>';
									}

									
									if ($half_star) {
										echo '<i class="fa-solid fa-star-half-alt"></i>';
									}

									
									for ($i = 0; $i < $empty_stars; $i++) {
										echo '<i class="fa-regular fa-star"></i>';
									}
									?>
									<span class="rating-count">(<?php echo $rating_count; ?>)</span>
								</div>
								<div class="slider-product-prices">
                                    <?php if ($sale_price): ?>
                                        <span class="slider-product-new-price"><?php echo wc_price($sale_price); ?></span>
                                        <span class="slider-product-old-price"><?php echo wc_price($regular_price); ?></span>
                                    <?php else: ?>
                                        <span class="slider-product-new-price"><?php echo wc_price($regular_price); ?></span>
                                    <?php endif; ?>
                                </div>
                                
                            </div>
                        </div>
                    </div>

                <?php endwhile; ?>
			</div>
			<div class="swiper-pagination"></div>
		</div>
		<div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>
	</div>
</div>
<script>
	jQuery(document).ready(function ($) {

		var swiper_bestSellers = new Swiper(".custom-slider-product-bestSellers", {
			slidesPerView: 3,
			slidesPerGroup: 1,
			centeredSlides: true,
			loop: true,
			autoplay: {
				delay: 5000,
			},
			spaceBetween: 24,
// 			pagination: {
// 				el: ".swiper-pagination",
// 				clickable: true,
// 			},
			navigation: {
				nextEl: '.swiper-button-next',
				prevEl: '.swiper-button-prev',
			},
			breakpoints: {
				1025: {
					slidesPerView: 3,
					centeredSlides: true,
				},
				768: {
					slidesPerView: 2,
					centeredSlides: true,
				},
				320: {
					slidesPerView: 1.5,
					centeredSlides: true,
				},
			}
		});


	});

	jQuery(document).ready(function($) {
		$('.slider-product .slider-product-item ').matchHeight();
	});


</script>
<?php
	endif; wp_reset_postdata();
}
add_action('woocommerce_after_single_product','customBestSellerForSingleProduct',25);

function customReviewForSingleProduct(){
?>
<div class="customReviewForSingleProduct">
	<div class="customReviewForSingleProduct-head">
		<h2 class="nt-heading">
			Customer reviews
		</h2>
	</div>
	<div class="customReviewForSingleProduct-content">
		<?php echo do_shortcode('[Woo_stamped_io type="widget"]');?>
	</div>
</div>
<?php	
}
add_action('woocommerce_after_single_product','customBestSellerForShop',30);
<div class="content">
  <h3>Classes</h3>
  <div class="toolbar">
    <div id="search-wrapper">
      <i class="search-icon fas fa-search"></i>
      <input
        type="text"
        id="search"
        placeholder="Search..."
        [(ngModel)]="searchTerm"
      />
    </div>
    <div class="content-container">
      <div class="button-container">
        <button class="addBtn" (click)="openModal()">Create Class</button>
      </div>
    </div>
  </div>

  <div class="table-responsive">
    <table class="styled-table">
      <thead>
        <tr>
          <th>Class Name</th>
          <th>Class Description</th>
          <th>Assign Teacher</th>
          <th>Action Controls</th>
        </tr>
      </thead>
      <tbody>
        <tr *ngFor="let class of filteredClasses">
          <td>{{ class.className }}</td>
          <td>{{ class.classDescription }}</td>
          <td>{{ getEmployeeName(class.employeeId) }}</td>
          <td>
            <button class="edit-btn" (click)="openEditModal(class)">
              Edit
            </button>
            <button class="delete-btn" (click)="openDeleteModal(class.classId)">
              Delete
            </button>
          </td>
        </tr>
      </tbody>
    </table>
  </div>

  <div
    id="myModal"
    class="modal"
    [style.display]="showModal ? 'block' : 'none'"
  >
    <div class="modal-content">
      <span class="close" (click)="closeModal()">&times;</span>
      <div class="modal-body">
        <h3>Add Class</h3>
        <form (submit)="addClass()">
          <div class="form-group">
            <label for="className">Class Name:</label>
            <input
              type="text"
              id="className"
              name="className"
              [(ngModel)]="model.className"
              placeholder="Enter class name"
              required
            />
            <br />
            <small class="hint" style="color: red"
              >*Please enter the name of the class.</small
            >
          </div>
          <br />
          <div class="form-group">
            <label for="classDescription">Class Description:</label>
            <input
              type="text"
              id="classDescription"
              name="classDescription"
              [(ngModel)]="model.classDescription"
              placeholder="Enter merit description"
              required
            />
            <br />
            <small class="hint" style="color: red"
              >*Please enter the name of the class.</small
            >
            <br />
          </div>
          <div class="form-group">
            <label for="assignTeacherToClass">Assign Teacher to Class:</label>
            <select
              id="assignTeacherToClass"
              [(ngModel)]="model.employeeId"
              name="assignTeacherToClass"
              required>
              <option
                *ngFor="let employee of employees"
                [value]="employee.employeeId">
                {{ employee.firstName }} {{ employee.lastName }}
              </option>
            </select>
          </div>
          <div class="form-buttons">
            <button type="submit" class="btn add-btn">Add</button>
            <button type="button" class="btn cancel-btn" (click)="closeModal()">
              Cancel
            </button>
          </div>
        </form>
      </div>
    </div>
  </div>

  <!-- Edit Modal -->
  <div
    id="classModal"
    class="modal"
    [style.display]="showEditModal ? 'block' : 'none'"
  >
    <div class="modal-content">
      <span class="close" (click)="closeEditModal()">&times;</span>
      <div class="modal-body">
        <h3>Edit Class</h3>
        <form (submit)="updateClass()">
          <div class="form-group">
            <label for="editClassName">Class Name:</label>
            <input
              type="text"
              id="editClassName"
              name="className"
              [(ngModel)]="model.className"
              placeholder="Enter class name"
              required
            />
            <br />
            <small class="hint" style="color: red"
              >*Please enter updated name of the class.</small
            >
          </div>
          <div class="form-group">
            <label for="editClassDescription">Class Description:</label>
            <input
              type="text"
              id="editClassDescription"
              name="classDescription"
              [(ngModel)]="model.classDescription"
              placeholder="Enter class description"
              required
            />
            <br />
            <small class="hint" style="color: red"
              >*Please enter updated description of the class.</small
            >
          </div>
          <div class="form-group">
            <label for="assignTeacherToClass">Assign Teacher to Class:</label>
            <select
              id="assignTeacherToClass"
              [(ngModel)]="model.employeeId"
              name="assignTeacherToClass"
              required
            >
              <option
                *ngFor="let employee of employees"
                [value]="employee.employeeId"
              >
                {{ employee.firstName }} {{ employee.lastName }}
              </option>
            </select>
          </div>
          <div class="form-buttons">
            <button type="submit" class="btn add-btn">Update</button>
            <button
              type="button"
              class="btn cancel-btn"
              (click)="closeEditModal()"
            >
              Cancel
            </button>
          </div>
        </form>
      </div>
    </div>
  </div>

  <!-- delete Modal -->
  <div
    id="deleteModal"
    class="modal"
    [style.display]="showDeleteModal ? 'block' : 'none'"
  >
    <div class="modal-content">
      <span class="close" (click)="closeDeleteModal()">&times;</span>
      <h3>Delete Class</h3>
      <p>Are you sure you want to delete this class.</p>
      <div class="form-buttons">
        <button class="btn add-btn" (click)="DeleteClass(currentClassId)">
          OK
        </button>
        <button
          type="button"
          class="btn cancel-btn"
          (click)="closeDeleteModal()"
        >
          Cancel
        </button>
      </div>
    </div>
  </div>

  <!-- Success Modal -->
  <div
    id="successModal"
    class="modal"
    [style.display]="showSuccessModal ? 'block' : 'none'"
  >
    <div class="modal-content">
      <span class="close" (click)="closeSuccessModal()">&times;</span>
      <h3>Success!</h3>
      <p>Your class has been successfully created.</p>
      <div class="form-buttons">
        <button class="btn add-btn" (click)="closeSuccessModal()">OK</button>
      </div>
    </div>
  </div>

  <!-- Error Modal -->
  <div
    id="errorModal"
    class="modal"
    [style.display]="showErrorModal ? 'block' : 'none'"
  >
    <div class="modal-content">
      <span class="close" (click)="closeErrorModal()">&times;</span>
      <h3>Error!</h3>
      <p>There was a problem creating your class. Please try again.</p>
      <button class="ok-btn" (click)="closeErrorModal()">OK</button>
    </div>
  </div>
</div>
The loading attribute on an img element can be set to lazy to tell the browser not to fetch the image resource until it is needed (as in, when the user scrolls the image into view). As an additional benefit, lazy loaded elements will not load until the non-lazy elements are loaded - this means users with slow internet connections can view the content of your page without having to wait for the images to load.

The Referer HTTP header contains information about the address or URL of a page that a user might be visiting from. This information can be used in analytics to track how many users from your page visit freecodecamp.org, for example. Setting the rel attribute to noreferrer omits this information from the HTTP request.

CSS Grid offers a two-dimensional grid-based layout, allowing you to center items horizontally and vertically while still retaining control to do things like overlap elements.

CSS Grid is similar to Flexbox in that it has a special property for both the parent and child elements.

Use the minmax function to make your columns responsive on any device. The minmax function takes two arguments, the first being the minimum value and the second being the maximum. These values could be a length, percentage, fr, or even a keyword like max-content.

To add space between rows in the grid layout, you can use the row-gap property.

grid-template-columns sets the overall layout in the main rule, but you can adjust the placement in the child rules.

One option is the grid-column property, which is shorthand for grid-column-start and grid-column-end. The grid-column property tells the grid item which grid line to start and end at.

The CSS repeat() function is used to repeat a value, rather than writing it out manually, and is helpful for grid layouts. For example, setting the grid-template-columns property to repeat(20, 200px) would create 20 columns each 200px wide.

Remember that the grid-column property determines which columns an element starts and ends at. There may be times where you are unsure of how many columns your grid will have, but you want an element to stop at the last column. To do this, you can use -1 for the end column.

The object-fit property tells the browser how to position the element within its container. In this case, cover will set the image to fill the container, cropping as needed to avoid changing the aspect ratio.

The default settings for CSS Grid will create additional rows as needed, unlike Flexbox.

As an alternative, you can use the grid-auto-flow property.

This property takes either row or column as the first value, with an optional second value of dense. grid-auto-flow uses an auto-placement algorithm to adjust the grid layout. Setting it to column will tell the algorithm to create new columns for content as needed. The dense value allows the algorithm to backtrack and fill holes in the grid with smaller items, which can result in items appearing out of order.

The algorithm defaults the new column width to be auto, which may not match your current columns.

You can override this with the grid-auto-columns property.

Much like Flexbox, with CSS Grid you can align the content of grid items with align-items and justify-items. align-items will align child elements along the column axis, and justify-items will align child elements along the row axis.

You can create columns within an element without using Grid by using the column-width property.

The ::first-letter pseudo-selector allows you to target the first letter in the text content of an element.

The gap property is a shorthand way to set the value of column-gap and row-gap at the same time. If given one value, it sets the column-gap and row-gap both to that value. If given two values, it sets the row-gap to the first value and the column-gap to the second.

The place-items property can be used to set the align-items and justify-items values at the same time. The place-items property takes one or two values. If one value is provided, it is used for both the align-items and justify-items properties. If two values are provided, the first value is used for the align-items property and the second value is used for the justify-items property.
Container(
  height: 20,
  width: 100,
  child: TextFormField(
    maxLines: 1,
    decoration: InputDecoration(
      isDense: true,
      contentPadding: EdgeInsets.fromLTRB(5.0, 1.0, 5.0, 1.0),
    ),
    onChanged: (value) {
      print(value);
    },
  ),
);
global proc helloRandom2()
{
	string $nameList[] = {"Kelly","Sam","Chiharu","Liam","May","Jeremy"};
	int $namePicker = rand(5.99999);
	int $num = rand(10,60);
	string $itemList[] = {"cats","dogs","fish","guinea pigs","frogs","donkeys","bottles of lotion","sheep","snakes","jar of pickles"};
	int $itemPicker = rand(9.999999);

	print ("Hello "+$nameList[$namePicker]+"!\n");
	print ("You have "+$num+" "+$itemList[$itemPicker]+".\n");
	print ("That's too many "+$itemList[$itemPicker]+".");
}
global proc helloRandom()
{
	string $nameList[] = {"Kelly","Sam","Chiharu","Liam","May","Jeremy"};
	int $num = rand(10,60);
	int $namePicker = rand(5.99999);

	print ("Hello "+$nameList[$namePicker]+"!\n");
	print ("You have "+$num+" cats.\n");
	print "That's too many cats.";
}
global proc helloInput(string $name,int $num)
{
	print ("Hello "+$name+"!\n");
	print ("You have "+$num+" cats.\n");
}
from functools import lru_cache, partial
import timeit

@lru_cache(maxsize = 128)
def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)

#the first time
execution_time = timeit.Timer(partial(fibonacci, 50)).timeit(1)
print(execution_time)

#the second time
execution_time = timeit.Timer(partial(fibonacci, 50 )).timeit(1)
print(execution_time)
#include <iostream>
#include <vector>
#include <algorithm>

class DisjointSet {
public:
    DisjointSet(int n) {
        rank.resize(n + 1, 0);
        parent.resize(n + 1);
        size.resize(n + 1, 1);
        for (int i = 0; i <= n; ++i) {
            parent[i] = i;
        }
    }

    int find_upar(int node) {
        if (node == parent[node]) {
            return node;
        }
        return parent[node] = find_upar(parent[node]);
    }

    void union_by_rank(int u, int v) {
        int ulp_u = find_upar(u);
        int ulp_v = find_upar(v);
        if (ulp_u == ulp_v) {
            return;
        }
        if (rank[ulp_u] < rank[ulp_v]) {
            parent[ulp_u] = ulp_v;
        } else if (rank[ulp_v] < rank[ulp_u]) {
            parent[ulp_v] = ulp_u;
        } else {
            parent[ulp_v] = ulp_u;
            rank[ulp_u]++;
        }
    }

    void union_by_size(int u, int v) {
        int ulp_u = find_upar(u);
        int ulp_v = find_upar(v);
        if (ulp_u == ulp_v) {
            return;
        }
        if (size[ulp_u] < size[ulp_v]) {
            parent[ulp_u] = ulp_v;
            size[ulp_v] += size[ulp_u];
        } else {
            parent[ulp_v] = ulp_u;
            size[ulp_u] += size[ulp_v];
        }
    }

private:
    std::vector<int> rank;
    std::vector<int> parent;
    std::vector<int> size;
};

class Solution {
public:
    int spanningTree(int V, std::vector<std::vector<std::pair<int, int>>>& adj) {
        std::vector<std::tuple<int, int, int>> edges;
        for (int i = 0; i < V; ++i) {
            for (auto& it : adj[i]) {
                int adjNode = it.first;
                int wt = it.second;
                int node = i;
                edges.push_back(std::make_tuple(wt, node, adjNode));
            }
        }

        DisjointSet ds(V);
        std::sort(edges.begin(), edges.end());

        int mstWt = 0;
        for (auto& edge : edges) {
            int wt = std::get<0>(edge);
            int u = std::get<1>(edge);
            int v = std::get<2>(edge);
            if (ds.find_upar(u) != ds.find_upar(v)) {
                mstWt += wt;
                ds.union_by_size(u, v);
            }
        }

        return mstWt;
    }
};

int main() {
    int V = 5;
    std::vector<std::vector<std::pair<int, int>>> adj(V);

    std::vector<std::vector<int>> edges = {
        {0, 1, 2}, {0, 2, 1}, {1, 2, 1}, {2, 3, 2}, {3, 4, 1}, {4, 2, 2}
    };

    for (auto& it : edges) {
        int u = it[0], v = it[1], wt = it[2];
        adj[u].emplace_back(v, wt);
        adj[v].emplace_back(u, wt);
    }

    Solution obj;
    int mstWt = obj.spanningTree(V, adj);
    std::cout << "The sum of all the edge weights: " << mstWt << std::endl;

    return 0;
}
myData = [
    {'a': 1},
    {'a': 1},
    {'b': 1},
    {'b': 1},
    {'c': 1},
    {'c': 1},
]

# Use a set to track seen tuples of items (key-value pairs as tuples)
seen = set()
unique_data = []

for d in myData:
    # Convert each dictionary to a tuple of its items, then convert to frozenset
    # to make it hashable and suitable for use in a set
    dict_items = frozenset(d.items())
    
    # Check if the frozenset of items is already in the set
    if dict_items not in seen:
        # If not seen, add to both set and result list
        seen.add(dict_items)
        unique_data.append(d)

print(unique_data)
#include <iostream>
#include <vector>

class DisjointSet {
public:
    DisjointSet(int n) {
        rank.resize(n + 1, 0);
        parent.resize(n + 1);
        size.resize(n + 1, 1);
        for (int i = 0; i <= n; ++i) {
            parent[i] = i;
        }
    }

    int find_upar(int node) {
        if (node == parent[node]) {
            return node;
        }
        return parent[node] = find_upar(parent[node]);
    }

    void union_by_rank(int u, int v) {
        int ulp_u = find_upar(u);
        int ulp_v = find_upar(v);
        if (ulp_u == ulp_v) {
            return;
        }
        if (rank[ulp_u] < rank[ulp_v]) {
            parent[ulp_u] = ulp_v;
        } else if (rank[ulp_v] < rank[ulp_u]) {
            parent[ulp_v] = ulp_u;
        } else {
            parent[ulp_v] = ulp_u;
            rank[ulp_u]++;
        }
    }

    void union_by_size(int u, int v) {
        int ulp_u = find_upar(u);
        int ulp_v = find_upar(v);
        if (ulp_u == ulp_v) {
            return;
        }
        if (size[ulp_u] < size[ulp_v]) {
            parent[ulp_u] = ulp_v;
            size[ulp_v] += size[ulp_u];
        } else {
            parent[ulp_v] = ulp_u;
            size[ulp_u] += size[ulp_v];
        }
    }

private:
    std::vector<int> rank;
    std::vector<int> parent;
    std::vector<int> size;
};

class Solution {
public:
    int Solve(int n, std::vector<std::vector<int>>& edge) {
        DisjointSet ds(n);
        int cnt_extras = 0;
        for (auto& e : edge) {
            int u = e[0];
            int v = e[1];
            if (ds.find_upar(u) == ds.find_upar(v)) {
                cnt_extras++;
            } else {
                ds.union_by_size(u, v);
            }
        }
        int cnt_c = 0;
        for (int i = 0; i < n; ++i) {
            if (ds.find_upar(i) == i) {
                cnt_c++;
            }
        }
        int ans = cnt_c - 1;
        if (cnt_extras >= ans) {
            return ans;
        }
        return -1;
    }
};

int main() {
    int V = 9;
    std::vector<std::vector<int>> edge = { {0, 1}, {0, 2}, {0, 3}, {1, 2}, {2, 3}, {4, 5}, {5, 6}, {7, 8} };

    Solution obj;
    int ans = obj.Solve(V, edge);
    std::cout << "The number of operations needed: " << ans << std::endl;

    return 0;
}
class Solution
{
	public:
	//Function to find sum of weights of edges of the Minimum Spanning Tree.
    int spanningTree(int V, vector<vector<int>> adj[])
    {
        // code here
        vector<int> vis(V,0);
        vector<tuple<int,int,int>> mst;
        //wt,node,parent
        priority_queue<vector<int>,vector<vector<int>>, greater<vector<int>>> pq;
        
        pq.push({0,0,-1});
        int sum =0;
        
        while(!pq.empty()){
            auto it = pq.top();
            pq.pop();
            int node = it[1];
            int wt = it[0];
            int par = it[2];
            
            if(vis[node]==1) continue;
            vis[node]=1;
            sum+=wt;
            if(par!=-1){
                mst.push_back(make_tuple(wt,par,node));
            }
            for(auto it: adj[node]){
                int ch = it[0];
                int ch_w = it[1];
                if(!vis[ch]){
                    pq.push({ch_w, ch,node});
                }
            }
        }
        for(auto it: mst){
            int weight, u, v;
            tie(weight, u, v) = it;
            cout<<weight<<":"<<u<<"->"<<v<<endl;
        }
        return sum;
    }
};
class Solution {
  public:
    /*  Function to implement Bellman Ford
    *   edges: vector of vectors which represents the graph
    *   S: source vertex to start traversing graph with
    *   V: number of vertices
    */
    vector<int> bellman_ford(int V, vector<vector<int>>& edges, int S) {
        // Code here
        //iterate through edges ond keep on updating the distance array. Iterate through all the edges for 
        //V-1 times
        vector<int> dis(V,1e8);
        dis[S]=0;
        for(int i=0;i<V-1;i++){
            
            for(int j =0;j<edges.size();j++){
                int u = edges[j][0];
                int v = edges[j][1];
                int w = edges[j][2];
                if(dis[u] != 1e8 && dis[u]+w<dis[v]){
                    dis[v]=dis[u]+w;
                }
            }
        }
        for(int i=0;i<1;i++){
            
            for(int j =0;j<edges.size();j++){
                int u = edges[j][0];
                int v = edges[j][1];
                int w = edges[j][2];
                if(dis[u] != 1e8 && dis[u]+w<dis[v]){
                    return {-1};
                }
            }
        }
        
        return dis;
    }
};
# Two Years Ago
![[<% moment(tp.date.now("YYYY-MM-DD")).subtract(2, 'years').format("YYYY-MM-DD") %> ]]

# One Year Ago
![[<% moment(tp.date.now("YYYY-MM-DD")).subtract(1, 'years').format("YYYY-MM-DD") %>]]
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:first/Login/login2.dart';
import 'package:first/Login/component/api_service.dart';

String SendPhone = "";
String OTP1 = "";
String userStatus2 = "";

class Login extends StatefulWidget {
  const Login({Key? key}) : super(key: key);

  @override
  State<Login> createState() => _LoginState();
}

class _LoginState extends State<Login> {
  final TextInputFormatter phoneNumberFormatter =
      FilteringTextInputFormatter.allow(
    RegExp(r'^\d{0,11}'),
  );

  final _formKey = GlobalKey<FormState>();
  final TextEditingController _nameController = TextEditingController();
  final TextEditingController _phoneController = TextEditingController();

  void _submitForm() async {
    if (_formKey.currentState!.validate()) {
      var name = _nameController.text;
      var phone = _phoneController.text;

      var jsonResponse = await ApiService.login(name, phone);
      if (jsonResponse != null) {
        var userStatus = jsonResponse['USER STATUS'];
        var otp = jsonResponse['otp'];
        OTP1 = otp;
        userStatus2 = userStatus;
        SendPhone = phone;
        print("otp");
        print(otp);
        if (userStatus == '0' || userStatus == '1') {
          Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => Login2()),
          );
        } else {
          print('Unknown user status: $userStatus');
        }
      }
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: SingleChildScrollView(
          padding: const EdgeInsets.all(35.0),
          child: Form(
            key: _formKey,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: <Widget>[
                const Text(
                  'لطفا جهت ورود به برنامه، شماره تلفن خود را وارد نمایید',
                  textAlign: TextAlign.right,
                  style: TextStyle(
                    fontSize: 16,
                    fontWeight: FontWeight.bold,
                    color: Colors.black87,
                  ),
                ),
                const SizedBox(height: 20),
                const SizedBox(height: 20),
                Directionality(
                  textDirection: TextDirection.rtl,
                  child: TextFormField(
                    controller: _phoneController,
                    textAlign: TextAlign.end,
                    decoration: const InputDecoration(
                      labelText: 'شماره تلفن',
                      border: OutlineInputBorder(),
                      focusedBorder: OutlineInputBorder(
                        borderSide: BorderSide(color: Colors.blue, width: 2.0),
                      ),
                    ),
                    keyboardType: TextInputType.number,
                    inputFormatters: <TextInputFormatter>[
                      FilteringTextInputFormatter.digitsOnly,
                      phoneNumberFormatter,
                    ],
                    validator: (value) {
                      if (value == null || value.isEmpty) {
                        return 'لطفا شماره تلفن خود را وارد کنید';
                      } else if (!RegExp(r'^09\d{9}$').hasMatch(value)) {
                        return 'شماره تلفن باید با 09 شروع شود و 11 رقم باشد';
                      }
                      return null;
                    },
                  ),
                ),
                const SizedBox(height: 20),
                ElevatedButton(
                  onPressed: _submitForm,
                  style: ElevatedButton.styleFrom(
                    backgroundColor: Colors.blue,
                    padding: const EdgeInsets.symmetric(vertical: 16.0),
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(8.0),
                    ),
                    textStyle: const TextStyle(
                      fontSize: 18,
                      color: Colors.white,
                    ),
                  ),
                  child: const Text('ادامه'),
                ),
                const SizedBox(height: 20),
                const Text(
                  'با ورود و استفاده از برنامه، شما با شرایط و قوانین موافقت می‌نمایید.',
                  textAlign: TextAlign.end,
                  style: TextStyle(fontSize: 12, color: Colors.grey),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

class MainPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Main Page'),
      ),
      body: const Center(
        child: Text('Welcome to Main Page'),
      ),
    );
  }
}
int f(int ind,int buy, vector<int>& nums ,vector<vector<int>>& dp )
{
    if(ind==(nums.size()))
    return 0;
    if(dp[ind][buy]!=-1)
    return dp[ind][buy];
    int profit;
    if(buy)
    profit = max((-nums[ind]+f(ind+1,0,nums,dp)),(f(ind+1,1,nums,dp)));
    else
    profit = max((nums[ind]+f(ind+2,1,nums,dp)),(f(ind+1,0,nums,dp)));
    return dp[ind][buy]=profit;
}
    int maxProfit(vector<int>& prices) {
        int n = prices.size();
         vector<vector<int>> dp(n,vector<int>(2,-1));
         return f(0,1,prices,dp);
        
    }
import { CommonModule } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import { FlexLayoutModule } from '@angular/flex-layout';
import {jwtDecode} from 'jwt-decode';
 
@Component({
  selector: 'app-login',
  standalone: true,
  imports: [
    MaterialModule,
    ReactiveFormsModule,
    RouterLink,
    CommonModule,
    HttpClientModule,
    FlexLayoutModule   
  ],
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent {
 
  loginFormGroup: FormGroup;
  isLoading: boolean = false;
 
  constructor(
    private router: Router,
    private userService: UserService,
    private fb: FormBuilder,
    private snackBar: MatSnackBar
  ) { 
    this.loginFormGroup = this.fb.group({
      email: ['', [Validators.required, Validators.email]],
      password: ['', Validators.required],
    });
  }
 
  ngOnInit() {}
 
  async LoginUser() {
    if (this.loginFormGroup.valid) {
      this.isLoading = true;
  
      this.userService.LoginUser(this.loginFormGroup.value).subscribe({
        next: (result: any) => {
          if (result && result.token) {
            localStorage.setItem('User', JSON.stringify(result));
  
            // Decode the JWT token to extract user information
            const decodedToken: any = jwtDecode(result.token);
            console.log('Decoded Token:', decodedToken);
 
            const userId = decodedToken.userId;
            const userTypeID = decodedToken.User_Type_ID;
            console.log('User Type ID:', userTypeID);
            console.log('User Type ID:', userTypeID);
            
            
            this.loginFormGroup.reset();
            
            // Navigate based on user type
            if (userTypeID === "1") {  // Ensure userTypeID is compared as string
              this.router.navigateByUrl(`/OwnerHome/${userId}`);
            } else if (userTypeID === "2") {
              this.router.navigateByUrl(`/EmployeeHome/${userId}`);
            } else if (userTypeID === "3") {
              this.router.navigateByUrl(`/Home/${userId}`);
            } else {
              this.snackBar.open('Error: Invalid user type: Please register as an authorized user', 'Close', { duration: 5000 });
            }
          } else {
            this.snackBar.open('Login failed', 'Close', { duration: 5000 });
          }
        },
        error: () => {
          this.isLoading = false;
          this.snackBar.open('Login failed', 'Close', { duration: 5000 });
        },
        complete: () => {
          this.isLoading = false;
        }
      });
    }
  }
}
// Latest working register
[HttpPost]
[DisableRequestSizeLimit]
[Route("Register")]
public async Task<IActionResult> Register([FromForm] UserViewModel uvm)
{
    try
    {
        var formCollection = await Request.ReadFormAsync();
        var photo = formCollection.Files.FirstOrDefault();
 
        var user = await _userManager.FindByEmailAsync(uvm.Email);
        int lastUserID = _appDbContext.Users
                         .OrderByDescending(u => u.User_ID)
                         .Select(u => u.User_ID)
                         .FirstOrDefault();
 
        // Validate Phone Number Pattern
        var phoneNumberPattern = @"^\d{10}$";
 
        bool isValidPhoneNumber = Regex.IsMatch(uvm.PhoneNumber, phoneNumberPattern);
 
        if (!isValidPhoneNumber) return BadRequest("Enter valid 10-digit phone number.");
 
        // Validate South African ID number
        if (!IsValidSouthAfricanIDNumber(uvm.Id_Number, uvm.Date_of_Birth))
        {
            return BadRequest("Enter a valid South African ID number.");
        }
 
        if (user == null)
        {
            if (photo != null && photo.Length > 0)
            {
                using (var memoryStream = new MemoryStream())
                {
                    await photo.CopyToAsync(memoryStream);
                    var fileBytes = memoryStream.ToArray();
                    string base64Image = Convert.ToBase64String(fileBytes);
 
                    user = new User
                    {
                        User_ID = lastUserID + 1,
                        Name = uvm.Name,
                        Surname = uvm.Surname,
                        UserName = uvm.Email,
                        Email = uvm.Email,
                        PasswordHash = _userManager.PasswordHasher.HashPassword(null, uvm.Password),
                        User_Status_ID = uvm.User_Status_ID,
                        User_Type_ID = uvm.User_Type_ID,
                        PhoneNumber = uvm.PhoneNumber,
                        Date_of_Birth = uvm.Date_of_Birth,
                        ID_Number = uvm.Id_Number,
                        Physical_Address = uvm.Physical_Address,
                        Photo = base64Image // Store the base64 string of the photo
                    };
 
                    IdentityResult result = await _userManager.CreateAsync(user);
 
                    if (result.Succeeded)
                    {
                        // Assign role based on User_Type_ID
                        string roleName = GetRoleNameByUserType(uvm.User_Type_ID);
                        if (!string.IsNullOrEmpty(roleName))
                        {
                            var roleResult = await _userManager.AddToRoleAsync(user, roleName);
                            if (!roleResult.Succeeded)
                            {
                                return BadRequest(new { Status = "Error", Errors = roleResult.Errors });
                            }
                        }
 
 
                        return Ok(new { Status = "Success", Message = "User created successfully!" });
                    }
                    else
                    {
                        return StatusCode(StatusCodes.Status500InternalServerError, result.Errors.FirstOrDefault()?.Description);
                    }
                }
            }
            else
            {
                return BadRequest("Photo is required.");
            }
        }
        else
        {
            return Forbid("Account already exists.");
        }
    }
    catch (DbUpdateException dbEx)
    {
        return StatusCode(StatusCodes.Status500InternalServerError, dbEx.InnerException?.Message ?? "An error occurred while processing your request.");
    }
    catch (Exception ex)
    {
        return StatusCode(StatusCodes.Status500InternalServerError, "An error occurred while processing your request.");
    }
}
 
// Method to validate South African ID number
private bool IsValidSouthAfricanIDNumber(string idNumber, DateTime dateOfBirth)
{
    // Check if the ID number is exactly 13 digits long
    if (idNumber.Length != 13 || !long.TryParse(idNumber, out _))
    {
        return false;
    }
 
    // Validate date of birth (first six digits)
    string dateOfBirthPart = idNumber.Substring(0, 6);
    if (!DateTime.TryParseExact(dateOfBirthPart, "yyMMdd", null, System.Globalization.DateTimeStyles.None, out DateTime parsedDate))
    {
        return false;
    }
 
    // Check if the last two digits of the ID number match the last two digits of the year of birth
    if (parsedDate.Year % 100 != dateOfBirth.Year % 100)
    {
        return false;
    }
 
    // If it passes the length, date of birth, and year checks, it is considered valid
    return true;
}
 
 
private string GetRoleNameByUserType(int userTypeId)
{
    return userTypeId switch
    {
        1 => "Administrator",
        2 => "Employee",
        3 => "Member",
        _ => string.Empty,
    };
}

  
//untested login
[HttpPost]
[Route("Login")]
public async Task<ActionResult> Login(LoginViewModel lv)
{
    var user = await _userManager.FindByNameAsync(lv.Email);
 
    if (user != null && await _userManager.CheckPasswordAsync(user, lv.Password))
    {
        try
        {
            var principal = await _claimsPrincipalFactory.CreateAsync(user);
            return await GenerateJWTToken(user);
        }
        catch (Exception)
        {
 
            return StatusCode(StatusCodes.Status500InternalServerError, "Internal Server Error. Please contact support.");
        }
    }
    else
    {
        return NotFound("Incorrect email or password, Please Try Again");
    }
}
 
[HttpGet]
private async Task<ActionResult> GenerateJWTToken(User user)
{
    var role = await _userManager.GetRolesAsync(user);
    IdentityOptions _identityOptions = new IdentityOptions();
    // Create JWT Token
    var claims = new List<Claim>
    {
        new Claim(JwtRegisteredClaimNames.Sub, user.Email),
        new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
        new Claim(JwtRegisteredClaimNames.UniqueName, user.UserName),
        // Add user ID claim
        new Claim("userId", user.Id.ToString()),
 
        new Claim("User_Type_ID", user.User_Type_ID.ToString()),
 
    };
 
    if (role.Count() > 0)
    {
        claims.Add(new Claim(_identityOptions.ClaimsIdentity.RoleClaimType, role.FirstOrDefault()));
    }
 
    var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["Tokens:Key"]));
    var credentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
 
    var token = new JwtSecurityToken(
       issuer:  _configuration["Tokens:Issuer"],
       audience: _configuration["Tokens:Audience"],
       claims: claims,
       signingCredentials: credentials,
       expires: DateTime.UtcNow.AddHours(3)
    );
 
    return Created("", new
    {
        token = new JwtSecurityTokenHandler().WriteToken(token),
        user = user.UserName,
 
        userTypeId = user.User_Type_ID,
        // Include user ID in the response
        userId = user.Id
    });
}

//latest working editUser before base64
[HttpPut]
[Route("editUser/{id}")]
public async Task<IActionResult> EditUser(int id, UpdateUserViewModel uv)
{
    try
    {

        var user = await _userManager.FindByIdAsync(id.ToString());

        if (user == null)
        {
            return NotFound("User not found.");
        }

        user.Name = uv.Name;
        user.Surname = uv.Surname;
        user.Email = uv.Email;
        user.Physical_Address = uv.Physical_Address;
        user.PhoneNumber = uv.PhoneNumber;
        user.Photo = uv.Photo;

        // Update the user
        var result = await _userManager.UpdateAsync(user);

        if (result.Succeeded)
        {
            return Ok("User updated successfully.");
        }
        else
        {
            return BadRequest(result.Errors);
        }
    }
    catch (Exception)
    {

        return BadRequest("An Error Occured, Please Try Again");
    }
}

//latest working getUserById before base64
[HttpGet]
[Route("getUserById/{id}")]
public async Task<IActionResult> GetUserById(int id)
{

    try
    {
        var user = await _userManager.FindByIdAsync(id.ToString());

        if (user == null)
        {
            return NotFound("User not found.");
        }

        // Map User entity to UserViewModel or return the User entity directly
        var userViewModel = new UserViewModel
        {

            Name = user.Name,
            Surname = user.Surname,
            Email = user.Email,
            Physical_Address = user.Physical_Address,
            PhoneNumber = user.PhoneNumber,
            //Photo = user.Photo,
            Date_of_Birth = user.Date_of_Birth,
            User_Status_ID = user.User_Status_ID,
            User_Type_ID = user.User_Type_ID,
            Id_Number = user.ID_Number
        };

        return Ok(userViewModel);
    }
    catch (Exception)
    {

        return BadRequest("Try again");
    }
}
import math 

print(math.log10(10))
print(math.log10(50))
print(math.log10(100))
print(math.log10(200))
print(math.log10(1000))
class Solution
{
	public:
	//Function to find sum of weights of edges of the Minimum Spanning Tree.
    int spanningTree(int V, vector<vector<int>> adj[])
    {
        // code here
        vector<int> vis(V,0);
        vector<tuple<int,int,int>> mst;
        //wt,node,parent
        priority_queue<vector<int>,vector<vector<int>>, greater<vector<int>>> pq;
        
        pq.push({0,0,-1});
        int sum =0;
        
        while(!pq.empty()){
            auto it = pq.top();
            pq.pop();
            int node = it[1];
            int wt = it[0];
            int par = it[2];
            
            if(vis[node]==1) continue;
            vis[node]=1;
            sum+=wt;
            if(par!=-1){
                mst.push_back(make_tuple(wt,par,node));
            }
            for(auto it: adj[node]){
                int ch = it[0];
                int ch_w = it[1];
                if(!vis[ch]){
                    pq.push({ch_w, ch,node});
                }
            }
        }
        for(auto it: mst){
            int weight, u, v;
            tie(weight, u, v) = it;
            cout<<weight<<":"<<u<<"->"<<v<<endl;
        }
        return sum;
    }
};
int f(int ind,int buy,int t, vector<int>& nums, vector<vector<vector<int>>>& dp)
{
    if(ind==(nums.size()) || t==0)
    return 0;
    if(dp[ind][buy][t]!=-1)
    return dp[ind][buy][t];
    int profit;
    if(buy && t)
    profit = max((-nums[ind]+f(ind+1,0,t,nums,dp)),(f(ind+1,1,t,nums,dp)));
    else
    profit = max((nums[ind]+f(ind+1,1,t-1,nums,dp)),(f(ind+1,0,t,nums,dp)));
    return dp[ind][buy][t]=profit;
}
    int maxProfit(vector<int>& prices) {
         int n = prices.size();
     vector<vector<vector<int>>> dp(n, vector<vector<int>>(2, vector<int>(3, -1)));


         return f(0,1,2,prices,dp);
        
    }
int f(int ind,int buy, vector<int>& nums ,vector<vector<int>>& dp )
{
    if(ind==(nums.size()))
    return 0;
    if(dp[ind][buy]!=-1)
    return dp[ind][buy];
    int profit;
    if(buy)
    profit = max((-nums[ind]+f(ind+1,0,nums,dp)),(f(ind+1,1,nums,dp)));
    else
    profit = max((nums[ind]+f(ind+1,1,nums,dp)),(f(ind+1,0,nums,dp)));
    return dp[ind][buy]=profit;
}
    int maxProfit(vector<int>& prices) {
        int n = prices.size();
         vector<vector<int>> dp(n,vector<int>(2,-1));
         return f(0,1,prices,dp);
        
    }
import { useState } from "react";
import "./App.css";

function Square({ value, onSquareClick }) {
  return (
    <button className="square" onClick={onSquareClick}>
      {value}
    </button>
  );
}

function Board({ xIsNext, squares, onPlay }) {
  function handleClick(i) {
    if (calculateWinner(squares) || squares[i]) {
      return;
    }
    const nextSquares = squares.slice();
    if (xIsNext) {
      nextSquares[i] = "X";
    } else {
      nextSquares[i] = "O";
    }
    onPlay(nextSquares);
  }

  const winner = calculateWinner(squares);
  let status;
  if (winner) {
    status = "Winner: " + winner;
  } else {
    status = "Next player: " + (xIsNext ? "X" : "O");
  }

  return (
    <>
      <div className="status">{status}</div>
      <div className="board-row">
        <Square value={squares[0]} onSquareClick={() => handleClick(0)} />
        <Square value={squares[1]} onSquareClick={() => handleClick(1)} />
        <Square value={squares[2]} onSquareClick={() => handleClick(2)} />
      </div>
      <div className="board-row">
        <Square value={squares[3]} onSquareClick={() => handleClick(3)} />
        <Square value={squares[4]} onSquareClick={() => handleClick(4)} />
        <Square value={squares[5]} onSquareClick={() => handleClick(5)} />
      </div>
      <div className="board-row">
        <Square value={squares[6]} onSquareClick={() => handleClick(6)} />
        <Square value={squares[7]} onSquareClick={() => handleClick(7)} />
        <Square value={squares[8]} onSquareClick={() => handleClick(8)} />
      </div>
    </>
  );
}

export default function Game() {
  const [history, setHistory] = useState([Array(9).fill(null)]);
  const [currentMove, setCurrentMove] = useState(0);
  const xIsNext = currentMove % 2 === 0;
  const currentSquares = history[currentMove];

  function handlePlay(nextSquares) {
    const nextHistory = [...history.slice(0, currentMove + 1), nextSquares];
    setHistory(nextHistory);
    setCurrentMove(nextHistory.length - 1);
  }

  function jumpTo(nextMove) {
    setCurrentMove(nextMove);
  }

  const moves = history.map((squares, move) => {
    let description;
    if (move > 0) {
      description = "Go to move #" + move;
    } else {
      description = "Go to game start";
    }
    return (
      <li key={move}>
        <button onClick={() => jumpTo(move)}>{description}</button>
      </li>
    );
  });

  return (
    <div className="game">
      <div className="game-board">
        <Board xIsNext={xIsNext} squares={currentSquares} onPlay={handlePlay} />
      </div>
      <div className="game-info">
        <ol>{moves}</ol>
      </div>
    </div>
  );
}

function calculateWinner(squares) {
  const lines = [
    [0, 1, 2],
    [3, 4, 5],
    [6, 7, 8],
    [0, 3, 6],
    [1, 4, 7],
    [2, 5, 8],
    [0, 4, 8],
    [2, 4, 6],
  ];
  for (let i = 0; i < lines.length; i++) {
    const [a, b, c] = lines[i];
    if (squares[a] && squares[a] === squares[b] && squares[a] === squares[c]) {
      return squares[a];
    }
  }
  return null;
}
#include <bits/stdc++.h>
using namespace std;


class Solution {
public:
	void shortest_distance(vector<vector<int>>&matrix) {
		int n = matrix.size();
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (matrix[i][j] == -1) {
					matrix[i][j] = 1e9;
				}
				if (i == j) matrix[i][j] = 0;
			}
		}

		for (int k = 0; k < n; k++) {
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					matrix[i][j] = min(matrix[i][j],
					                   matrix[i][k] + matrix[k][j]);
				}
			}
		}




		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (matrix[i][j] == 1e9) {
					matrix[i][j] = -1;
				}
			}
		}
	}
};
#include <iostream>
using namespace std;
int sqrt(int arr[], int n, int key) {
  int start = 0;
  int end = n - 1;
  int mid = start + (end - start) / 2;
  int ans = -1;
  while (start <= end) {
    int square = mid * mid;
    if (square == key) {
      return mid;
    } else if (square > key) {
      end = mid - 1;
    } else {
      start = mid + 1;
      ans = mid;
    }
    mid = start + (end - start) / 2;
  }
  return ans;
}
double precision(int n, int precision, int integer) {
  double factor = 1;
  double ans = integer;
  for (int i = 0; i < precision; i++) {
    factor = factor / 10;
    for (double j = ans; j * j < n; j += factor) {
      ans = j;
    }
  }
  return ans;
}
int main() {
  int n;
  cout << "enter the number :" << endl;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    arr[i] = (i + 1);
  }
  int squareRoot = sqrt(arr, n, n);
  double finalAns = precision(n, 3, squareRoot);
  cout << "square root of " << n << " is " << finalAns << endl;
  return 0;
}
#include <iostream>
using namespace std;
long long int binarySearch(int arr[],int n,int key) {
  int start = 0;
  int end = n-1;
  long long int mid = start + (end-start)/2;
  long long int ans = -1;
while (start <= end){
  long long int square = mid*mid;
  if (square == key) {
    return mid;
  }
  else if (square > key) {
    end = mid - 1;
  }
  else {
    start = mid + 1;
    ans = mid;
  }
  mid = start + (end-start)/2;
}
  return ans;
}
int main() {
  int n;
  cout << "enter the number :" << endl;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
     arr[i] = (i+1);
  }
  int squareRoot = binarySearch(arr,n,n);
  cout << "square root of " << n << " is " << squareRoot << endl;
  return 0;
}
class Solution {
  public:
    /*  Function to implement Bellman Ford
    *   edges: vector of vectors which represents the graph
    *   S: source vertex to start traversing graph with
    *   V: number of vertices
    */
    vector<int> bellman_ford(int V, vector<vector<int>>& edges, int S) {
        // Code here
        //iterate through edges ond keep on updating the distance array. Iterate through all the edges for 
        //V-1 times
        vector<int> dis(V,1e8);
        dis[S]=0;
        for(int i=0;i<V-1;i++){
            
            for(int j =0;j<edges.size();j++){
                int u = edges[j][0];
                int v = edges[j][1];
                int w = edges[j][2];
                if(dis[u] != 1e8 && dis[u]+w<dis[v]){
                    dis[v]=dis[u]+w;
                }
            }
        }
        for(int i=0;i<1;i++){
            
            for(int j =0;j<edges.size();j++){
                int u = edges[j][0];
                int v = edges[j][1];
                int w = edges[j][2];
                if(dis[u] != 1e8 && dis[u]+w<dis[v]){
                    return {-1};
                }
            }
        }
        
        return dis;
    }
};
// To change the add to cart button on the single product page
add_filter( 'woocommerce_product_single_add_to_cart_link', 'custom_single_add_to_cart_link', 10, 2 );
function custom_single_add_to_cart_link( $button, $product ) {
    $url = $product->get_permalink();
    $button_text = __( 'See Prices', 'woocommerce' );
    $button = '<a href="' . esc_url( $url ) . '" class="button single_add_to_cart_button"><img src="https://mejormovil.es/wp-content/themes/woodmart/images/amazon-icon.png?_t=1717658998" alt="Amazon Icon" style="vertical-align: middle; margin-right: 5px; width: 16px; height: 16px;" />' . esc_html( $button_text ) . '</a>';
    return $button;
}

// To change the add to cart button on the product archives (collection) page
add_filter( 'woocommerce_loop_add_to_cart_link', 'custom_loop_add_to_cart_link', 10, 2 );
function custom_loop_add_to_cart_link( $button, $product ) {
    $url = $product->get_permalink();
    $button_text = __( 'See Prices', 'woocommerce' );
    $button = '<a href="' . esc_url( $url ) . '" class="button add_to_cart_button"><img src="https://mejormovil.es/wp-content/themes/woodmart/images/amazon-icon.png?_t=1717658998" alt="Amazon Icon" style="vertical-align: middle; margin-right: 5px; width: 16px; height: 16px;" />' . esc_html( $button_text ) . '</a>';
    return $button;
}

element.style {
}
.tag-description {
    margin-bottom: 20px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    background: #333;
    text-align: center;
    min-height: 150px;
    margin: 60px auto 80px;
    padding-left: 50px;
    padding-right: 50px;
}

#single #comments.hosted .comment .large.comment-author, .title.large, .wpcf7 label.large {
    font-size: 30px;
    line-height: 1.2;
}

.getox {
	display:none
}
.btnText {
    /* Default button styles */
}

.btnText {
    /* Default button styles */
}

/* Media query for mobile devices */
@media screen and (max-width: 768px) {
    .btnText {
        width: 150px; /* Adjusted width for mobile view */
        height: 30px; /* Adjusted height for mobile view */
        font-size: 10px; /* Adjusted font size for mobile view */
        text-align: center; /* Center align the text */
        line-height: 18px; /* Vertically center the text */
        font-weight: bold; /* Make the text bold */
        /* Add any additional styles for mobile view */
    }
}

.wd-product .wd-entities-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    height: 22px;
    font-size: inherit;
}
.wd-carousel-inner{
	height:auto;
}

.wd-product :is(.product-image-link,.hover-img) img {
    width: 100%;
	height:250px
}

.wd-product .wd-entities-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    height: 22px;
    font-size: inherit;
}
.wd-carousel-inner{
	height:auto;
}

.wd-product :is(.product-image-link,.hover-img) img {
    width: auto;
	height:250px
}



/* Styling the language switch container */
.gt_languages {
  display: flex;
  gap: 10px;
  margin: 10px 0; /* Add margin for spacing if needed */
}

/* Styling each language link */
.gt_languages a {
  display: flex;
  align-items: center;
  text-decoration: none; /* Remove default underline */
  color: #333; /* Default text color */
  font-weight: bold; /* Make text bold */
  padding: 5px 10px; /* Add some padding */
  border-radius: 5px; /* Rounded corners */
  transition: background-color 0.3s; /* Smooth transition for hover effect */
}

/* Adding hover effect */
.gt_languages a:hover {
  background-color: #f0f0f0; /* Light gray background on hover */
}

/* Styling the current language link */
.gt_languages a.gt-current-lang {
  background-color: #dcdcdc; /* Different background for the current language */
}

/* Styling the language flags */
.gt_languages img {
  margin-right: 5px; /* Space between flag and text */
  width: 24px; /* Ensure consistent size for flags */
  height: 24px; /* Ensure consistent size for flags */
}


.wd-product.wd-hover-fw-button .wrap-price {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--wd-prod-gap);
}





.wd-product .price {
    display: none;
}

.wd-single-price .price {
  display:none;  
	margin-bottom: 0;
    font-size: 155%;
    line-height: 1.2;
}


.product-image-link {
    pointer-events: none;
    cursor: default;
}


class Solution
{
	public:
	//Function to find the shortest distance of all the vertices
    //from the source vertex S.
    vector <int> dijkstra(int V, vector<vector<int>> adj[], int S)
    {
        // Code here
        //Dijkstra's algo
        //adj list, Create a dis array, intitialize with int_max, dis[src]=0,create a priority
        //queue or set where we'll store the dis and node, this priority queue/set would be sorted 
        // by the dis value and anlways the node with the smallest dis value will be at bottom,
        //we'll take out each one by one and then iterate to their adj nodes
        // and check if dis[curr]+wt<dis[child], if true then update the distance array
        vector<int> dis(V,INT_MAX);
        dis[S]=0;
        set<pair<int,int>> pq;
        pq.insert({0,S});
        while(!pq.empty()){
            auto it =*(pq.begin());
            int wt = it.first;
            int node = it.second;
            pq.erase(it);
            for(auto it:adj[node]){
                int ch = it[0];
                int edge =it[1];
                if(wt+edge<dis[ch]){
                    dis[ch]=wt+edge;
                    pq.insert({dis[ch],ch});
                }
            }
        }
        return dis;
        
        
    }
};
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;

class PostController extends Controller
{
    public function index()
    {
        $response = Http::get('https://jsonplaceholder.typicode.com/posts');
        $posts = $response->json();

        return view('posts.index', ['posts' => $posts]);
    }

    public function edit($id)
    {
        $response = Http::get('https://jsonplaceholder.typicode.com/posts/' . $id);
        $post = $response->json();

        return view('posts.edit', ['post' => $post]);
    }

    public function update(Request $request, $id)
    {
        // Simulates update logic for a real application (not supported by this API)
        $response = Http::put('https://jsonplaceholder.typicode.com/posts/' . $id, [
            'title' => $request->input('title'),
            'body' => $request->input('body'),
        ]);

        // Simulated response for successful or failed update
        if ($response->successful()) {
            return redirect()->route('posts.index')->with('success', 'Post updated successfully!');
        } else {
            return redirect()->route('posts.index')->with('error', 'Failed to update post. Please try again.');
        }
    }

    public function destroy($id)
    {
        // Simulates deletion logic for a real application (not supported by this API)
        $response = Http::delete('https://jsonplaceholder.typicode.com/posts/' . $id);

        // Simulated response for successful or failed deletion
        if ($response->successful()) {
            return redirect()->route('posts.index')->with('success', 'Post deleted successfully!');
        } else {
            return redirect()->route('posts.index')->with('error', 'Failed to delete post. Please try again.');
        }
    }
}
#include <iostream>
using namespace std;
int pivotSearch (int arr[],int n) {
  int start = 0;
  int end = n-1;
  int mid = start + (end-start)/2;
  while (start < end) {
    if (arr[mid] >= arr[0]) {
      start = mid + 1;
    }
    else {
      end = mid;
    }
    mid = start + (end-start)/2;
  }
  return end;
}
int binarySearch(int arr[],int n,int s,int e,int key) {
  int start = s;
  int end = e;
  int mid = start + (end-start)/2;
while (start <= end){
  if (arr[mid] == key) {
    return mid;
  }
  else if (arr[mid] > key) {
    end = mid - 1;
  }
  else {
    start = mid + 1;
  }
  mid = start + (end-start)/2;
}
  return -1;
}
int main() {
  int arr[6] = {3,8,10,0,1,2};
  int ans = pivotSearch(arr,6);
  cout << "the pivot is at : "<< ans << endl;
  if (2>=arr[ans]&&2<=arr[5]) {
    cout << "the element is present in the array at index     :" << binarySearch(arr,6,ans,5,2); 
  }
  else {
    cout << "the element is present in the array at index     :" << binarySearch(arr,6,0,ans-1,2);
  }
  return 0;
}
#include <iostream>
using namespace std;
int pivotSearch (int arr[],int n) {
  int start = 0;
  int end = n-1;
  int mid = start + (end-start)/2;
  while (start < end) {
    if (arr[mid] >= arr[0]) {
      start = mid + 1;
    }
    else {
      end = mid;
    }
    mid = start + (end-start)/2;
  }
  return end;
}
int main() {
  int arr[5] = {3,8,10,17,1};
  int ans = pivotSearch(arr,5);
  cout << "the pivot is : "<< ans;
  return 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Form Example</title>
</head>
<body>
  <form id="myForm">
    <label for="name">Name:</label>
    <input type="text" id="name" name="name">
    <button type="button" onclick="handleFormSubmit()">Submit</button>
  </form>

  <script src="script.js"></script>
</body>
</html>



// the JS
// Function to get the value from the input field
function getValue(callback) {
  // Get the input field
  const nameInput = document.getElementById('name');
  // Get the value from the input field
  const nameValue = nameInput.value;
  // Pass the value to the callback function
  callback(nameValue);
}

// Callback function to process the value
function processValue(value) {
  console.log('Processing value...');
  console.log(`Value received: ${value}`);
  // You can add more logic here to process the value further
}

// Function to handle form submission
function handleFormSubmit() {
  getValue(processValue);
}
(function () {
  'use strict';

  function fetchData(callback) { // create the first (outer) function
    const data = 'get data from an API';
    setTimeout(() => {
      callback(data); // use the callback param as a function and pass in the data value
    }, 1000);
  }

  function displayData(data) { // create the inner function that takes in the callback as a param
    console.log('processing data');
    console.log(data);
  }

  fetchData(displayData); // finally call the outer function with the inner function as a value
})();
import { useState } from "react";

function MyButton() {
  const [count, setCount] = useState(0);

  function handleClick() {
    setCount(count + 1);
  }

  return <button onClick={handleClick}>Clicked {count} {count === 1 ? "time" : "times"}</button>;
}

function App() {
  return <MyButton />;
}

export default App;
import "./App.css";

function MyButton() {
  return <button>MyButton</button>;
}

const products = [
  { title: "Cabbage", isFruit: false, id: 0 },
  { title: "Garlic", isFruit: false, id: 1 },
  { title: "Apple", isFruit: true, id: 2 },
];

function App() {
  const listitems = products.map((product) => (
    <li style={{ color: product.isFruit ? "red" : "green" }} key={product.id}>
      {product.title}
    </li>
  ));

  return (
    <div>
      <h1>Home</h1>
      <MyButton />
      <ul>{listitems}</ul>
    </div>
  );
}

export default App;
from collections import Counter

data = ['Java', 'Python', 'Java', 'C++', 'Python', 'PHP', 'C++', 'Java', 'PHP', 'Java', 'Python']

c = Counter(data)

print(c.most_common(3))
import tempfile

temp = tempfile.TemporaryFile('w+')
print(temp)

#write to the file
temp.write("Hello world,")
temp.write("\nWelcome to Pynerds.")

#read from the file
temp.seek(0)
for i in temp.read():
    print(i, end = '')

temp.close()
#Example with list
L = [1, 2, 3, 4, 5, 6, 7, 8, 9]
print(ascii(L.__repr__())) #same as print(L)

#Example with tuples
T = ("Pynerds", "Python", "Django", "Flask")
print(T.__repr__()) #same as print(T)

D = {1: "One", 2: "Two", 3: "Three"}

print(D.__repr__())#Same as print(D)
    Rigidbody m_Rigidbody;
    public float m_Speed = 5f;

    void Start()
    {
        //Fetch the Rigidbody from the GameObject with this script attached
        m_Rigidbody = GetComponent<Rigidbody>();
    }

    void FixedUpdate()
    {
        //Store user input as a movement vector
        Vector3 m_Input = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));

        //Apply the movement vector to the current position, which is
        //multiplied by deltaTime and speed for a smooth MovePosition
        m_Rigidbody.MovePosition(transform.position + m_Input * Time.deltaTime * m_Speed);
    }
#include <iostream>
using namespace std;
int firstOcc(int arr[], int n, int key) {
  int start = 0;
  int end = n-1;
  int ans = -1;
  int mid = start + (end-start)/2;
  while (start <= end) {
    if (arr[mid] == key) {
      ans = mid;
      end = mid - 1;
    }
    else if (arr[mid] < key) {
      start = mid + 1;
    }
    else {
      end = mid - 1;
    } 
    mid = start + (end-start)/2;
  }
  return ans;
}
int lastOcc(int arr[], int n, int key) {
  int start = 0;
  int end = n-1;
  int ans = -1;
  int mid = start + (end-start)/2;
  while (start <= end) {
    if (arr[mid] == key) {
      ans = mid;
      start = mid + 1;
    }
    else if (arr[mid] < key) {
      start = mid + 1;
    }
    else {
      end = mid - 1;
    } 
    mid = start + (end-start)/2;
  }
  return ans;
}
int main() {
  int array[6] = {1,2,2,2,2,3};
  int first = firstOcc(array,6,2);
  cout << "first occurance of 2 is at index " << first << endl;
  int last = lastOcc(array,6,2);
  cout << "last occurance of 2 is at index " << last << endl;
  return 0;
}
star

Mon Jun 24 2024 10:05:05 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=6z2HK4o8qcU&list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA&index=14

@vishnu_jha #c++ #dsa #binarysearch

star

Mon Jun 24 2024 10:05:04 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=6z2HK4o8qcU&list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA&index=14

@vishnu_jha #c++ #dsa #binarysearch

star

Mon Jun 24 2024 09:04:49 GMT+0000 (Coordinated Universal Time) Sweedies.co

@quanganh141220 #php #single #product

star

Mon Jun 24 2024 08:58:43 GMT+0000 (Coordinated Universal Time)

@Ayesha452

star

Mon Jun 24 2024 07:19:54 GMT+0000 (Coordinated Universal Time) https://www.cdek.ru/ru/tracking/

@Worktruck

star

Mon Jun 24 2024 05:52:07 GMT+0000 (Coordinated Universal Time)

@NoFox420 #css

star

Mon Jun 24 2024 05:25:36 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/59536041/flutter-when-text-is-bigger-than-input-text-disappears

@vaxate #dart

star

Mon Jun 24 2024 03:38:13 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

star

Mon Jun 24 2024 03:36:50 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

star

Mon Jun 24 2024 03:34:20 GMT+0000 (Coordinated Universal Time)

@nouhad #mel

star

Mon Jun 24 2024 01:07:06 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/how-to-cache-function-results-in-python/

@pynerds #python

star

Sun Jun 23 2024 21:33:45 GMT+0000 (Coordinated Universal Time) https://rdrr.io/snippets/

@jkirangw

star

Sun Jun 23 2024 21:32:16 GMT+0000 (Coordinated Universal Time) https://rdrr.io/snippets/

@jkirangw

star

Sun Jun 23 2024 19:01:32 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Jun 23 2024 18:01:25 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Jun 23 2024 17:53:51 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Jun 23 2024 17:53:06 GMT+0000 (Coordinated Universal Time)

@utp #c++

star

Sun Jun 23 2024 15:08:51 GMT+0000 (Coordinated Universal Time) https://www.reddit.com/r/ObsidianMD/comments/1bthjlp/what_plugins_could_i_use_to_organize_a_fiveyear/

@Enrico

star

Sun Jun 23 2024 14:39:26 GMT+0000 (Coordinated Universal Time)

@mehran

star

Sun Jun 23 2024 14:10:43 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Sun Jun 23 2024 14:02:53 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Sun Jun 23 2024 14:01:13 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Sun Jun 23 2024 13:51:27 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-math-log10-function/

@pynerds #python

star

Sun Jun 23 2024 13:43:15 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/problems/minimum-spanning-tree/1

@Dragon14641 #c++

star

Sun Jun 23 2024 13:02:41 GMT+0000 (Coordinated Universal Time) Buy & Sell Stock II & III are important for Stock DP

@ayushg103 #c++

star

Sun Jun 23 2024 12:36:10 GMT+0000 (Coordinated Universal Time) https://hdtoday.tv/home

@wheter

star

Sun Jun 23 2024 12:22:13 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Sun Jun 23 2024 11:21:34 GMT+0000 (Coordinated Universal Time) From my self

@Black_Shadow #react.js #+jsx

star

Sun Jun 23 2024 11:01:35 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/problems/implementing-floyd-warshall2042/1

@Dragon14641

star

Sun Jun 23 2024 10:39:23 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=6z2HK4o8qcU&list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA&index=14

@vishnu_jha #c++ #dsa

star

Sun Jun 23 2024 10:18:46 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=6z2HK4o8qcU&list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA&index=14

@vishnu_jha #c++ #dsa

star

Sun Jun 23 2024 10:07:22 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/problems/distance-from-the-source-bellman-ford-algorithm/1

@Dragon14641 #c++

star

Sun Jun 23 2024 09:52:57 GMT+0000 (Coordinated Universal Time)

@Promakers2611

star

Sun Jun 23 2024 09:52:20 GMT+0000 (Coordinated Universal Time)

@Promakers2611

star

Sun Jun 23 2024 09:51:29 GMT+0000 (Coordinated Universal Time)

@Promakers2611

star

Sun Jun 23 2024 09:49:42 GMT+0000 (Coordinated Universal Time)

@Promakers2611

star

Sun Jun 23 2024 09:16:50 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/problems/implementing-dijkstra-set-1-adjacency-matrix/1

@Dragon14641

star

Sun Jun 23 2024 08:33:22 GMT+0000 (Coordinated Universal Time) https://laracoding.com/calling-an-external-api-with-laravel/

@Sifat_H

star

Sun Jun 23 2024 08:27:08 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=6z2HK4o8qcU&list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA&index=14

@vishnu_jha #c++ #dsa

star

Sun Jun 23 2024 07:49:57 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=6z2HK4o8qcU&list=PLDzeHZWIZsTryvtXdMr6rPh4IDexB5NIA&index=14

@vishnu_jha #c++ #dsa

star

Sun Jun 23 2024 04:31:38 GMT+0000 (Coordinated Universal Time)

@davidmchale #callback #functions #forms

star

Sun Jun 23 2024 04:23:58 GMT+0000 (Coordinated Universal Time)

@davidmchale #callback #functions

star

Sat Jun 22 2024 20:23:25 GMT+0000 (Coordinated Universal Time) From my self

@Black_Shadow #react.js #+jsx

star

Sat Jun 22 2024 19:34:26 GMT+0000 (Coordinated Universal Time) From my self

@Black_Shadow #react.js #+jsx

star

Sat Jun 22 2024 18:55:00 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-collections-counter/

@pynerds #python

star

Sat Jun 22 2024 18:32:43 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/tempfile-module-in-python/

@pynerds #python

star

Sat Jun 22 2024 18:31:41 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/python-classes-repr-method/

@pynerds #python

star

Sat Jun 22 2024 16:01:43 GMT+0000 (Coordinated Universal Time) https://docs.unity3d.com/ScriptReference/Rigidbody.MovePosition.html

@gil

star

Sat Jun 22 2024 15:19:20 GMT+0000 (Coordinated Universal Time)

@vishnu_jha #c++

Save snippets that work with our extensions

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