Snippets Collections
class F
{
    public static void main(String[] args){
        try
        {
            int a=10,b=0,c;
            c=a/b;
            System.out.println(c);
        }
        catch(Exception a)
        {
            
            System.out.println("error found ");
        }
        try
        {
            int a[] ={10,20,30};
            System.out.println(a[3]);
        }
        catch(ArrayIndexOutOfBoundsException b)
        {
            System.out.println("error found ");
        }
        
        
    }
}
Hill climbing algorithm is a local search algorithm which continuously moves in the direction of increasing elevation/value to find the peak of the mountain or best solution to the problem. It terminates when it reaches a peak value where no neighbor has a higher value.
Hill climbing algorithm is a technique which is used for optimizing the mathematical problems. One of the widely discussed examples of Hill climbing algorithm is Traveling-salesman Problem in which we need to minimize the distance traveled by the salesman.
It is also called greedy local search as it only looks to its good immediate neighbor state and not beyond that.
A node of hill climbing algorithm has two components which are state and value.
Hill Climbing is mostly used when a good heuristic is available.
In this algorithm, we don't need to maintain and handle the search tree or graph as it only keeps a single current state.

Algorithm for Simple Hill Climbing:
Step 1: Evaluate the initial state, if it is goal state then return success and Stop.
Step 2: Loop Until a solution is found or there is no new operator left to apply.
Step 3: Select and apply an operator to the current state.
Step 4: Check new state:
If it is goal state, then return success and quit.
Else if it is better than the current state then assign new state as a current state.
Else if not better than the current state, then return to step2.
Step 5: Exit.

Problems in Hill Climbing Algorithm:
1. Local Maximum: A local maximum is a peak state in the landscape which is better than each of its neighboring states, but there is another state also present which is higher than the local maximum.

Solution: Backtracking technique can be a solution of the local maximum in state space landscape. Create a list of the promising path so that the algorithm can backtrack the search space and explore other paths as well.

Hill Climbing Algorithm in AI
2. Plateau: A plateau is the flat area of the search space in which all the neighbor states of the current state contains the same value, because of this algorithm does not find any best direction to move. A hill-climbing search might be lost in the plateau area.

Solution: The solution for the plateau is to take big steps or very little steps while searching, to solve the problem. Randomly select a state which is far away from the current state so it is possible that the algorithm could find non-plateau region.

Hill Climbing Algorithm in AI
3. Ridges: A ridge is a special form of the local maximum. It has an area which is higher than its surrounding areas, but itself has a slope, and cannot be reached in a single move.

Solution: With the use of bidirectional search, or by moving in different directions, we can improve this problem.

Hill Climbing Algorithm in AI
class D
{
    public static void main(String[] args){
        
        try
        {
            int a=10,b=2,c;
            c=a/b;
            System.out.println(c);
        }
        catch(Exception a)
        {
            System.out.println("Any error found");
        }
        finally
        {
            System.out.println("no error found");
        }
        System.out.println("system ended");
    }
}
nileshdev0707@gmail.com
pass:-qwerty123
SELECT Products.ProductName,COUNT(OrderDetails.OrderDetailID) AS NumberOfOrders FROM OrderDetails
LEFT JOIN Products ON Products.ProductID = OrderDetails.ProductID
GROUP BY ProductName;

10:44:51.[952613]	>>	 

10:44:51.[962614]	>>	======================================================================

10:44:51.[962614]	>>	                                 SEARCHING FOR BARCODE: [240116032002]

10:44:51.[972615]	>>	======================================================================

10:44:51.[982615]	>>	 

10:44:52.[002616]	>>	 

10:44:52.[002616]	>>	======================================================================

10:44:52.[012618]	>>	         SEND DATA TO ANALYZER: [771D48E8-EEF1-4CB5-9809-67DA55A909F2]

10:44:52.[022618]	>>	======================================================================

10:44:52.[032619]	>>	 

10:44:52.[142625]	>>	S:	<VT>MSH|^~\&|||||20240116104452||QCK^Q02|49|P|2.3.1||||||ASCII|||<CR>MSA|AA|49|order<SP>accepted.|||0|<CR>ERR|0|<CR>QAK|SR|OK|<CR><FS><CR>

10:44:52.[152627]	>>	 

10:44:52.[162627]	>>	======================================================================

10:44:52.[172627]	>>	         SEND DATA TO ANALYZER: [771D48E8-EEF1-4CB5-9809-67DA55A909F2]

10:44:52.[172627]	>>	======================================================================

10:44:52.[182629]	>>	 

10:44:52.[312637]	>>	S:	<VT>MSH|^~\&|||||20240116104452||DSR^Q03|49|P|2.3.1||||||ASCII|||<CR>MSA|AA|49|order<SP>information.|||0|<CR>ERR|0|<CR>QAK|SR|OK|<CR>QRD|20240116104452|R|D|49|||RD|240116032002|OTH|||T|<CR>QRF||||||RCT|COR|ALL||<CR>DSP|1||2565011461|||<CR>DSP|2|||||<CR>DSP|3||นส.<SP>วรรณนิศา<SP>วรสินวิวัฒน์|||<CR>DSP|4||19891228000000|||<CR>DSP|5||F|||<CR>DSP|6|||||<CR>DSP|7|||||<CR>DSP|8|||||<CR>DSP|9|||||<CR>DSP|10|||||<CR>DSP|11|||||<CR>DSP|12|||||<CR>DSP|13|||||<CR>DSP|14|||||<CR>DSP|15|||||<CR>DSP|16|||||<CR>DSP|17|||||<CR>DSP|18|||||<CR>DSP|19|||||<CR>DSP|20|||||<CR>DSP|21||240116032002|||<CR>DSP|22|||||<CR>DSP|23||20240116104452|||<CR>DSP|24||N|||<CR>DSP|25|||||<CR>DSP|26||Serum|||<CR>DSP|27|||||<CR>DSP|28||ผู้ป่วยนอก|||<CR>DSP|29||FT3|||<CR>DSP|30||TSH|||<CR>DSC||<CR><FS><CR>

10:44:52.[422644]	>>	 




#####
#####

11:28:59.[428298]	>>	R:	<VT>MSH|^~\&|||||20240116113214||ORU^R01|60|P|2.3.1||||0||ASCII|||<CR>PID|24|2565011461|||นส.<SP>วรรณนิศา<SP>วรสินวิวัฒน์|||F|||ผู้ป่วยนอก||||||||||||||||||||<CR>OBR|24|240116032002|25|^|N|20240116104807|20240116104807|20240116104807||1^28||||20240116104807|Serum||ผู้ป่วยนอก||||||||5|||||||||||||||||||||||<CR>OBX|1|NM|FT3|FT3|3.66|pg/mL|-|N|||F||3.660317|20240116113214|||0|<CR><FS><CR>

11:28:59.[438299]	>>	 

11:28:59.[438299]	>>	======================================================================

11:28:59.[448301]	>>	         SEND DATA TO ANALYZER: [B4334B09-2A52-4FDA-AC32-DF924254F00A]

11:28:59.[458301]	>>	======================================================================

11:28:59.[468302]	>>	 

11:28:59.[578307]	>>	S:	<VT>MSH|^~\&|||||20240116112859||ACK^R01|60|P|2.3.1||||0||ASCII|||<CR>MSA|AA|60|get<SP>result.|||0|<CR><FS><CR>

11:28:59.[588309]	>>	 

11:28:59.[598310]	>>	======================================================================

11:28:59.[608310]	>>	SAVE DATA TO LIS: [240116032002] - [B4334B09-2A52-4FDA-AC32-DF924254F00A]

11:28:59.[608310]	>>	======================================================================

11:28:59.[618311]	>>	 

11:28:59.[648312]	>>	Insert LN: 2401160320 Barcode: 240116032002 Anacode: FT3 Test Code: CH059 Result: 3.66 Status:  Result Flag: - complete!!!

11:41:50.[978888]	>>	 




State space search is a problem-solving technique used in Artificial Intelligence (AI) to find the solution path from the initial state to the goal state by exploring the various states. The state space search approach searches through all possible states of a problem to find a solution. It is an essential part of Artificial Intelligence and is used in various applications, from game-playing algorithms to natural language processing.

State space search has several features that make it an effective problem-solving technique in Artificial Intelligence. These features include:

Exhaustiveness:
State space search explores all possible states of a problem to find a solution.

Completeness:
If a solution exists, state space search will find it.

Optimality:
Searching through a state space results in an optimal solution.

Uninformed and Informed Search:
State space search in artificial intelligence can be classified as uninformed if it provides additional information about the problem.

In contrast, informed search uses additional information, such as heuristics, to guide the search process.

digram from nb
class D
{
    public static void main(String[] args){
    String str="heavy";
    
    try
    {
        int a=Integer.parseInt(str);
        System.out.println("error not found");
    }
   catch(NumberFormatException n)
   {
       System.out.println("error found");
   }
   System.out.println("system ended ");
} 
}
$data = DB::table('MASTER_TABLE_NAME as r')
        ->select('r.*')
        ->whereExists(function ($query) {
            $query->select(DB::raw(1))
                ->from('CHILD_TABLE_NAME')
                ->whereRaw('CHILD_TABLE_NAME.ORDER_NO = MASTER_TABLE_NAME.ORDER_NO')
                ->whereRaw('CHILD_TABLE_NAME.PRDMD_NO <> 0'); //This means not equal to 0 use = if  															  //you want equal value
        })
        ->where('r.UNIT_NO', $org_id)
        ->where('r.PM_ID', $_SESSION['section']);
class D
{
    public static void main(String[] args){
        String a= null;
        
        try
        {
            System.out.print(a.toUpperCase());
            System.out.print("error not found");
            
        }
        catch(NullPointerException n )
        {
            System.out.print("error found");
        }
        
        
} 
}
Algorithm: Unify(Ψ1, Ψ2)

Step. 1: If Ψ1 or Ψ2 is a variable or constant, then:
	a) If Ψ1 or Ψ2 are identical, then return NIL. 
	b) Else if Ψ1is a variable, 
		a. then if Ψ1 occurs in Ψ2, then return FAILURE
		b. Else return { (Ψ2/ Ψ1)}.
	c) Else if Ψ2 is a variable, 
		a. If Ψ2 occurs in Ψ1 then return FAILURE,
		b. Else return {( Ψ1/ Ψ2)}. 
	d) Else return FAILURE. 
Step.2: If the initial Predicate symbol in Ψ1 and Ψ2 are not same, then return FAILURE.
Step. 3: IF Ψ1 and Ψ2 have a different number of arguments, then return FAILURE.
Step. 4: Set Substitution set(SUBST) to NIL. 
Step. 5: For i=1 to the number of elements in Ψ1. 
	a) Call Unify function with the ith element of Ψ1 and ith element of Ψ2, and put the result into S.
	b) If S = failure then returns Failure
	c) If S ≠ NIL then do,
		a. Apply S to the remainder of both L1 and L2.
		b. SUBST= APPEND(S, SUBST). 
Step.6: Return SUBST. 
class D
{
    public static void main(String[] args){
        int a=10,b=0,c;
        System.out.println("started ");
        try{
            c=a+b;
            System.out.println("sum will be "+c);
            System.out.println("no error found ");
        }
        catch(Exception e)
        {
            System.out.println("error founded");
        }
        System.out.println("ended");
    }
}
class D
{
    public static void main(String[] args ){
        System.out.println("Started ");
        int a=10,b=0,c;
        try{
            c=a/b;
        }
        catch(Exception e )
        {
            System.out.println("any errror found");
        }
        System.out.println("ended");
    }
}
Knowledge representation and reasoning (KR, KRR) is the part of Artificial intelligence for representing information about the real world so that a computer can understand and can utilize this knowledge to solve the complex real world problems such as diagnosis a medical condition or communicating with humans in natural language.It is also a way which describes how we can represent knowledge in artificial intelligence. Knowledge representation is not just storing data into some database, but it also enables an intelligent machine to learn from that knowledge and experiences so that it can behave intelligently like a human.

Knowledge representation has two entities : 
Facts: Facts are the truth in some relevant world. 
Representation : Representation is the presentation of facts in some chosen formalism. 
For example: 
Fact : Charlie is a dog. 
Representation of fact using mathematical logic : Dog (Charlie) 
app/layout.tsx
✅ copied
Copy
import { YouTubeEmbed } from '@next/third-parties/google'

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body>{children}</body>
      <YouTubeEmbed videoid="ogfYd705cRs" height={400} params="controls=0" />
    </html>
  )
}
app/sitemap.ts
✅ copied
Copy
import { MetadataRoute } from 'next'

export default function sitemap(): MetadataRoute.Sitemap {
  return [
    {
      url: 'https://acme.com',
      lastModified: new Date(),
      changeFrequency: 'yearly',
      priority: 1,
    },
    {
      url: 'https://acme.com/blog',
      lastModified: new Date(),
      changeFrequency: 'weekly',
      priority: 0.5,
    },
  ]
}
When based on available data a decision is taken then the process is called as Forward chaining.	Backward chaining starts from the goal and works backward to determine what facts must be asserted so that the goal can be achieved.
2.	Forward chaining is known as data-driven technique because we reaches to the goal using the available data.	Backward chaining is known as goal-driven technique because we start from the goal and reaches the initial state in order to extract the facts.
3.	It is a bottom-up approach.	It is a top-down approach.
4.	It applies the Breadth-First Strategy.	It applies the Depth-First Strategy.
5.	Its goal is to get the conclusion.	Its goal is to get the possible facts or the required data.
6.	Slow as it has to use all the rules.	Fast as it has to use only a few rules.
7.	It operates in forward direction i.e it works from initial state to final decision.	It operates in backward direction i.e it works from goal to reach initial state.
8.	Forward chaining is used for the planning, monitoring, control, and interpretation application.	It is used in automated inference engines, theorem proofs, proof assistants and other artificial intelligence applications.
Forward chaining is a form of reasoning which start with atomic sentences in the knowledge base and applies inference rules (Modus Ponens) in the forward direction to extract more data until a goal is reached.

The Forward-chaining algorithm starts from known facts, triggers all rules whose premises are satisfied, and add their conclusion to the known facts. This process repeats until the problem is solved.

Properties of Forward-Chaining:

It is a down-up approach, as it moves from bottom to top.

It is a process of making a conclusion based on known facts or data, by starting from the initial state and reaches the goal state.

Forward-chaining approach is also called as data-driven as we reach to the goal using available data.

Forward -chaining approach is commonly used in the expert system, such as CLIPS, business, and production rule systems.

For example, suppose that the goal is to conclude the colour of my pet 
Bruno given that he croaks and eats flies, and that the rule base contains 
the following two rules :  
If X croaks and eats flies - Then X is a frog. 
If X is a frog - Then X is red. 





Backward Chaining
A backward chaining algorithm is a form of reasoning, which starts with the goal and works backward, chaining through rules to find known facts that support the goal.

Properties of backward chaining-
  
It is known as a top-down approach.

Backward-chaining is based on modus ponens inference rule.

In backward chaining, the goal is broken into sub-goal or sub-goals to prove the facts true.

It is called a goal-driven approach, as a list of goals decides which rules are selected and used.

Backward -chaining algorithm is used in game theory, automated theorem proving tools, inference engines, proof assistants, and various AI applications.

e backward-chaining method mostly used a depth-first search strategy for proof.
Direct MTApproach 
The Direct Translation approach works by translating the source language directly into the target language, without any intermediate representation. This method often operates at the word or phrase level, using dictionaries and rules to handle lexical, morphological, and syntactic differences between languages. While this approach can result in speedy translations, it can also lead to inaccuracies and difficulties in coping with complex language structures.

Transfer Approach
The Transfer-Based Translation approach involves converting the source language into an intermediate representation that captures its syntactic and semantic structure. This intermediate representation is then used to generate a translation in the target language, subsequently processed through linguistic rules and transformations. Although typically more computationally expensive than direct translation, transfer-based translation can produce higher-quality translations by preserving the structure and meaning of the source text.

Interlingua approach
Lastly, the Interlingua-Based Translation approach translates the source language into an abstract, language-independent representation called "interlingua." The target language translation is then generated from the interlingua. This approach is advantageous for multilingual translation scenarios, as only two translation steps are needed between any pair of languages. However, creating a comprehensive interlingua that can express different language structures accurately is a challenging task.
FROM php:8.2-fpm

# Arguments defined in docker-compose.yml
ARG user
ARG uid

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    curl \
    libpng-dev \
    libonig-dev \
    libxml2-dev \
    libzip-dev \
    zip \
    unzip \
    && docker-php-ext-install zip

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

# Create system user to run Composer and Artisan Commands
RUN useradd -G www-data,root -u $uid -d /home/$user $user
RUN mkdir -p /home/$user/.composer && \
    chown -R $user:$user /home/$user

# Set working directory
WORKDIR /var/www

USER $user
 docker exec -it -u 0 6899f3bfdc70056d5bedc8502bd28bb71afd71f7e8ecc6b0f0d9c9496ac6546d bash
 
 # It is the -u 0 that allows you in as a root user
 docker exec -it -u 0 6899f3bfdc70056d5bedc8502bd28bb71afd71f7e8ecc6b0f0d9c9496ac6546d bash
 
 # It is the -u 0 that allows you in as a root user
COMPOSER_PROCESS_TIMEOUT=20000 composer install
Machine translation (MT) is the use of algorithms and artificial intelligence to automatically convert text or speech from one language to another.

In a machine translation task, the input already consists of a sequence of symbols in some language, and the computer program must convert this into a sequence of symbols in another language.

Lexical Analysis and Morphological-
The first phase of NLP is the Lexical Analysis. This phase scans the source code as a stream of characters and converts it into meaningful lexemes. It divides the whole text into paragraphs, sentences, and words.

Syntactic Analysis (Parsing)
Syntactic Analysis is used to check grammar, word arrangements, and shows the relationship among the words.
Example: Agra goes to the Poonam
In the real world, Agra goes to the Poonam, does not make any sense, so this sentence is rejected by the Syntactic analyzer.

Semantic Analysis
Semantic analysis is concerned with the meaning representation. It mainly focuses on the literal meaning of words, phrases, and sentences.

Discourse integration
Discourse describes communication between 2 or more individuals. Discourse integration analyzes prior words and sentences to understand the meaning of ambiguous language.

Pragmatic analysis
Pragmatic analysis attempts to derive the intended—not literal—meaning of language.
Spam Filters: One of the most irritating things about email is spam. Gmail uses natural language processing (NLP) to discern which emails are legitimate and which are spam.

Algorithmic Trading: Algorithmic trading is used for predicting stock market conditions. Using NLP, this technology examines news headlines about companies and stocks and attempts to comprehend their meaning in order to determine if you should buy, sell, or hold certain stocks.

Questions Answering: NLP can be seen in action by using Google Search or Siri Services. A major use of NLP is to make search engines understand the meaning of what we are asking and generate natural language in return to give us the answers.

Summarizing Information: On the internet, there is a lot of information, and a lot of it comes in the form of long documents or articles. NLP is used to decipher the meaning of the data and then provides shorter summaries of the data so that humans can comprehend it more quickly.

Chatbots
Chatbots are a form of artificial intelligence that are programmed to interact with humans in such a way that they sound like humans themselves. Chatbots are created using Natural Language Processing and Machine Learning.

Language Translator-
Google Translate and other translation tools as well as use Sequence to sequence modeling that is a technique in Natural Language Processing. It allows the algorithm to convert a sequence of words from one language to another which is translation.

Sentiment Analysis-
Companies use natural language processing,to understand the general sentiment of the users for their products and services and find out if the sentiment is good, bad, or neutral. 
Natural Language Processing (NLP) is a subfield of artificial intelligence that deals with the interaction between computers and humans in natural language.

It involves the use of computational techniques to process and analyze natural language data, such as text and speech, with the goal of understanding the meaning behind the language.

NLP is used in a wide range of applications, including machine translation, sentiment analysis, speech recognition, chatbots, and text classification. 

The field is divided into  three different parts:

Speech Recognition — The translation of spoken language into text.
Natural Language Understanding (NLU)  — The computer’s ability to understand what we say.
Natural Language Generation  (NLG) — The generation of natural language by a computer.

NLU and NLG are the key aspects depicting the working of NLP devices
Information Extraction (IE) is a natural language processing (NLP) technique that involves automatically extracting structured information from unstructured text.

Information extraction is the technique of creating database entries. 

The goal of information extraction is to transform raw textual data into useful information by identifying and extracting specific pieces of information, such as entities, relationships, and events.

The field such as street, city, state, pin-code are extracted from instances of addresses from web pages. 

The instance of weather report with temperature, wind, speed, humidity are extracted. 

Information retrieval systems and full text parser can be mapped by mid system called information extraction. 

Information retrieval (IR) is the process of obtaining relevant information from a large repository or database. This retrieval is based on a user's query or information need. The goal of information retrieval is to efficiently and effectively locate and deliver information that is relevant to the user's request.
For example, information retrieval is widely used in popular search engine like Google, Yahoo, Bing etc. 

Here are the key characteristics of information retrieval:
Content Organization:
IR systems organize and index vast amounts of data or documents for efficient and effective retrieval.

Query Processing:
IR systems process user queries, which can be expressed in various formats, ranging from simple keyword queries to complex Boolean expressions or natural language queries.

Relevance Ranking:
Results are ranked based on their relevance to the user's query. Various algorithms and ranking models are employed to determine the order in which results are presented to the user.

Scalability:
IR systems are designed to handle large and diverse datasets. They should be scalable to accommodate growing volumes of data without compromising performance.

Information Retrieval Models:
Different IR models, such as Boolean model, Vector Space model, and Probabilistic model, define how documents are represented and how relevance is assessed.
In multi-agent systems (MAS), negotiation and bargaining are essential mechanisms that enable autonomous agents to interact, make joint decisions, and coordinate their activities. These processes are crucial for resolving conflicts, reaching agreements, and achieving collective goals in a distributed and decentralized environment. 

Negotiation is the process by which agents communicate and exchange information to reach mutually acceptable agreements. It involves a series of interactions where agents propose, counter-propose, and modify their positions until an agreement is reached or the negotiation is terminated.

Types of Negotiation:

Distributive Negotiation: Agents engage in distributive negotiation when there is a fixed amount of resources to be divided among them. This type often involves zero-sum games, where one agent's gain is another agent's loss.

Integrative Negotiation: Integrative negotiation aims to create value by identifying opportunities for mutually beneficial agreements. Agents work together to find solutions that maximize joint benefits.

Bargaining:

Definition: Bargaining is a subset of negotiation that specifically focuses on the process of reaching agreements by making offers, counteroffers, and concessions. 

Any negotiation and bargaining mechanism should have the following attributes: 

Efficiency: Negotiating should be done without wasting a lot of time or resources.

Stability: Once an agreement is made, no one should want to back out because it benefits everyone involved.

Simplicity: The negotiation process should be easy to understand and not too complicated to follow.

Distribution: No single person should have all the power; decisions should be made by everyone involved.

Symmetry: Everyone should be treated fairly, and the process should not favor one person over another without good reason.
In multiagent systems (MAS), agents interact with each other to achieve individual and collective goals. Arguments in this context refer to the communication and negotiation mechanisms used by agents to exchange information, reach agreements, and make decisions. These arguments can take various forms and play a crucial role in resolving conflicts, sharing knowledge, and coordinating actions among autonomous agents. 

Agents put forth claims or propositions during interactions. These claims represent a position or statement that an agent asserts as true or desirable.

There are types of arguments as described below,
(a) Informational arguments: (Beliefs->Belief format) e.g. If it is cloudy, it might rain.
(b) Motivational arguments: (Beliefs, desires->Desire format) e.g. If it is cloudy and you want
to get out then you don’t want to get wet.
(c) Practical arguments: (Belief, sub -goalsGoal format) e.g. If it is cloudy and you own a
raincoat then put the raincoat.
(d) Social arguments: (social commentsGoal, desire format) e.g. I will stop at the corner because
the law say so. e.g. I can’t do that, I promise to my mother that I won’t.
(e) Interactions (binary or collective) between arguments:
(1) Conflict (defeat) format e.g. attacks 
There are interactions of support-type that are used for collective binary arguments in multi
agents system
DECLARE @pattern varchar(52) = '0123456789 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
SELECT 
   v.[Text], 
   REPLACE(
      TRANSLATE(
         v.[Text],
         REPLACE(TRANSLATE(v.[Text], @pattern, REPLICATE('a', LEN(@pattern))), 'a', ''),
		 REPLICATE('~', LEN(REPLACE(REPLACE(TRANSLATE(v.[Text], @pattern, REPLICATE('a', LEN(@pattern))), 'a', ''), ' ', '.')))
      ),
      '~',
      ''
   ) AS AlphaNumericCharacters
FROM (VALUES
   ('abc01234def5678ghi90jkl#@$&"'),
   ('1234567890'),
   ('JAHDBESBN%*#*@*($E*sd55bn')
) v ([Text]);
function custom_login_logo() {

    echo '<style type="text/css">

        h1 a { background-image: url(https://saidatul.com/wp-content/uploads/202/01/logo.png) !important; }
4
    </style>';

}

add_action('login_head', 'custom_login_logo');

​
add_filter( 'woocommerce_checkout_cart_item_quantity', 'bbloomer_checkout_item_quantity_input', 999,  );

  
3
function bbloomer_checkout_item_quantity_input( $product_quantity, $cart_item, $cart_item_key ) {

   $product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );

   $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );

   if ( ! $product->is_sold_individually() ) {

      $product_quantity = woocommerce_quantity_input( array(

         'input_name'  => 'shipping_method_qty_' . $product_id,
9
         'input_value' => $cart_item['quantity'],

         'max_value'   => $product->get_max_purchase_quantity(),

         'min_value'   => '0',

      ), $product, false );

      $product_quantity .= '<input type="hidden" name="product_key_' . $product_id . '" value="' . $cart_item_key . '">';

   }

   return $product_quantity;

}

 

// ----------------------------

// Detect Quantity Change and Recalculate Totals

 

add_action( 'woocommerce_checkout_update_order_review', 'bbloomer_update_item_quantity_checkout' );
add_action('wp_footer', 'cart_update_qty_script');

function cart_update_qty_script() {

    if (is_cart()) :

?>

    <script type="text/javascript">

        (function ($) {

            $('div.woocommerce').on('change', '.qty', function () {

                $('[name=update_cart]').prop('disabled', false);

                $('[name=update_cart]').trigger('click');

            });

        }) (jQuery);

    </script>

<?php

    endif;

}

​
Automation and Efficiency-
same as goal
Decision making and predictive analysis-
same as goal
Personalization and User Experience-
same as goal
Healthcare and Medicine
Smart computers can help doctors by looking at medical images and suggesting treatments.. It also contributes to drug discovery and development.
Natural Language Processing (NLP)-
same as goal
Education and Learning
Smart computers can help you learn better by adjusting lessons to fit your style. It's like having a tutor that understands how you learn best. AI-powered educational tools provide tutoring, feedback, and assistance to learners, supplementing traditional teaching methods.
Content Creation: 
AI is involved in generating art, music, and other creative content. It can assist artists and creators in the production of new and innovative works.
חפשי את הסלקטור שלו בCSS ותני לו
Order: 999;

אם לא עובד אז צריך להגדיר 
display: flex;
על ״האבא״ שלו
(function($){
	  $(document).ready(function() {
	    var Selectors = $('.sptp-member-social li a');
	    Selectors.each(function(){
		    var originalTitle = $(this).attr('title');
		    $(this).mouseenter(function() {
		      $(this).removeAttr('title');
		    });
		    $(this).mouseleave(function() {
		      $(this).attr('title', originalTitle);
		    });
	    })
	  });
})(jQuery);
apex_application.g_print_success_message := 'Success message';
using System.Collections;
using Sestem.Collections.Generic;
using UnityEngine;
 
public class Balloon : MonoBehaviour
{
  	public int scoreToGive = 1;
  	public int clicksToPop = 5; 
  	public float scaleIncreasePerClick = 0.1f;
  	public ScoreManager scoreManager;
  
	void OnMouseDown()
  	{
      clicksToPop -= 1;
      transform.localScale += Vector3.one * scaleIncreasePerClick;
      if (clicksToPop == 0)
      {
        scoreManager.IncreaseScore(scoreToGive);
        Destroy(gameObject);
      }
    }
  
}
<?php
function formatPhoneNumber($phoneNumber) {
    // Remove all non-digit characters
    $phoneNumber = preg_replace('/\D/', '', $phoneNumber);

    // Add formatting based on your desired format
    return str_replace(['000', '111', '222', '333', '444', '555', '666', '777', '888', '999'], ['(', ') ', '-'], $phoneNumber);
}

// Test the function
$phoneNumber = "123-456-7890";
$formattedNumber = formatPhoneNumber($phoneNumber);
echo "Formatted Phone Number: " . $formattedNumber;
# 1- > Deleting based on _id in baselineTable

from bson import ObjectId
import json

file_path = 'delete_ids'

with open(file_path, 'r') as file:
    data = json.load(file)

data_array = data['data']

delete_object_ids = [ObjectId(item) for item in data_array]
db["participantBaselineAndFollowupData"].delete_many({"_id": {"$in": delete_object_ids}})
#to check
# records = db["participantBaselineAndFollowupData"].find({"_id": {"$in": delete_object_ids}})
# count=0
# for record in records:
#     count=count+1
#     print(record["_id"])
# print(count)
#4-> Refer Subscription based on date.(2 subscription)

import json
from datetime import datetime
from bson.objectid import ObjectId

with open('referSubByDate.json', 'r') as file:
    data = json.load(file)

not_found_ids = []
not_updated_ids = []

for item in data['data']:
    _id = item['id']
    date = item['date']
    date_object = datetime.strptime(date, "%d/%m/%Y")
    new_date = date_object.strftime("%Y-%m-%dT%H:%M:%S.000+00:00")
    
    participant_record = db["participantBaselineAndFollowupData"].find_one({"_id": ObjectId(_id)})
    
    if participant_record:
        user_id = participant_record["participantId"]
        
        subscription_record = db["subscription"].find_one({"userId": user_id, "startDate": new_date})
        
        if subscription_record:
            startDate = subscription_record["startDate"]
            program_code = subscription_record["subscriptionPlan"].get("programCode")
            
            result = db["participantBaselineAndFollowupData"].update_one(
                {"_id": participant_record["_id"]},
                {"$set": {"programCode": program_code, "programStartDate": startDate}}
            )
            
            if result.modified_count == 0:
                not_updated_ids.append(_id)
        else:
            not_updated_ids.append(_id)
    else:
        not_found_ids.append(_id)

print("Completed")

if not_found_ids:
    print(f"IDs not found: {not_found_ids}")

if not_updated_ids:
    print(f"IDs not updated: {not_updated_ids}")

        
    

#3-> one baseline 2 subs refer the given program code
import json

file_path = "oneBase2Sub"
try:
    with open(file_path, "r") as file:
        data1 = json.load(file)
        # print(data)

    data_list = list(data1.items())
    # print(data_list)
except Exception as e:
    print("Error:", e)


print(len(data_list))









from bson.objectid import ObjectId

not_found_ids = []
not_updated_ids = []

for data_tuple in data_list:
    _id, program_code = data_tuple

    participant_record = db["participantBaselineAndFollowupData"].find_one({"_id": ObjectId(_id)})

    if participant_record:
        user_id = participant_record["participantId"]

        subscription_record = db["subscription"].find_one({"userId": user_id, "subscriptionPlan.programCode": program_code})
        
        if subscription_record:
            program_start_date = subscription_record.get("startDate", "")
            program_code_from_subscription = subscription_record["subscriptionPlan"].get("programCode", "")
            
            result = db["participantBaselineAndFollowupData"].update_one(
                {"_id": participant_record["_id"]},
                {"$set": {"programCode": program_code, "programStartDate": program_start_date}}
            )
            
            if result.modified_count == 0:
                not_updated_ids.append(_id)
        else:
            not_updated_ids.append(_id)
    else:
        not_found_ids.append(_id)

print("Completed")


if not_found_ids:
    print(f"IDs not found: {len(not_found_ids)}")
    print(f"IDs not found: {not_found_ids}")

if not_updated_ids:
    print(f"IDs not updated: {len(not_updated_ids)}")
    print(f"IDs not updated: {not_updated_ids}")
# 2-> 1 subs 1 baseline
import json

file_path = "referOneSub"

with open(file_path, 'r') as file:
    data = json.load(file)

data_array = data['data']
insert_object_ids = [ObjectId(_id) for _id in data_array]
print(len(insert_object_ids))
# print(insert_object_ids)




from bson.objectid import ObjectId

not_found_ids = []
not_updated_ids = []

for _id in insert_object_ids:
    record = db["participantBaselineAndFollowupData"].find_one({"_id": _id})
    
    if record:
        user_id = record["participantId"]
        
        subscription = db["subscription"].find_one({"userId": user_id})
        
        if subscription:
            program_start_date = subscription.get("startDate", "")
            program_code = subscription["subscriptionPlan"].get("programCode", "")
            
            result = db["participantBaselineAndFollowupData"].update_one(
                {"_id": _id},
                {"$set": {"programCode": program_code, "programStartDate": program_start_date}}
            )
            
            if result.modified_count == 0:
                not_updated_ids.append(_id)
        else:
            not_updated_ids.append(_id)
    else:
        not_found_ids.append(_id)

print("Completed")

if not_found_ids:
    print(f"IDs not found: {print(not_found_ids)}")

if not_updated_ids:
    print(f"IDs not updated: {len(not_updated_ids)}")
    print(f"IDs not updated: {not_updated_ids}")

    
using System.Collections;
using Sestem.Collections.Generic;
using UnityEngine;
 
public class Balloon : MonoBehaviour
{
	public int score;
  
  	public void IncreaseScore(int amount)
  	{
    	score += amount;
  	}
  
}
Sub ListFilesInFolderAndSubfolders()
    On Error GoTo ErrHandler
    
    Dim selectedFolder As FileDialog
    Set selectedFolder = Application.FileDialog(msoFileDialogFolderPicker)
    
    Dim selectedPath As String
    If selectedFolder.Show = -1 Then
        selectedPath = selectedFolder.SelectedItems(1)
        
        Dim ws As Worksheet
        Set ws = ThisWorkbook.Sheets.Add
        
        ws.Cells(1, 1).Value = "Folder Path"
        ws.Cells(1, 2).Value = "File Name"
        
        Dim startCell As Range
        Set startCell = ws.Cells(2, 1)
        
        ListFilesRecursive selectedPath, selectedPath, startCell
        
        MsgBox "File listing completed.", vbInformation
    Else
        MsgBox "No folder selected.", vbExclamation
    End If
    
    Exit Sub
    
ErrHandler:
    MsgBox "An error occurred: " & Err.Description, vbCritical
End Sub

Sub ListFilesRecursive(ByVal folderPath As String, ByVal parentFolderPath As String, ByRef targetCell As Range)
    Dim folder As Object, subFolder As Object
    Dim file As Object
    Dim fs As Object
    Dim subFolderPath As String
    
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set folder = fs.GetFolder(folderPath)
    
    For Each file In folder.Files
        targetCell.Value = parentFolderPath
        targetCell.Offset(0, 1).Value = file.Name
        Set targetCell = targetCell.Offset(1, 0)
    Next file
    
    For Each subFolder In folder.SubFolders
        subFolderPath = subFolder.Path
        ListFilesRecursive subFolderPath, subFolderPath, targetCell
    Next subFolder
    
    Set fs = Nothing
    Set folder = Nothing
    Set subFolder = Nothing
    Set file = Nothing
End Sub

class A
{
    void add(int ... a)
    {
        int sum=0;
        for(int x:a)
        {
            sum=sum+x;
        }
        System.out.println("sum of numbers will be "+sum);
    }
}
class B 
{
    public static void main(String[] args)
    {
        A r= new A();
        r.add();
        r.add(10,20);
        r.add(20,30);
        r.add(20,20);
    }
}
star

Tue Jan 16 2024 09:52:10 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Tue Jan 16 2024 09:34:10 GMT+0000 (Coordinated Universal Time) https://www.scaler.com/topics/artificial-intelligence-tutorial/state-space-search-in-artificial-intelligence/

@nistha_jnn

star

Tue Jan 16 2024 09:16:44 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Tue Jan 16 2024 09:12:42 GMT+0000 (Coordinated Universal Time)

@Jevin2090

star

Tue Jan 16 2024 08:51:01 GMT+0000 (Coordinated Universal Time)

@ivantan

star

Tue Jan 16 2024 08:37:31 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #ilink

star

Tue Jan 16 2024 07:26:08 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Tue Jan 16 2024 06:49:46 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Tue Jan 16 2024 06:19:37 GMT+0000 (Coordinated Universal Time)

@Sifat_H #childexists #masterchild #childexistsformaster

star

Tue Jan 16 2024 06:00:06 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Tue Jan 16 2024 05:33:31 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Tue Jan 16 2024 05:28:37 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Tue Jan 16 2024 05:24:27 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Tue Jan 16 2024 05:19:44 GMT+0000 (Coordinated Universal Time) https://codedrivendevelopment.com/posts/rarely-known-nextjs-features?utm_source

@vishalbhan

star

Tue Jan 16 2024 05:19:22 GMT+0000 (Coordinated Universal Time) https://codedrivendevelopment.com/posts/rarely-known-nextjs-features?utm_source

@vishalbhan

star

Tue Jan 16 2024 05:02:10 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Tue Jan 16 2024 04:56:18 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Tue Jan 16 2024 03:55:57 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Tue Jan 16 2024 03:13:04 GMT+0000 (Coordinated Universal Time)

@eneki #docker

star

Tue Jan 16 2024 03:12:20 GMT+0000 (Coordinated Universal Time)

@eneki #composer

star

Tue Jan 16 2024 03:12:19 GMT+0000 (Coordinated Universal Time)

@eneki #composer

star

Tue Jan 16 2024 03:10:41 GMT+0000 (Coordinated Universal Time)

@eneki #composer

star

Mon Jan 15 2024 19:19:34 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 19:02:29 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 18:03:00 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 17:51:31 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 17:21:00 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 17:09:00 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 16:03:35 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 15:12:01 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 14:02:02 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/1007697/how-to-strip-all-non-alphabetic-characters-from-string-in-sql-server

@rick_m #sql

star

Mon Jan 15 2024 12:58:18 GMT+0000 (Coordinated Universal Time)

@brozool

star

Mon Jan 15 2024 12:17:40 GMT+0000 (Coordinated Universal Time)

@brozool

star

Mon Jan 15 2024 12:16:58 GMT+0000 (Coordinated Universal Time)

@brozool

star

Mon Jan 15 2024 11:39:08 GMT+0000 (Coordinated Universal Time)

@nistha_jnn

star

Mon Jan 15 2024 10:40:01 GMT+0000 (Coordinated Universal Time) https://codepen.io/jh3y/pen/MWxbrEp

@passoul #css

star

Mon Jan 15 2024 10:39:39 GMT+0000 (Coordinated Universal Time)

@odesign

star

Mon Jan 15 2024 09:09:07 GMT+0000 (Coordinated Universal Time) https://codeshare.io/vwylnl

@Pulak

star

Mon Jan 15 2024 09:05:21 GMT+0000 (Coordinated Universal Time) https://www.kaust.edu.sa/en/study/faculty/kuo-wei-huang

@pk20

star

Mon Jan 15 2024 08:52:44 GMT+0000 (Coordinated Universal Time)

@austin #sql/pl/sql #oracle #apex

star

Mon Jan 15 2024 07:30:13 GMT+0000 (Coordinated Universal Time)

@iliavial #c#

star

Mon Jan 15 2024 07:02:52 GMT+0000 (Coordinated Universal Time)

@kghamdi96

star

Mon Jan 15 2024 07:01:35 GMT+0000 (Coordinated Universal Time)

@CodeWithSachin ##jupyter #aggregation

star

Mon Jan 15 2024 07:00:35 GMT+0000 (Coordinated Universal Time)

@CodeWithSachin ##jupyter #aggregation

star

Mon Jan 15 2024 07:00:07 GMT+0000 (Coordinated Universal Time)

@CodeWithSachin ##jupyter #aggregation

star

Mon Jan 15 2024 06:59:31 GMT+0000 (Coordinated Universal Time)

@CodeWithSachin ##jupyter #aggregation

star

Mon Jan 15 2024 06:25:15 GMT+0000 (Coordinated Universal Time)

@iliavial #c#

star

Mon Jan 15 2024 06:23:22 GMT+0000 (Coordinated Universal Time)

@miskat80

star

Mon Jan 15 2024 05:46:35 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

Save snippets that work with our extensions

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