Snippets Collections
void getNumberPattern(int n) {
    // Write your code here.
    for(int i=0;i<2*n-1;i++){
        for(int j=0;j<2*n-1;j++){
            int top=i;
            int left=j;
            int bottom=(2*n-2)-i;
            int right=(2*n-2)-j;
            cout<<n-min(min(top,left),min(right,bottom));
        }
        cout<<"\n";
    }
}
a , b = int(input()), int(input())
total_maximum = 0                    # сумма делителей
digit = 0                            # число с максимальной суммой делителей

for i in range(a, b + 1):             # цикл перебирающий все числа от a до b включительно
    maximum = 0                       # обнуление суммы делителей, для нового цикла
    for j in range(1, i + 1):         # проверяем все числа от 1 до числа не превышающего проверяемое
        if i % j == 0:                # проверка на деление без остатка
            maximum += j              # суммируем делители
        if maximum >= total_maximum:  # если сумма делителей больше max суммы делителей
            total_maximum = maximum   # записываем в переменную максимальную
            digit = j
print(digit, total_maximum)           # вывод 
  int f(int ind,vector<int>& nums,vector<int>& dp)
  {
      int one,two=INT_MAX;
      if(ind==0)return 0;
      if(dp[ind]!=-1)
      return dp[ind];
       one = f(ind-1,nums,dp)+abs(nums[ind]-nums[ind-1]);
      if(ind>1)
       two = f(ind-2,nums,dp)+abs(nums[ind]-nums[ind-2]);
      return dp[ind]=min(one,two);
  }
    int minimumEnergy(vector<int>& height, int n) {
        // Code here
        vector<int> dp(n,-1);
        return f(n-1,height,dp);
    }
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class Login extends StatefulWidget {
  const Login({super.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() {
    if (_formKey.currentState!.validate()) {
      // Perform the login action
      print('Form is valid');
    }
  }

  @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),
                Directionality(
                  textDirection: TextDirection.rtl,
                  child: TextFormField(
                    controller: _nameController,
                    textAlign: TextAlign.end,
                    decoration: const InputDecoration(
                      labelText: 'نام و نام خانوادگی',
                      border: OutlineInputBorder(),
                      focusedBorder: OutlineInputBorder(
                        borderSide: BorderSide(color: Colors.blue, width: 2.0),
                      ),
                    ),
                    validator: (value) {
                      if (value == null || value.isEmpty) {
                        return 'لطفا نام و نام خانوادگی خود را وارد کنید';
                      }
                      return null;
                    },
                  ),
                ),
                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),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
import 'package:first/Login/component/butten_next.dart';
import 'package:first/Login/component/phone_textfield.dart';
import 'package:first/Login/component/user_textfield.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class Login extends StatefulWidget {
  const Login({super.key});

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

class _LoginState extends State<Login> {
  final _formKey = GlobalKey<FormState>();

  void _submitForm() {
    if (_formKey.currentState!.validate()) {
      // Perform the login action
      print('Form is valid');
    }
  }

  @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 UserNameTextField(),
                const SizedBox(height: 20),
                const PhoneNumberTextField(),
                const SizedBox(height: 20),
                GradientButton(
                  text: 'ادامه',
                  onPressed: _submitForm,
                ),
                const SizedBox(height: 20),
                const Text(
                  'با ورود و استفاده از برنامه، شما با شرایط و قوانین موافقت می‌نمایید',
                  textAlign: TextAlign.end,
                  style: TextStyle(
                      fontSize: 12, color: Color.fromARGB(255, 0, 0, 0)),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}


btnclass
import 'package:flutter/material.dart';

class GradientButton extends StatelessWidget {
  final String text;
  final VoidCallback onPressed;

  const GradientButton({
    Key? key,
    required this.text,
    required this.onPressed,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        gradient: const LinearGradient(
          colors: [
            Color.fromARGB(255, 24, 40, 219),
            Color.fromARGB(255, 25, 235, 2)
          ],
          begin: Alignment.topLeft,
          end: Alignment.bottomRight,
        ),
        borderRadius: BorderRadius.circular(8.0),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withOpacity(0.2),
            spreadRadius: 1,
            blurRadius: 8,
            offset: const Offset(0, 4),
          ),
        ],
      ),
      child: ElevatedButton(
        onPressed: onPressed,
        style: ElevatedButton.styleFrom(
          padding: const EdgeInsets.symmetric(vertical: 16.0),
          backgroundColor: Colors.transparent,
          shadowColor: Colors.transparent,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(8.0),
          ),
          textStyle: const TextStyle(
            fontSize: 18,
            color: Colors.white,
          ),
        ),
        child: Text(text),
      ),
    );
  }
}

Variable declarations begin with two dashes (-) and are given a name and a value like this: --variable-name: value;
                                             
To use a variable, put the variable name in parentheses with var in front of them like this: var(--variable-name). Whatever value you gave the variable will be applied to whatever property you use it on.

You should add a fallback value to a variable by putting it as the second value of where you use the variable like this: var(--variable-name, fallback-value). The property will use the fallback value when there's a problem with the variable. 

Variables are often declared in the :root selector. This is the highest level selector in CSS; putting your variables there will make them usable everywhere.

Gradients in CSS are a way to transition between colors across the distance of an element. They are applied to the background property and the syntax looks like this:

Example Code
gradient-type(
  color1,
  color2
);

Gradients can use as many colors as you want like this:

Example Code
gradient-type(
  color1,
  color2,
  color3
);

You can specify where you want a gradient transition to complete by adding it to the color like this:

Example Code
gradient-type(
  color1,
  color2 20%,
  color3
);

Gradient transitions often gradually change from one color to another. You can make the change a solid line like this:

Example Code
linear-gradient(
  var(--first-color) 0%,
  var(--first-color) 40%,
  var(--second-color) 40%,
  var(--second-color) 80%
);

You can specify another direction by adding it before your colors like this:

Example Code
gradient-type(
  direction,
  color1,
  color2
);

You can add multiple gradients to an element by separating them with a comma (,) like this:

Example Code
gradient1(
  colors
),
gradient2(
  colors
);
 int f(int ind,int wt, int w[],int v[],vector<vector<int>>& dp)
    {
        if(ind==0)
        {
            return (w[0]<=wt)?v[0]:0;
        }
        int pick,nonpick;
        if(dp[ind][wt]!=-1)
        return dp[ind][wt];
        nonpick = f(ind-1,wt,w,v,dp);
        pick = INT_MIN;
        if(wt>=w[ind])
        pick = v[ind] + f(ind-1,wt-w[ind],w,v,dp);
        
        return dp[ind][wt] = max(pick,nonpick);
    }
    int knapSack(int W, int wt[], int val[], int n) 
    { 
       // Your code here
       vector<vector<int>> dp(n + 1, vector<int>(W + 1, -1));
       return f(n-1,W,wt,val,dp);
    }
public class ListToArrayExample{  
public static void main(String args[]){  
 List<String> fruitList = new ArrayList<>();    
 fruitList.add("Mango");    
 fruitList.add("Banana");    
 fruitList.add("Apple");    
 fruitList.add("Strawberry");    
 //Converting ArrayList to Array  
 String[] array = fruitList.toArray(new String[fruitList.size()]);    
 System.out.println("Printing Array: "+Arrays.toString(array));  
 System.out.println("Printing List: "+fruitList);  
}  
}  
import java.util.*;  
public class ArrayToListExample{  
public static void main(String args[]){  
//Creating Array  
String[] array={"Java","Python","PHP","C++"};  
System.out.println("Printing Array: "+Arrays.toString(array));  
//Converting Array to List  
List<String> list=new ArrayList<String>();  
for(String lang:array){  
list.add(lang);  
}  
System.out.println("Printing List: "+list);  
  
}  
}  
Use the universal selector to add box-sizing: border-box; to your CSS. This ensures elements include padding and border in their specified width and height.

CSS positioning lets you set how you want an element to be positioned in the browser. It has a position property you can set to static, absolute, relative, sticky or fixed.

Once you set the position property of the element, you can move the element around by setting a pixel or a percentage value for one or more of the top, right, left, or bottom properties.

static is the default positioning for all elements. If you assign it to an element, you won't be able to move it around with top, right, left, or bottom.

When you use the relative value, the element is still positioned according to the normal flow of the document, but the top, left, bottom, and right values become active.

The next position property is absolute. When you use the absolute value for your position property, the element is taken out of the normal flow of the document, and then its position is determined by the top, right, bottom, and left properties.

fixed is a position property value that lets you make an element fixed to the page no matter where the user scrolls to on the page.

The last position property value is sticky. sticky positioning is a hybrid of relative and fixed positioning. It allows an element to stick to a specific position within its containing element or viewport, based on the scroll position.

The transform property allows you to modify the shape, position, and size of an element without changing the layout or affecting the surrounding elements. It has functions such as translate(), rotate(), scale(), skew(), and matrix().

z-index is a property you can use to define the order of overlapping HTML elements. Any element with a higher z-index will always be positioned over an element with a lower z-index.

A CSS selector can contain more than one simple selector. Between the simple selectors, we can include a combinator.

There are four different combinators in CSS:

descendant selector (space)
child selector (>)
adjacent sibling selector (+)
general sibling selector (~)

The @media at-rule, also known as a media query, is used to conditionally apply CSS. Media queries are commonly used to apply CSS based on the viewport width using the max-width and min-width properties.

In the below example the padding is applied to the .card class when the viewport is 960px wide and below.

Example Code
@media (max-width: 960px) {
  .card {
    padding: 2rem;
  }
}

Logical operators can be used to construct more complex media queries. The and logical operator is used to query two media conditions.

For example, a media query that targets a display width between 500px and 1000px would be:

Example Code
@media (min-width: 500px) and (max-width: 1000px){

}

Setting the width of a block-level element will prevent it from stretching out to the edges of its container to the left and right. Then, you can set the left and right margins to auto to horizontally center that element within its container. The element will take up the width you specify, then the remaining space will be split evenly between the two margins.

The only problem occurs when the browser window is narrower than the width of your element. The browser resolves this by creating a horizontal scrollbar on the page. 

Using max-width instead of width in this situation will improve the browser's handling of small windows. 
You can use CSS pseudo selectors to change specific HTML elements.

The span[class~="sr-only"] selector will select any span element whose class includes sr-only.

The CSS clip property is used to define the visible portions of an element. 

The clip-path property determines the shape the clip property should take.

The :first-of-type pseudo-selector is used to target the first element that matches the selector.

The :last-of-type pseudo-selector does the exact opposite - it targets the last element that matches the selector.

The calc() function is a CSS function that allows you to calculate a value based on other values. For example, you can use it to calculate the width of the viewport minus the margin of an element:
.exampleClass {
  margin: 10px;
  width: calc(100% - 20px);
}

Adding position sticky moved the element into its own stack. To ensure your element does not get hidden by different stacks, add a z-index.

The :not() pseudo-selector is used to target all elements that do not match the selector.

The border-collapse property sets whether table borders should collapse into a single border or be separated as in standard HTML.

The [attribute="value"] selector targets any element that has an attribute with a specific value. 

The key difference between tr[class="total"] and tr.total is that the first will select tr elements where the only class is total. The second will select tr elements where the class includes total.

The :nth-of-type() pseudo-selector is used to target specific elements based on their order among siblings of the same type.

Vertically align the text to the top, horizontally align the text to the right.
	text-align: right;
	vertical-align: top;
background-color: #f0f0f0; /* sets the background color to a light gray */
font-family: Arial, sans-serif; /* sets the font to Arial or a similar sans-serif font */
  font-size: 18px; /* sets the font size to 18 pixels */
  font-style: italic; /* sets the font style to italic */
  color: #00698f; /* sets the text color to a dark blue */
  text-align: center; /* centers the text horizontally */
  text-decoration: underline; /* adds an underline to the text */
  text-indent: 20px; /* indents the text 20 pixels from the left */
}
```
Flexbox helps you design your webpage so that it looks good on any screen size.

The box-sizing property is used to set this behavior. By default, the content-box model is used. With this model, when an element has a specific width, that width is calculated based only on the element's content. Padding and border values get added to the total width, so the element grows to accommodate these values.

The border-box sizing model does the opposite of content-box. The total width of the element, including padding and border, will be the explicit width set. The content of the element will shrink to make room for the padding and border.

Flexbox is a one-dimensional CSS layout that can control the way items are spaced out and aligned within a container.

To use it, give an element a display property of flex. This will make the element a flex container. Any direct children of a flex container are called flex items.

Flexbox has a main and cross axis. The main axis is defined by the flex-direction property, which has four possible values:

row (default): horizontal axis with flex items from left to right
row-reverse: horizontal axis with flex items from right to left
column: vertical axis with flex items from top to bottom
column-reverse: vertical axis with flex items from bottom to top

The flex-wrap property determines how your flex items behave when the flex container is too small. Setting it to wrap will allow the items to wrap to the next row or column. nowrap (default) will prevent your items from wrapping and shrink them if needed.

The justify-content property determines how the items inside a flex container are positioned along the main axis, affecting their position and the space around them.

The align-items property positions the flex content along the cross axis. For example, with your flex-direction set to row (horizontal), your cross axis would be vertical.

The CSS object-fit property is used to specify how an <img> or <video> should be resized to fit its container.

This property tells the content to fill the container in a variety of ways; such as "preserve that aspect ratio" or "stretch up and take up as much space as possible".

The gap CSS shorthand property sets the gaps, also known as gutters, between rows and columns. The gap property and its row-gap and column-gap sub-properties provide this functionality for flex, grid, and multi-column layout. You apply the property to the container element.

The ::after pseudo-element creates an element that is the last child of the selected element. You can use it to add an empty element after the last image. If you give it the same width as the images it will push the last image to the left when the gallery is in a two-column layout. Right now, it is in the center because you set justify-content: center on the flex container.
 for (const item of menu.entries()) {
    const [index, ...menuItem] = item;
    const startIndex = index + 1;
    console.log(`${startIndex}: ${menuItem}`);
  }
Every HTML element is its own box – with its own spacing and a border. This is called the Box Model.

In the CSS box model, every HTML element is treated as a box with four areas.

Imagine you receive a box from your favorite online retailer -- the content is the item in the box, or in our case, a header, paragraph, or image element.

The content is surrounded by a space called padding, similar to how bubble wrap separates an item from the box around it.

Think of the border like the cardboard box your item was shipped in.

Margin is the area outside of the box, and can be used to control the space between other boxes or elements.

Use padding to adjust the spacing within an element.

Use margins to adjust the spacing outside of an element.


The overflow property specifies whether to clip the content or to add scrollbars when the content of an element is too big to fit in the specified area.

The overflow property has the following values:

visible - Default. The overflow is not clipped. The content renders outside the element's box
hidden - The overflow is clipped, and the rest of the content will be invisible
scroll - The overflow is clipped, and a scrollbar is added to see the rest of the content
auto - Similar to scroll, but it adds scrollbars only when necessary

Center the elements by setting its margin to auto.

It's helpful to have your margins push in one direction.

The filter property defines visual effects (like blur and saturation) to an element (often <img>).
                                                                                     
The CSS box-shadow property is used to apply one or more shadows to an element.
                                                                                     
The transform property applies a 2D or 3D transformation to an element. This property allows you to rotate, scale, move, skew, etc., elements.
from collections import namedtuple

Point = namedtuple("Point", ['x', 'y'])

p = Point(3, 5)

print(p.x, p.y) #using attributes
print(p[0], p[1]) # using indexes
git push url://to/new/repository.git branch-to-move:new-branch-name
 echo off 

 echo Please paste folder with files to identify: 

 echo ************************** 

 set /p inputfolder= folder : 

 for /r "%inputfolder%\" %%X in (*.*) do ( 

               echo new File >> gfindings.txt 
		
               echo TRId Findings >> govDocs.txt 
 
               trid "%%X" >> govDocs.txt 

 ) 

 Pause 
It's possible to tell TrID to show some more information about every match (such as the mime type, who created that definition, how many files were scanned, etc.); and it's also possible to limit the number of results shown. The switch -v activate the verbose mode, and -r:nn specifies the max number of matches that TrID will display. Default is 5 for normal mode, 2 for verbose, 1 for multi-files analysis.

 	C:\TrID>trid "c:\t\Windows XP Startup.ogg" -v -r:2

 TrID/32 - File Identifier v2.24 - (C) 2003-16 By M.Pontello          

 Collecting data from file: c:\t\Windows XP Startup.ogg
 Definitions found: 5702
 Analyzing...

  77.8% (.OGG) OGG Vorbis audio (14014/3)
          Mime type  : audio/ogg
        Definition   : audio-ogg-vorbis.trid.xml
          Files      : 37
        Author       : Marco Pontello
          E-Mail     : marcopon@nospam@gmail.com
          Home Page  : http://mark0.net

  22.2% (.OGG) OGG stream (generic) (4000/1)
        Definition   : ogg-stream.trid.xml
          Files      : 35
        Author       : Marco Pontello
          E-Mail     : marcopon@nospam@gmail.com
          Home Page  : http://mark0.net
Instead, the switch -ce will just change the file extension to the new one; if the file has no extension, the new one will be added. For example:

  IAmASoundFile.dat -> IAmASoundFile.wav
  IAmABitmap -> IAmABitmap.bmp
:: Wildcards can be used to scan groups of files, entire folders, etc. In addition, using the switch -ae will instruct TrID to add the guessed extensions to the filenames. This come handy, for example, when working with files recovered by data rescue softwares. For example:

 C:\TrID>trid c:\temp\* -ae

 
 TrID/32 - File Identifier v2.24 - (C) 2003-16 By M.Pontello          
 Definitions found:  5702
 Analyzing...

 File: c:\temp\FILE0001.CHK
  75.8% (.BAV) The Bat! Antivirus plugin (187530/5/21)

 File: c:\temp\FILE0002.CHK
  77.8% (.OGG) OGG Vorbis Audio (14014/3)

 File: c:\temp\FILE0003.CHK
  86.0% (.DOC) Microsoft Word document (49500/1/4)

 File: c:\temp\FILE0004.CHK
  42.6% (.EXE) UPX compressed Win32 Executable (30569/9/7)

  4 file(s) renamed.
deleteRecordMap = Map();
deleteRecordMap = {"module":"Leads","id":leadId};
deleteResp = zoho.crm.invokeConnector("crm.delete",deleteRecordMap);
info deleteResp;
{
  "eventId": 0,
  "associationId": 41,
  "eventTypeId": 2,
  "title": "Sustainable Future Forum 2024",
  "description": "A global forum dedicated to discussions and innovations in sustainability, renewable energy, and environmental protection.",
  "cityId": 148013,
  "stateId": 32,
  "countryId": 1,
  "eventModeId": 45,
  "registrationStartDate": "2024-06-17T06:32:21.324Z",
  "registrationEndDate": "2024-06-18T06:32:21.324Z",
  "eventStartDate": "2024-06-18T06:32:21.324Z",
  "eventEndDate": "2024-06-23T06:32:21.324Z",
  "broucherUrl": "",
  "address": "Madhapur",
  "videoUrl": "https://youtube.com/shorts/t6SLjTQbPh0?si=gJ9_eiYVqS3JFsGJ",
  "eventStatusId": 0,
  "phoneCode": "+91",
  "contactNumber": "7898561235",
  "contactEmail": "contact@sustainablefuture.com",
  "webSite": "https://sustainablefutureforum.com",
  "geolocation": {
    "x": 17.419791987251436,
    "y": 78.32488111758651
  },
  "isFreeEvent": true,
  "bannerUrls": [
    "https://s3.ap-south-1.amazonaws.com/myassociation-dev-objects/events pictures/download (5).jpeg"
  ],
  "organizingGroups": [
    126
  ],
  "eventRegistrationDetails": [
    {
      "eventRegistrationDetailId": 0,
      "eventId": 0,
      "isFoodProvided": true,
      "isAccommodationProvided": true,
      "isTransportProvided": true,
      "title": "Early Bird Registration",
      "applicableTillDate": "2024-06-18T06:32:21.324Z",
      "applicableRegistrationFee": 5000,
      "applicableCurrencyCode": "INR",
      "onspotCurrencyCode": "INR",
      "onSpotRegistrationFee": 2500,
      "registeredMembers": 0
    }
  ],
  "agenda": [
    {
      "eventAgendaId": 0,
      "eventId": 0,
      "title": "The Future of AI in India",
     "description": "An in-depth look at the future of artificial intelligence in India and its potential impact on various sectors.",
     "agendaDate": "2024-06-01T12:42:32.972Z",
     "startTime": "10:00:00",
     "endTime": "16:00:00",
     "presenters": [
    397,398
   ],
 "presentersDetails": ""
 }
  ],
  "eventGuidelines": {
    "eventGuidelineId": 0,
    "eventId": 0,
    "registrationGuidelines": "Participants are encouraged to pre-register for the event",
    "cancellationGuidelines": "Clearly communicate the reason for the cancellation",
    "importantGuidelines": "Prioritize the safety and wellbeing of attendees"
  },
  "eventAccountInfo": {
    "eventAccountInfoId": 0,
    "eventId": 0,
    "name": " SustainableFutureForum ",
    "bankName": "Vijaya Bank",
    "bankAccountNumber": "85986263569",
    "bankRoutingTypeId": 46,
    "bankRoutingType": "IFSC",
    "bankRoutingCode": "Vijaya12358",
    "isOrgAccount": true,
    "upiId": "",
    "bankingPaymentTypeId": 170
  },
  "hasRegistered": true,
  "bannerUrlsString": "",
  "eventType": "Workshop",
  "eventMode": "Hybrid"
}
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class ShopSystem : MonoBehaviour
{
    public enum ItemStatus
    {
        PURCHASEABLE,
        NOT_IN_USE,
        IN_USE
    }

    [SerializeField] int curr_Wallpaper;
    [SerializeField] int curr_Floor;
    [SerializeField] int curr_Couch;
    [SerializeField] int curr_CatTree;

    [SerializeField] GameManager gm;

    // the in-game items that will change
    [SerializeField] Image WallpaperImage;
    [SerializeField] Image FloorImage;
    [SerializeField] Image CouchImage;
    [SerializeField] Image CatTreeImage;

    [System.Serializable] public class ShopItem
    {
        public Sprite Icon;
        public int Paws;
        public bool IsPurchased = false;
        public ItemStatus status = ItemStatus.PURCHASEABLE;
    }

    // can be edited in the scrollview component of the inspector
    [SerializeField] List<ShopItem> WallpaperList;
    [SerializeField] List<ShopItem> FloorList;
    [SerializeField] List<ShopItem> CouchList;
    [SerializeField] List<ShopItem> CatTreeList;

    GameObject ItemTemplate;
    GameObject g;

    [SerializeField] GameObject Wallpaper;
    [SerializeField] GameObject Floor;
    [SerializeField] GameObject Couch;
    [SerializeField] GameObject CatTree;

    [SerializeField] Transform WallpaperContent;
    [SerializeField] Transform FloorContent;
    [SerializeField] Transform CouchContent;
    [SerializeField] Transform CatTreeContent;

    Button buyButton;

    public enum ShopTabs
    {
        WALLPAPER,
        FLOOR,
        COUCH,
        CAT_TREE
    }

    [SerializeField] Button wallpaperButton;
    [SerializeField] Button floorButton;
    [SerializeField] Button couchButton;
    [SerializeField] Button catTreeButton;

    private string saveFilePath;

    void Awake()
    {
        saveFilePath = Path.Combine(Application.persistentDataPath, "ShopData.json");
    }

    void Start()
    {
        // set up for whenever the tab buttons are pressed
        wallpaperButton.AddEventListener(ShopTabs.WALLPAPER, OnShopTabButtonClicked);
        floorButton.AddEventListener(ShopTabs.FLOOR, OnShopTabButtonClicked);
        couchButton.AddEventListener(ShopTabs.COUCH, OnShopTabButtonClicked);
        catTreeButton.AddEventListener(ShopTabs.CAT_TREE, OnShopTabButtonClicked);

        // call functions to create shop
        LoadShopData(); // reads data from json file
        PopulateShop(); // creates the items

        // allows data from previous play through to be read on game start up
        gm.CloseShopPage();

        // link up assets
        WallpaperImage.sprite = WallpaperList[curr_Wallpaper].Icon;
        FloorImage.sprite = FloorList[curr_Floor].Icon;
        CouchImage.sprite = CouchList[curr_Couch].Icon;
        CatTreeImage.sprite = CatTreeList[curr_CatTree].Icon;
    }

    public void PopulateShop()
    {

        // get the template for reference
        ItemTemplate = WallpaperContent.GetChild(0).gameObject;

        // create specific items for each tab
        curr_Wallpaper = PopulateItems(WallpaperList, WallpaperContent, curr_Wallpaper, WallpaperImage);
        curr_Floor = PopulateItems(FloorList, FloorContent, curr_Floor, FloorImage);
        curr_Couch = PopulateItems(CouchList, CouchContent, curr_Couch, CouchImage);
        curr_CatTree = PopulateItems(CatTreeList, CatTreeContent, curr_CatTree, CatTreeImage);

        // destroy template after creating items
        Destroy(ItemTemplate);
    }

    int PopulateItems(List<ShopItem> itemList, Transform content, int currentItem, Image image)
    {
        // get amount of items in the list that exists
        int amountOfItems = itemList.Count;
        for (int i = 0; i < amountOfItems; i++)
        {
            // use template to create the item
            g = Instantiate(ItemTemplate, content);
            if (itemList[i] != null)
            {
                //set icon of the item being constructed
                g.transform.GetChild(0).GetComponent<Image>().sprite = itemList[i].Icon;
            }
            // set cost of the item
            g.transform.GetChild(1).GetChild(0).GetComponent<TextMeshProUGUI>().text = itemList[i].Paws.ToString();
            // get the buy button
            buyButton = g.transform.GetChild(2).GetComponent<Button>();

            if (itemList[i].status == ItemStatus.PURCHASEABLE)
            {
                // item is interactable if not yet purchased
                buyButton.transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = "BUY";
                buyButton.interactable = true;
            }
            else if (itemList[i].status == ItemStatus.NOT_IN_USE)
            {
                // item is also interactable if not currently in use
                buyButton.transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = "NOT IN USE";
                buyButton.interactable = true;
            }
            else if (itemList[i].status == ItemStatus.IN_USE)
            {
                // NOT interactable if already being used
                buyButton.transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = "IN USE";
                buyButton.interactable = false;
                currentItem = i;
                image.sprite = content.GetChild(currentItem).GetChild(0).GetComponent<Image>().sprite;
            }
            
            int index = i;
            // add a listener to the buy button
            buyButton.onClick.AddListener(() => OnShopItemButtonClicked(index, itemList, content, image, ref currentItem));
        }

        return currentItem;
    }

    void Update()
    {
        if (wallpaperButton.interactable == false)
        {
            // only look at wallpaper section
            Wallpaper.SetActive(true);
            Floor.SetActive(false);
            Couch.SetActive(false);
            CatTree.SetActive(false);
        }
        else if (floorButton.interactable == false)
        {
            // only look at floor section
            Wallpaper.SetActive(false);
            Floor.SetActive(true);
            Couch.SetActive(false);
            CatTree.SetActive(false);
        }
        else if (couchButton.interactable == false)
        {
            // only look at couch section
            Wallpaper.SetActive(false);
            Floor.SetActive(false);
            Couch.SetActive(true);
            CatTree.SetActive(false);

        }
        else if (catTreeButton.interactable == false)
        {
            // only look at cat tree section
            Wallpaper.SetActive(false);
            Floor.SetActive(false);
            Couch.SetActive(false);
            CatTree.SetActive(true);
        }
    }

    void OnShopItemButtonClicked(int itemIndex, List<ShopItem> itemList, Transform content, Image image, ref int curr_item)
    {
        // player has enough paws and item can be bought
        if (gm.GetPaws() >= itemList[itemIndex].Paws && itemList[itemIndex].status == ItemStatus.PURCHASEABLE)
        {
            // charge player paws
            gm.LosePaws(itemList[itemIndex].Paws);
            //purchase item
            itemList[itemIndex].IsPurchased = true;

            // get buy button of the item and change status to reflect action
            buyButton = content.GetChild(itemIndex).GetChild(2).GetComponent<Button>();
            buyButton.interactable = true;
            buyButton.transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = "NOT IN USE";
            itemList[itemIndex].status = ItemStatus.NOT_IN_USE;
        }
        else if (itemList[itemIndex].status == ItemStatus.NOT_IN_USE)
        {
            // revert the status for the one previously in use
            for (int i = 0; i < itemList.Count; i++)
            {
                // if it says in use and is not the one player just picked
                if (itemList[i].status == ItemStatus.IN_USE)
                {
                    itemList[i].status = ItemStatus.NOT_IN_USE;
                    // change button settings
                    buyButton = content.GetChild(i).GetChild(2).GetComponent<Button>();
                    buyButton.interactable = true;
                    buyButton.transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = "NOT IN USE";
                }
            }

            // set the item to IN USE
            itemList[itemIndex].status = ItemStatus.IN_USE;
            buyButton = content.GetChild(itemIndex).GetChild(2).GetComponent<Button>();
            // player can no longer interact with this button
            buyButton.interactable = false;
            buyButton.transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = "IN USE";
            curr_item = itemIndex;
            // change wallpaper of the game
            // get the Icon image of the item listing
            image.sprite = content.GetChild(itemIndex).GetChild(0).GetComponent<Image>().sprite;
            SaveShopData();
        }
    }

    void OnShopTabButtonClicked(ShopTabs tabNum)
    {
        if (tabNum == ShopTabs.WALLPAPER)
        {
            wallpaperButton.interactable = false;
            floorButton.interactable = true;
            couchButton.interactable = true;
            catTreeButton.interactable = true;
        }
        else if (tabNum == ShopTabs.FLOOR)
        {
            wallpaperButton.interactable = true;
            floorButton.interactable = false;
            couchButton.interactable = true;
            catTreeButton.interactable = true;
        }
        else if (tabNum == ShopTabs.COUCH)
        {
            wallpaperButton.interactable = true;
            floorButton.interactable = true;
            couchButton.interactable = false;
            catTreeButton.interactable = true;
        }
        else if (tabNum == ShopTabs.CAT_TREE)
        {
            wallpaperButton.interactable = true;
            floorButton.interactable = true;
            couchButton.interactable = true;
            catTreeButton.interactable = false;
        }
    }

    // save data into json file
    public void SaveShopData()
    {
        ShopData data = new ShopData();

        // which item is currently in use
        data.curr_Wallpaper = curr_Wallpaper;
        data.curr_Floor = curr_Floor;
        data.curr_Couch = curr_Couch;
        data.curr_CatTree = curr_CatTree;

        foreach (var item in WallpaperList)
        {
            data.WallpaperList.Add(new ShopItemData(GetIconPath(ShopTabs.WALLPAPER, item.Icon), item.Paws, item.IsPurchased, item.status));
        }
        foreach (var item in FloorList)
        {
            data.FloorList.Add(new ShopItemData(GetIconPath(ShopTabs.FLOOR, item.Icon), item.Paws, item.IsPurchased, item.status));
        }
        foreach (var item in CouchList)
        {
            data.CouchList.Add(new ShopItemData(GetIconPath(ShopTabs.COUCH, item.Icon), item.Paws, item.IsPurchased, item.status));
        }
        foreach (var item in CatTreeList)
        {
            data.CatTreeList.Add(new ShopItemData(GetIconPath(ShopTabs.CAT_TREE, item.Icon), item.Paws, item.IsPurchased, item.status));
        }

        // write all the lists into json file
        string shopData = JsonUtility.ToJson(data, true);
        File.WriteAllText(saveFilePath, shopData);
    }

    private string GetIconPath(ShopTabs itemType, Sprite icon)
    {
        if (icon != null)
        {
            if (itemType == ShopTabs.WALLPAPER)
            {
                return "Shop_Wallpaper/" + icon.name;
            }
            else if (itemType == ShopTabs.FLOOR)
            {
                return "Shop_Floor/" + icon.name;
            }
            else if (itemType == ShopTabs.COUCH)
            {
                return "Shop_Couch/" + icon.name;
            }
            else if (itemType == ShopTabs.CAT_TREE)
            {
                return "Shop_CatTree/" + icon.name;
            }
        }
        return "";
    }

    // load in shop data 
    public void LoadShopData()
    {
        // check if file exists to pull from
        if (File.Exists(saveFilePath))
        {
            //read in pre-existing data if it exists
            string json = File.ReadAllText(saveFilePath);
            ShopData data = JsonUtility.FromJson<ShopData>(json);

            curr_Wallpaper = data.curr_Wallpaper;
            curr_Floor = data.curr_Floor;
            curr_Couch = data.curr_Couch;
            curr_CatTree = data.curr_CatTree;

            // fill in for wallpaper list
            WallpaperList = new List<ShopItem>();
            foreach (var itemData in data.WallpaperList)
            {
                // load the sprite in using the icon path
                var sprite = Resources.Load<Sprite>(itemData.IconPath);
                var item = new ShopItem() { Icon = sprite, Paws = itemData.Paws, IsPurchased = itemData.IsPurchased, status = (ItemStatus)System.Enum.Parse(typeof(ItemStatus), itemData.Status) };
                WallpaperList.Add(item);
            }

            // fill in for floor list
            FloorList = new List<ShopItem>();
            foreach (var itemData in data.FloorList)
            {
                // load the sprite in using the icon path
                var sprite = Resources.Load<Sprite>(itemData.IconPath);
                var item = new ShopItem() { Icon = sprite, Paws = itemData.Paws, IsPurchased = itemData.IsPurchased, status = (ItemStatus)System.Enum.Parse(typeof(ItemStatus), itemData.Status) };
                FloorList.Add(item);
            }

            CouchList = new List<ShopItem>();
            foreach (var itemData in data.CouchList)
            {
                var sprite = Resources.Load<Sprite>(itemData.IconPath);
                var item = new ShopItem() { Icon = sprite, Paws = itemData.Paws, IsPurchased = itemData.IsPurchased, status = (ItemStatus)System.Enum.Parse(typeof(ItemStatus), itemData.Status) };
                CouchList.Add(item);
            }

            CatTreeList = new List<ShopItem>();
            foreach (var itemData in data.CatTreeList)
            {
                var sprite = Resources.Load<Sprite>(itemData.IconPath);
                var item = new ShopItem() { Icon = sprite, Paws = itemData.Paws, IsPurchased = itemData.IsPurchased, status = (ItemStatus)System.Enum.Parse(typeof(ItemStatus), itemData.Status) };
                CatTreeList.Add(item);
            }
        }
        else
        {
            // create json file if it doesnt exist
            SaveShopData();
        }
    }

    void OnApplicationQuit()
    {
        // save current data to json file
        SaveShopData();
    }
}
conda create -n rapids-24.06 -c rapidsai -c conda-forge -c nvidia  \
    rapids=24.06 python=3.11 cuda-version=12.2
pip install \
--extra-index-url=https://pypi.nvidia.com \
cudf-cu12==24.6.* \
dask-cudf-cu12==24.6.* \
cuml-cu12==24.6.* \
cugraph-cu12==24.6.*
COPY
conda create -n rapids-24.06 -c rapidsai -c conda-forge -c nvidia rapids=24.06 python=3.11 cuda-version=12.2
COPY
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
COPY
let allTextInputs = postForm[0].querySelectorAll('input:not([type="radio"]):not([type="checkbox"])');

let allRadioInputs = postForm[0].querySelectorAll('input:not([type="text"]):not([type="checkbox"])');

let allCheckBoxInputs = postForm[0].querySelectorAll('input:not([type="text"]):not([type="radio"])');

let allSelectTags = postForm[0].querySelectorAll('select[required]');

console.log(allTextInputs, allCheckBoxInputs, allRadioInputs, allSelectTags);
[
    {
        "$match": {
            "participantId": ObjectId("65c4d2bbd566b4251df9209f")
        }
    },
    {
        "$match": {
            "date": {
                "$gte": ISODate("2024-01-31T18:30:00Z"),
                "$lte": ISODate("2024-02-29T18:29:00Z")
            },
            "src": {
                "$ne": "manual"
            }
        }
    },
    {
        "$group": {
            "_id": "$participantId",
            "totalSteps": {
                "$sum": {
                    "$convert": {
                        "input": "$stepsTaken",
                        "to": "double",
                        "onError": 0,
                        "onNull": 0
                    }
                }
            }
        }
    },
    {
        "$project": {
            "_id": 0,
            "participantId": "$_id",
            "totalSteps": 1
        }
    }
]
// https://resource.dopus.com/t/set-metadata-track-title-and-artist-from-filename/48101

function OnClick(clickData) {
    var cmd = clickData.func.command;
    var tab = clickData.func.sourcetab;
    cmd.deselect = false;

    if (!tab.selected_files) return;

    for (var e = new Enumerator(tab.selected_files); !e.atEnd(); e.moveNext()) {
        var item = e.item();

        var name = item.name_stem;
        var name_track = name.replace(/(^[0-9]*)(.*)/, "$1");
        var name_title = name.replace(/(^[0-9\.\s]*)(.*)(\s-\s)(.*)/, "$2");
        var name_artist = name.replace(/(^[0-9\.\s]*)(.*)(\s-\s)(.*)/, "$4");

        cmd.RunCommand('SetAttr' +
            ' FILE="' + item + '"' +
            ' META "track:{dlgstring|Pista:|' + name_track + '}"');

        cmd.RunCommand('SetAttr' +
            ' FILE="' + item + '"' +
            ' META "title:{dlgstring|Título:|' + name_title + '}"');

        cmd.RunCommand('SetAttr' +
            ' FILE="' + item + '"' +
            ' META "artist:{dlgstring|Artista:|' + name_artist + '}"');

    }
}
           public:
    int findPlatform(int arr[], int dep[], int n)
    {
         sort ( arr,arr+n);sort ( dep , dep+n);
         int i=0;int j=0;int count=0,maxCount=0;
         while ( i<n&&j<n){
             if ( arr[i]<=dep[j]) 
             {count++;i++;}
             else 
             {count--;j++;}
             maxCount=max(count,maxCount);
         }
         return maxCount;
    }
};
  const books = [
    {
      title: 'Algorithms',
      author: ['Robert Sedgewick', 'Kevin Wayne'],
      publisher: 'Addison-Wesley Professional',
      publicationDate: '2011-03-24',
      edition: 4,
      keywords: [
        'computer science',
        'programming',
        'algorithms',
        'data structures',
        'java',
        'math',
        'software',
        'engineering',
      ],
      pages: 976,
      format: 'hardcover',
      ISBN: '9780321573513',
      language: 'English',
      programmingLanguage: 'Java',
      onlineContent: true,
      thirdParty: {
        goodreads: {
          rating: 4.41,
          ratingsCount: 1733,
          reviewsCount: 63,
          fiveStarRatingCount: 976,
          oneStarRatingCount: 13,
        },
      },
      highlighted: true,
    },
    {
      title: 'Structure and Interpretation of Computer Programs',
      author: [
        'Harold Abelson',
        'Gerald Jay Sussman',
        'Julie Sussman (Contributor)',
      ],
      publisher: 'The MIT Press',
      publicationDate: '2022-04-12',
      edition: 2,
      keywords: [
        'computer science',
        'programming',
        'javascript',
        'software',
        'engineering',
      ],
      pages: 640,
      format: 'paperback',
      ISBN: '9780262543231',
      language: 'English',
      programmingLanguage: 'JavaScript',
      onlineContent: false,
      thirdParty: {
        goodreads: {
          rating: 4.36,
          ratingsCount: 14,
          reviewsCount: 3,
          fiveStarRatingCount: 8,
          oneStarRatingCount: 0,
        },
      },
      highlighted: true,
    },
    {
      title: "Computer Systems: A Programmer's Perspective",
      author: ['Randal E. Bryant', "David Richard O'Hallaron"],
      publisher: 'Prentice Hall',
      publicationDate: '2002-01-01',
      edition: 1,
      keywords: [
        'computer science',
        'computer systems',
        'programming',
        'software',
        'C',
        'engineering',
      ],
      pages: 978,
      format: 'hardcover',
      ISBN: '9780130340740',
      language: 'English',
      programmingLanguage: 'C',
      onlineContent: false,
      thirdParty: {
        goodreads: {
          rating: 4.44,
          ratingsCount: 1010,
          reviewsCount: 57,
          fiveStarRatingCount: 638,
          oneStarRatingCount: 16,
        },
      },
      highlighted: true,
    },
    {
      title: 'Operating System Concepts',
      author: ['Abraham Silberschatz', 'Peter B. Galvin', 'Greg Gagne'],
      publisher: 'John Wiley & Sons',
      publicationDate: '2004-12-14',
      edition: 10,
      keywords: [
        'computer science',
        'operating systems',
        'programming',
        'software',
        'C',
        'Java',
        'engineering',
      ],
      pages: 921,
      format: 'hardcover',
      ISBN: '9780471694663',
      language: 'English',
      programmingLanguage: 'C, Java',
      onlineContent: false,
      thirdParty: {
        goodreads: {
          rating: 3.9,
          ratingsCount: 2131,
          reviewsCount: 114,
          fiveStarRatingCount: 728,
          oneStarRatingCount: 65,
        },
      },
    },
    {
      title: 'Engineering Mathematics',
      author: ['K.A. Stroud', 'Dexter J. Booth'],
      publisher: 'Palgrave',
      publicationDate: '2007-01-01',
      edition: 14,
      keywords: ['mathematics', 'engineering'],
      pages: 1288,
      format: 'paperback',
      ISBN: '9781403942463',
      language: 'English',
      programmingLanguage: null,
      onlineContent: true,
      thirdParty: {
        goodreads: {
          rating: 4.35,
          ratingsCount: 370,
          reviewsCount: 18,
          fiveStarRatingCount: 211,
          oneStarRatingCount: 6,
        },
      },
      highlighted: true,
    },
    {
      title: 'The Personal MBA: Master the Art of Business',
      author: 'Josh Kaufman',
      publisher: 'Portfolio',
      publicationDate: '2010-12-30',
      keywords: ['business'],
      pages: 416,
      format: 'hardcover',
      ISBN: '9781591843528',
      language: 'English',
      thirdParty: {
        goodreads: {
          rating: 4.11,
          ratingsCount: 40119,
          reviewsCount: 1351,
          fiveStarRatingCount: 18033,
          oneStarRatingCount: 1090,
        },
      },
    },
    {
      title: 'Crafting Interpreters',
      author: 'Robert Nystrom',
      publisher: 'Genever Benning',
      publicationDate: '2021-07-28',
      keywords: [
        'computer science',
        'compilers',
        'engineering',
        'interpreters',
        'software',
        'engineering',
      ],
      pages: 865,
      format: 'paperback',
      ISBN: '9780990582939',
      language: 'English',
      thirdParty: {
        goodreads: {
          rating: 4.7,
          ratingsCount: 253,
          reviewsCount: 23,
          fiveStarRatingCount: 193,
          oneStarRatingCount: 0,
        },
      },
    },
    {
      title: 'Deep Work: Rules for Focused Success in a Distracted World',
      author: 'Cal Newport',
      publisher: 'Grand Central Publishing',
      publicationDate: '2016-01-05',
      edition: 1,
      keywords: ['work', 'focus', 'personal development', 'business'],
      pages: 296,
      format: 'hardcover',
      ISBN: '9781455586691',
      language: 'English',
      thirdParty: {
        goodreads: {
          rating: 4.19,
          ratingsCount: 144584,
          reviewsCount: 11598,
          fiveStarRatingCount: 63405,
          oneStarRatingCount: 1808,
        },
      },
      highlighted: true,
    },
  ];




 function printBookAuthorsCount(title, ...authors) { // authors can be more than 1 param
    return `The book ${title} has ${authors.length} authors`;
  }

  const { title: book3Title, author: authors } = books[2];

  const bookAuthor = printBookAuthorsCount(
    book3Title,
    'Robert Sedgewick', //rest param 1
    'Kevin Wayne' //rest param 2
  );
  console.log(bookAuthor);
   int f(int ind,int target,vector<int>& a,vector<vector<int>>& dp)
   {
    int pick,nonPick;
      
      if(ind==0)
      {
        if(target%a[0]==0)
        return 1;
        else return 0;
      }
      if(dp[ind][target]!=-1)return dp[ind][target];
       nonPick = f(ind-1,target,a,dp);
       pick=0;
      if(a[ind]<=target)
        pick = f(ind,target-a[ind],a,dp);
      return dp[ind][target]=(pick+nonPick);
   }
    int change(int amount,vector<int>& coins) {
        int n = coins.size();
        vector<vector<int>> dp(n,vector<int>(amount+1,-1));
        return f(n-1,amount,coins,dp);
        
        
    }
   int f(int ind,int target,vector<int>& a,vector<vector<int>>& dp)
   {
    int pick,nonPick;
      
      if(ind==0)
      {
        if(target%a[0]==0)return target/a[0];
        else return INT_MAX;
      }
      if(dp[ind][target]!=-1)return dp[ind][target];
       nonPick = f(ind-1,target,a,dp);
       pick = 1e9;
      if(a[ind]<=target)
        pick = 1+f(ind,target-a[ind],a,dp);
      return dp[ind][target]=min(pick,nonPick);
   }
    int coinChange(vector<int>& coins, int amount) {
        int n = coins.size();
        vector<vector<int>> dp(n,vector<int>(amount+1,-1));
        int res =f(n-1,amount,coins,dp);
        return (res>=1e9)?-1:res;
        
    }
iwr -useb https://christitus.com/win | iex
   const testObj = {
    name: 'David',
    movie: 'fight club',
    active: true,
  };

  const testObj2 = {
    name: 'kevin',
    movie: 'Bladerunner',
    active: false,
  };



// using rest only
const combined = []; //empty array

  function makeArrayFromMUtipleObjects(...args) {
    for (let item of args) {
      // will have two separate objects
      combined.push(item); // push into the empty arry
    }
  }

  console.log(combined); 




// using rest and another param

 const anotherArray = [];

 function makeArray(array, ...itemsToAdd) {
    return array.concat(itemsToAdd);
  }

 const made = makeArray(anotherArray, testObj, testObj2);
 console.log(made);
x = 0

while(x < 10){

   print(x)
   x = x + 1

   if(x == 5){
   print(x)
   break
   }

}

vec <- c(1,2,3,4,5, 6, 8, 9, 10,100)
for(var in vec){
  print(var)

}


mat <- matrix(1:25, nrow=5)

print(mat)

#iterate by rows

for(row in 1:nrow(mat)){
  for(col in 1:ncol(mat)){
    print(paste('The element at row: ', row, 'and col: ', col, 'is', mat[row, col]))
  }

}

1:nrow(mat)

#Add the total for each column by iterating over each colomn

total.col1 <- 0
for(col in 1:ncol(mat)){
  for(row in 1:nrow(mat)){
    #print(paste('The element at col: ', col, 'and row: ', row, 'is', mat[row, col]))
    total.col1 <- total.col1 + mat[row, col]
    if(row == 5){
       print(paste('Total col ', col, ': ', total.col1))
       total.col1 <- 0  
    }
  }
}
//Controller
[HttpPost]
[DisableRequestSizeLimit]
[Route("Register")]
public async Task<IActionResult> Register([FromForm] UserViewModel uvm)
{
    try
    {
        var formCollection = await Request.ReadFormAsync();

        // Retrieves the first file from the form data, which is expected to be the user's photo.
        var photo = formCollection.Files.FirstOrDefault();

        // Attempts to find an existing user by the provided email.
        var user = await _userManager.FindByEmailAsync(uvm.Email);

        // If the user is not found, proceed with registration.
        if (user == null)
        {
            // Uses a memory stream to process the photo file.
            using (var memoryStream = new MemoryStream())
            {
                // Copies the photo file data into the memory stream asynchronously.
                await photo.CopyToAsync(memoryStream);

                // Converts the memory stream data into a byte array.
                var fileBytes = memoryStream.ToArray();

                // Encodes the byte array to a base64 string.
                string base64Image = Convert.ToBase64String(fileBytes);

                // Creates a new user object with the provided details and hashed password.
                user = new User
                {
                    UserName = uvm.Email,
                    Email = uvm.Email,
                    PasswordHash = _userManager.PasswordHasher.HashPassword(null, uvm.Password),
                    Photo = base64Image // Stores the base64 string in the user's profile.
                };

                // Attempts to create the new user asynchronously.
                IdentityResult result = await _userManager.CreateAsync(user);

                // If the user creation is successful, return a success response.
                if (result.Succeeded)
                {
                    return Ok(new { Status = "Success", Message = "User created successfully!" });
                }
                // If user creation fails, return an error response with the first error message.
                else
                {
                    return StatusCode(StatusCodes.Status500InternalServerError, result.Errors.FirstOrDefault()?.Description);
                }
            }
        }
        // If the user already exists, return a forbidden response.
        else
        {
            return Forbid("Account already exists.");
        }
    }
    catch (Exception ex)
    {
        // If an exception occurs, return a generic error response.
        return StatusCode(StatusCodes.Status500InternalServerError, "An error occurred while processing your request.");
    }
}

//program cs
// Configure FormOptions for file uploads
builder.Services.Configure<FormOptions>(o =>
{
    o.ValueLengthLimit = int.MaxValue;
    o.MultipartBodyLengthLimit = int.MaxValue;
    o.MemoryBufferThreshold = int.MaxValue;
});
x = 0

while(x < 10){

   print(x)
   x = x + 1

   if(x == 5){
   print(x)
   break
   }

}
.nav-link-text{
font-size: 20px
}
$parent = "C:\Users\user\Desktop\derp"
$pl = $parent.Length
$dest = "C:\Users\user\Desktop\test"
$empty = get-childitem $parent -recurse | 
Where-Object { $_.PSIsContainer } |   
Where-Object { $_.GetFiles().Count -eq 0 } |   
Where-Object { $_.GetDirectories().Count -eq 0 } |    
ForEach-Object { $_.FullName }  

foreach ($item in $empty) {
Write-Host $item
$object= Get-Item $item
      if($object.parent.fullname.length -gt $pl){
                
                $OParentPath = $object.FullName
                $last = $OParentPath.Substring($pl)
                $newDest = $dest+$last
                mkdir -Path $newDest
                Remove-Item $item

                }
      Else{Move-Item $item -Destination $dest}

      }
    
  
get-childitem "Q:\Data\" -recurse | 
Where-Object { $_.PSIsContainer } |   
Where-Object { $_.GetFiles().Count -eq 0 } |   
Where-Object { $_.GetDirectories().Count -eq 0 } |    
ForEach-Object { $_.FullName } |   
Out-File -FilePath C:\Users\user\Desktop\results.txt
star

Sat Jun 22 2024 14:53:33 GMT+0000 (Coordinated Universal Time)

@Xeno_SSY #c++

star

Sat Jun 22 2024 14:41:20 GMT+0000 (Coordinated Universal Time) https://zazloo.ru/7-9-pokolenie-python/

@qwdixq

star

Sat Jun 22 2024 14:20:00 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Sat Jun 22 2024 12:30:34 GMT+0000 (Coordinated Universal Time)

@mehran

star

Sat Jun 22 2024 12:30:00 GMT+0000 (Coordinated Universal Time)

@mehran

star

Sat Jun 22 2024 07:46:12 GMT+0000 (Coordinated Universal Time)

@NoFox420 #css

star

Sat Jun 22 2024 06:58:31 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Sat Jun 22 2024 05:56:36 GMT+0000 (Coordinated Universal Time) undefined

@swatijaan

star

Sat Jun 22 2024 05:27:36 GMT+0000 (Coordinated Universal Time) https://chatgpt.com/c/98ef9070-97c0-43e1-b062-8f76a88a78d2

@codeplugin

star

Sat Jun 22 2024 03:37:16 GMT+0000 (Coordinated Universal Time) https://www.javatpoint.com/java-list

@iyan #java

star

Sat Jun 22 2024 03:34:45 GMT+0000 (Coordinated Universal Time) https://www.javatpoint.com/java-list

@iyan #java

star

Sat Jun 22 2024 03:25:42 GMT+0000 (Coordinated Universal Time)

@NoFox420 #css

star

Sat Jun 22 2024 02:36:11 GMT+0000 (Coordinated Universal Time)

@NoFox420 #css

star

Sat Jun 22 2024 00:10:22 GMT+0000 (Coordinated Universal Time) Created

@MathewC84

star

Fri Jun 21 2024 22:47:49 GMT+0000 (Coordinated Universal Time)

@NoFox420 #css

star

Fri Jun 21 2024 22:34:10 GMT+0000 (Coordinated Universal Time)

@davidmchale #for #loop #index

star

Fri Jun 21 2024 22:15:29 GMT+0000 (Coordinated Universal Time)

@NoFox420 #css

star

Fri Jun 21 2024 18:49:55 GMT+0000 (Coordinated Universal Time) https://www.pynerds.com/12-builtin-modules-every-python-developer-must-try/

@pynerds #python

star

Fri Jun 21 2024 15:57:58 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2227062/how-do-i-move-a-git-branch-out-into-its-own-repository

@goldenfoot

star

Fri Jun 21 2024 15:23:10 GMT+0000 (Coordinated Universal Time) https://coptr.digipres.org/index.php/TrID_File_Identifier

@baamn

star

Fri Jun 21 2024 15:20:11 GMT+0000 (Coordinated Universal Time) https://mark0.net/soft-trid-e.html

@baamn #trid #verbose

star

Fri Jun 21 2024 15:19:19 GMT+0000 (Coordinated Universal Time) https://mark0.net/soft-trid-e.html

@baamn #trid #extension

star

Fri Jun 21 2024 15:17:53 GMT+0000 (Coordinated Universal Time) https://mark0.net/soft-trid-e.html

@baamn #trid #wildcard

star

Fri Jun 21 2024 10:39:40 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024 #deluge

star

Fri Jun 21 2024 10:16:16 GMT+0000 (Coordinated Universal Time)

@Ranjith

star

Fri Jun 21 2024 07:41:40 GMT+0000 (Coordinated Universal Time)

@mry2khuu #c# #shopsystem #json

star

Fri Jun 21 2024 05:52:51 GMT+0000 (Coordinated Universal Time) https://docs.rapids.ai/install?_gl

@curtisbarry

star

Fri Jun 21 2024 05:44:56 GMT+0000 (Coordinated Universal Time) https://rapids.ai/

@curtisbarry

star

Fri Jun 21 2024 05:44:50 GMT+0000 (Coordinated Universal Time) https://rapids.ai/

@curtisbarry

star

Fri Jun 21 2024 05:44:41 GMT+0000 (Coordinated Universal Time) https://rapids.ai/

@curtisbarry

star

Fri Jun 21 2024 05:25:13 GMT+0000 (Coordinated Universal Time)

@gagan_darklion #javascript

star

Fri Jun 21 2024 04:26:48 GMT+0000 (Coordinated Universal Time) http://34.74.16.180:3000/question#eyJkYXRhc2V0X3F1ZXJ5Ijp7InR5cGUiOiJuYXRpdmUiLCJuYXRpdmUiOnsiY29sbGVjdGlvbiI6InN0ZXBzIiwicXVlcnkiOiJbXHJcbiAgICB7XHJcbiAgICAgICAgXCIkbWF0Y2hcIjoge1xyXG4gICAgICAgICAgICBcInBhcnRpY2lwYW50SWRcIjogT2JqZWN0SWQoXCI2NWM0ZDJiYmQ1NjZiNDI1MWRmOTIwOWZcIilcclxuICAgICAgICB9XHJcbiAgICB9LFxyXG4gICAge1xyXG4gICAgICAgIFwiJG1hdGNoXCI6IHtcclxuICAgICAgICAgICAgXCJkYXRlXCI6IHtcclxuICAgICAgICAgICAgICAgIFwiJGd0ZVwiOiBJU09EYXRlKFwiMjAyNC0wMS0zMVQxODozMDowMFpcIiksXHJcbiAgICAgICAgICAgICAgICBcIiRsdGVcIjogSVNPRGF0ZShcIjIwMjQtMDItMjlUMTg6Mjk6MDBaXCIpXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIFwic3JjXCI6IHtcclxuICAgICAgICAgICAgICAgIFwiJG5lXCI6IFwibWFudWFsXCJcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICB7XHJcbiAgICAgICAgXCIkZ3JvdXBcIjoge1xyXG4gICAgICAgICAgICBcIl9pZFwiOiBcIiRwYXJ0aWNpcGFudElkXCIsXHJcbiAgICAgICAgICAgIFwidG90YWxTdGVwc1wiOiB7XHJcbiAgICAgICAgICAgICAgICBcIiRzdW1cIjoge1xyXG4gICAgICAgICAgICAgICAgICAgIFwiJGNvbnZlcnRcIjoge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBcImlucHV0XCI6IFwiJHN0ZXBzVGFrZW5cIixcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCJ0b1wiOiBcImRvdWJsZVwiLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBcIm9uRXJyb3JcIjogMCxcclxuICAgICAgICAgICAgICAgICAgICAgICAgXCJvbk51bGxcIjogMFxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICB7XHJcbiAgICAgICAgXCIkcHJvamVjdFwiOiB7XHJcbiAgICAgICAgICAgIFwiX2lkXCI6IDAsXHJcbiAgICAgICAgICAgIFwicGFydGljaXBhbnRJZFwiOiBcIiRfaWRcIixcclxuICAgICAgICAgICAgXCJ0b3RhbFN0ZXBzXCI6IDFcclxuICAgICAgICB9XHJcbiAgICB9XHJcbl1cclxuIiwidGVtcGxhdGUtdGFncyI6e319LCJkYXRhYmFzZSI6Mn0sImRpc3BsYXkiOiJ0YWJsZSIsInZpc3VhbGl6YXRpb25fc2V0dGluZ3MiOnt9fQ==

@CodeWithSachin #aggregation #mongodb #$converter

star

Fri Jun 21 2024 02:03:01 GMT+0000 (Coordinated Universal Time) https://resource.dopus.com/t/set-metadata-track-title-and-artist-from-filename/48101

@baamn

star

Fri Jun 21 2024 00:28:39 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/problems/minimum-platforms-1587115620/1

@devdutt

star

Fri Jun 21 2024 00:02:46 GMT+0000 (Coordinated Universal Time)

@davidmchale #functions #...args #rest

star

Thu Jun 20 2024 23:24:01 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Thu Jun 20 2024 23:21:11 GMT+0000 (Coordinated Universal Time)

@ayushg103 #c++

star

Thu Jun 20 2024 23:17:55 GMT+0000 (Coordinated Universal Time) https://christitus.com/windows-tool/

@amtilts

star

Thu Jun 20 2024 23:17:24 GMT+0000 (Coordinated Universal Time)

@davidmchale #functions #...args #rest

star

Thu Jun 20 2024 20:42:52 GMT+0000 (Coordinated Universal Time) https://rdrr.io/snippets/

@jkirangw

star

Thu Jun 20 2024 17:31:11 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Thu Jun 20 2024 17:18:20 GMT+0000 (Coordinated Universal Time) https://rdrr.io/snippets/

@jkirangw

star

Thu Jun 20 2024 13:12:33 GMT+0000 (Coordinated Universal Time)

@iamkatmakhafola

star

Thu Jun 20 2024 13:12:11 GMT+0000 (Coordinated Universal Time) https://www.blockchainx.tech/ai-meme-coin-development-company/

@blockchainxtech #aimemecoin #aimemecoindevelopment

star

Thu Jun 20 2024 13:11:02 GMT+0000 (Coordinated Universal Time) https://www.blockchainx.tech/solana-meme-coin-development/

@blockchainxtech #memecoin #solons #solonsmemecoin

star

Thu Jun 20 2024 13:09:16 GMT+0000 (Coordinated Universal Time) https://www.blockchainx.tech/web3-development-company/

@blockchainxtech #web3 #web3developmentcompany #web3developmentservices #web3developmentsolutions

star

Thu Jun 20 2024 11:38:04 GMT+0000 (Coordinated Universal Time)

@Promakers2611

star

Thu Jun 20 2024 09:12:43 GMT+0000 (Coordinated Universal Time) https://community.spiceworks.com/t/powershell-move-folders-from-txt-file-to-another-drive-with-dir-structure/715354

@baamn #powershell

star

Thu Jun 20 2024 09:10:21 GMT+0000 (Coordinated Universal Time) https://community.spiceworks.com/t/powershell-move-folders-from-txt-file-to-another-drive-with-dir-structure/715354

@baamn

star

Thu Jun 20 2024 08:03:33 GMT+0000 (Coordinated Universal Time) https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-profile-lookup/18259

@rahulk

Save snippets that work with our extensions

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