Snippets Collections
'***************** Code Start ***************
'Assign this to the OnClick event of a command button (or double-click event
'of a label or graphic) named "bDisableBypassKey"
'Change the "TypeYourBypassPasswordHere" default password to your password

Private Sub bDisableBypassKey_Click()
    On Error GoTo Err_bDisableBypassKey_Click
    'This ensures the user is the programmer needing to disable the Bypass Key
    Dim strInput As String
    Dim strMsg As String
    Beep
    strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
             "Please key the programmer's password to enable the Bypass Key."
    strInput = InputBox(Prompt:=strMsg, title:="Disable Bypass Key Password")
    If strInput = "TypeYourBypassPasswordHere" Then
        SetProperties "AllowBypassKey", dbBoolean, True
        Beep
        MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
               "The Shift key will allow the users to bypass the startup & _
               options the next time the database is opened.", _
               vbInformation, "Set Startup Properties"
    Else
        Beep
        SetProperties "AllowBypassKey", dbBoolean, False
        MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
               "The Bypass Key was disabled." & vbCrLf & vbLf & _
               "The Shift key will NOT allow the users to bypass the & _
               startup options the next time the database is opened.", _
               vbCritical, "Invalid Password"
        Exit Sub
    End If
Exit_bDisableBypassKey_Click:
    Exit Sub
Err_bDisableBypassKey_Click:
    MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
    Resume Exit_bDisableBypassKey_Click
End Sub
'***************** Code End ***************
scores = pd.DataFrame(grid.cv_results_)
scores.plot(x='param_max_leaf_nodes', y='mean_train_score', yerr='std_train_score', ax=plt.gca())
scores.plot(x='param_max_leaf_nodes', y='mean_test_score', yerr='std_test_score', ax=plt.gca())
from sklearn.model_selection import GridSearchCV
param_grid = {'max_leaf_nodes': range(2, 20)}
grid = GridSearchCV(DecisionTreeClassifier(random_state=0), param_grid=param_grid,
                    cv=StratifiedShuffleSplit(100, random_state=1),
                   return_train_score=True)
grid.fit(X_train, y_train)

scores = pd.DataFrame(grid.cv_results_)
scores.plot(x='param_max_leaf_nodes', y=['mean_train_score', 'mean_test_score'], ax=plt.gca())
plt.legend(loc=(1, 0))
# Remove the installed package for each user
Get-AppxPackage -AllUsers | Where-Object {$_.Name -like "*WebExperience*"} | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
SELECT is the clause we use every time we want to query information from a database.
AS renames a column or table.
DISTINCT return unique values.
WHERE is a popular command that lets you filter the results of the query based on conditions that you specify.
LIKE and BETWEEN are special operators.
AND and OR combines multiple conditions.
ORDER BY sorts the result.
LIMIT specifies the maximum number of rows that the query will return.
CASE creates different outputs.
package viettel.cyberbot.demoMysql.Service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.nimbusds.jose.shaded.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import viettel.cyberbot.demoMysql.Entity.Product;
import viettel.cyberbot.demoMysql.Entity.ViettelCyberSpace;
import viettel.cyberbot.demoMysql.Entity.ViettelCyberSpaceDetails;
import viettel.cyberbot.demoMysql.Exception.BadRequest;
import viettel.cyberbot.demoMysql.Mapper.GetDataMapper;
import viettel.cyberbot.demoMysql.Repository.Imp.ViettelCyberSpaceRepositoryImp;
import viettel.cyberbot.demoMysql.Request.GetDataRequest;
import viettel.cyberbot.demoMysql.Response.GetDataResponse;
import viettel.cyberbot.demoMysql.Response.GetDataResponseOnetoOne;
import java.util.ArrayList;
import java.util.List;

@Service
public class ViettelCyberSpaceService {
    @Autowired
    ViettelCyberSpaceRepositoryImp viettelCyberSpaceRepositoryImp;
    @Autowired
    GetDataMapper getDataMapper;

    public GetDataResponse getData(GetDataRequest request) throws JsonProcessingException {
        if (request.getId() == null) {
            throw new BadRequest("request wrong");
        }
        int id = Integer.parseInt(request.getId());
        Object[] object = viettelCyberSpaceRepositoryImp.getDataByCriteriaQuery(id);
        String json1 = new Gson().toJson(object[0]);
        String json2 = new Gson().toJson(object[1]);
        ObjectMapper objectMapper = new ObjectMapper();
        Product product = objectMapper.readValue(json1, new TypeReference<Product>() {
        });
        ViettelCyberSpace vtcc = objectMapper.readValue(json2, new TypeReference<ViettelCyberSpace>() {
        });
        return getDataMapper.convertAttribute(product, vtcc);
    }
    public List<GetDataResponseOnetoOne> getDataOneToOne() throws JsonProcessingException {
        List<Object> list = viettelCyberSpaceRepositoryImp.getDataByCriteriaQueryOneToOne();
        List<GetDataResponseOnetoOne> listResponse= new ArrayList<>();
        for(Object object: list){
            Object[] objects= (Object[]) object;
            ObjectMapper objectMapper = new ObjectMapper();
            String json1 = new Gson().toJson(objects[0]);
            String json2 = new Gson().toJson(objects[1]);
            ViettelCyberSpaceDetails viettelCyberSpaceDetails = objectMapper.readValue(json1, new TypeReference<ViettelCyberSpaceDetails>() {
            });
            ViettelCyberSpace viettelCyberSpace = objectMapper.readValue(json2, new TypeReference<ViettelCyberSpace>() {
            });
            GetDataResponseOnetoOne getDataResponseOnetoOne= getDataMapper.convertAttributeOneToOne(viettelCyberSpaceDetails,viettelCyberSpace);
            listResponse.add(getDataResponseOnetoOne);
        }
        return listResponse;
    }
}
package viettel.cyberbot.demoMysql.Repository.Imp;

import org.springframework.stereotype.Repository;
import viettel.cyberbot.demoMysql.Entity.Product;
import viettel.cyberbot.demoMysql.Entity.ViettelCyberSpace;
import viettel.cyberbot.demoMysql.Entity.ViettelCyberSpaceDetails;
import viettel.cyberbot.demoMysql.Repository.ViettelCyberSpaceRepository;

import javax.persistence.*;
import javax.persistence.criteria.*;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Repository
public class ViettelCyberSpaceRepositoryImp implements ViettelCyberSpaceRepository {
    @PersistenceContext
    EntityManager entityManager;

    @Override
    public Object[] getDataByCriteriaQuery(int id) {
        CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
        CriteriaQuery<Object[]> query = criteriaBuilder.createQuery(Object[].class);
        Root<Product> productTable = query.from(Product.class);
        Root<ViettelCyberSpace> vtccTable = query.from(ViettelCyberSpace.class);
        Predicate condition = criteriaBuilder.equal(productTable.get("productId"), id);
        //table product chỉ lấy column name và table product vtcc chỉ lấy column department
        query.multiselect(productTable.get("productName"), vtccTable.get("departmentName"))
                .where(criteriaBuilder.equal(productTable.get("departmentId"), vtccTable.get("departmentId"))).where(condition);
        return entityManager.createQuery(query).getResultList().get(0);
    }

    @Override
    public List<Object> getDataByCriteriaQueryOneToOne() {
        CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
        CriteriaQuery<Object> query = criteriaBuilder.createQuery(Object.class);
        Root<ViettelCyberSpaceDetails> vtccDetails = query.from(ViettelCyberSpaceDetails.class);
        Root<ViettelCyberSpace> vtccTable = query.from(ViettelCyberSpace.class);
        query.multiselect(vtccDetails, vtccTable)
                .where(criteriaBuilder.equal(vtccDetails.get("departmentDetailId"), vtccTable.get("departmentId")));
        List<Object> list=entityManager.createQuery(query).getResultList();
        System.out.println(list.get(1));
        return entityManager.createQuery(query).getResultList();
    }
}
var time = new GlideDateTime();
gs.info('GMT time is->'+time);
var tz = Packages.java.util.TimeZone.getTimeZone('PST');
time.setTZ(tz);
var timeZoneOffSet = time.getTZOffset();
time.setNumericValue(time.getNumericValue() + timeZoneOffSet);
gs.info('PST time is->'+time);
/*******************agr post pehly say bani hwe hai like (blogs post) to phr just loop chalainge or values get karwainge*****************************/


function post_loop(){
    ob_start();
    
    $args = array(
         'post_type' => 'post',
         'posts_per_page' => -1,
         );
         
    $data = new WP_Query($args);
    ?>
    
    <div class="row">
        
    <?php
    if($data->have_posts()):
        while($data->have_posts()):
            $data->the_post();
            $categories =  get_the_category($post->ID);
    ?>
    
    <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
        
    <div class="main-post">
        
        <div class="blog-fig">
            <?php the_post_thumbnail('full'); ?>
        </div>
        
        <div class="blg-content">
            <div class="bld-category">
                 <?php
            foreach($categories as $category):
                echo $category->name;
            endforeach;
            ?>
            </div>
            <div class="blg-ttl"><h2><?php the_title(); ?></h2></div>
            <div class="blg-excerp">
                <?php
                   echo wp_trim_words( get_the_content(), 40, '...' );
                ?>
            </div>
             <div class="pub-date"><?php $post_date = get_the_date( 'j F Y' ); echo $post_date; ?></div> 
             <div class="blg-btn"><a href="<?php the_permalink(); ?>">Read More</a></div> 
        </div>
    </div>

    </div>
    
            
            
            <?php 
            endwhile;
    endif;
    ?>
    </div>
    
    <?php
    wp_reset_postdata();
    return ob_get_clean();
}
add_shortcode('wp_post_data','post_loop');
private void Form_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Escape)
    {
        this.Close();
    }
}
private bool mouseDown;
private Point lastLocation;

    private void Form1_MouseDown(object sender, MouseEventArgs e)
    {
        mouseDown = true;
        lastLocation = e.Location;
    }

    private void Form1_MouseMove(object sender, MouseEventArgs e)
    {
        if(mouseDown)
        {
            this.Location = new Point(
                (this.Location.X - lastLocation.X) + e.X, (this.Location.Y - lastLocation.Y) + e.Y);

            this.Update();
        }
    }

    private void Form1_MouseUp(object sender, MouseEventArgs e)
    {
        mouseDown = false;
    }
<?php get_header(); ?>

         
          <div class="page-title page-title-default title-size-large title-design-centered color-scheme-light" style="">
					<div class="container">
				<h1 class="entry-title title"><?php the_title(); ?>	</h1>
                    <div class="breadcrumbs"><a href="https://stage.projects-delivery.com/wp/autobody_rpeiar/" rel="v:url" property="v:title">Home</a> » <span class="current">About Us</span></div><!-- .breadcrumbs -->																		</div>
				</div>


    <div class="container">
        <div class="row single_serviceSection">
            <div class="col-lg-6">
                <div class="singleServiceContent">
                    <h3>
                        <?php the_title(); ?>
                    </h3>
                    <p>
                        <?php the_content(); ?>
                    </p>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="singleServiceThumbnail">
                    <?php the_post_thumbnail("full"); ?>
                </div>
            </div>
        </div>
        <?php// comments_template(); ?>
    </div>



<?php 
 
get_footer();

?>
add_filter('use_block_editor_for_post', '__return_false', 10);
add_filter( 'use_widgets_block_editor', '__return_false' );
SELECT
EmailAddress,c.FirstName, c.LastName, Job_Role__c, Consent_Level_Summary__c,
Company_Name__c,
c.AMC_Last_Activity_Date__c,c.AMC_Status__c,c.AMC_Last_Activity_Record_ID__c
FROM  ent.Contact_Salesforce_1 c 
INNER Join [Hydrogen_Webinar_Consent_Query] i ON i.EmailAddress = c.Email
 

WHERE EXISTS (
SELECT [EmailAddress] FROM [Hydrogen_Webinar_Consent_Query] i WHERE i.EmailAddress = c.Email )
 
AND c.Consent_Level_Summary__c in ('Express Consent' , 'Validated Consent')
    AND c.AMC_Status__c = 'Active'
    AND c.AMC_Last_Activity_Record_ID__c <> 'Not Marketable'
# Route to blacklist a creator
@app.route('/blacklist_creator/<int:creator_id>', methods=['POST'])
def blacklist_creator(creator_id):
    admin_id = session['user_id'] 

    
    creator_blacklist = CreatorBlacklist.query.filter_by(admin_id=admin_id, creator_id=creator_id).first()
    if creator_blacklist:
        flash('Creator is already blacklisted.', 'danger')
    else:
        creator_blacklist = CreatorBlacklist(admin_id=admin_id, creator_id=creator_id)
        db.session.add(creator_blacklist)
        db.session.commit()
        flash('Creator has been blacklisted.', 'success')

    return redirect(url_for('review_creator'))

# Route to whitelist a creator
@app.route('/whitelist_creator/<int:creator_id>', methods=['POST'])
def whitelist_creator(creator_id):
    admin_id = session['user_id']  
    creator_blacklist = CreatorBlacklist.query.filter_by(admin_id=admin_id, creator_id=creator_id).first()
    if creator_blacklist:
        db.session.delete(creator_blacklist)
        db.session.commit()
        flash('Creator has been whitelisted.','success')
    else:
        flash('Creator was not blacklisted.','danger')
    return redirect(url_for('review_creator'))  
function editCell(e) {
  var target = getEventTarget(e);
  if(target.tagName.toLowerCase() === 'td') {
    // DO SOMETHING WITH THE CELL
  }
}
dt_list <- list()
dt_list <- append(dt_list, list(dt))
data.table::rbindlist(dt_list)`
import { motion } from "framer-motion";
import styles, { layout } from "../style";
import { NewsVid1 } from "../assets";

const Container = {
  hidden: {},
  visible: { staggerChildren: 0.2 },
};

const News = () => {
  return (
    <section id="news" className={styles.padding}>
      {/* Heading */}

      <motion.div
        className="md:w-2/4 mx-auto text-center"
        initial="hidden"
        whileInView="visible"
        viewport={{ once: true, amount: 0.5 }}
        transition={{ duration: 0.5 }}
        variants={{
          hidden: { opacity: 0, y: -50 },
          visible: { opacity: 1, y: 0 },
        }}
      >
        <div>
          <p
            className={`  font-playfair font-semibold sm:text-4xl uppercase text-black `}
          >
            {" "}
            We are in news{" "}
          </p>
        </div>
      </motion.div>

      {/* Video */}

      <div className={`${styles.flexCenter}`}>
        <div className="grid grid-col-3">
          {/* card */}
          <div className="">
            <div className="">
              <div className=" ">India News</div>
              <video autoPlay loop muted controls className=" ">
                {" "}
                <source src={NewsVid1} type="video/mp4" />
              </video>
            </div>
          </div>
          {/* card */}
          <div className="rounded overflow-hidden shadow-lg flex justify-center text-center items-center  bg-red max-w-[400px ] text-2xl  font-playfair font-semibold ">
            <div className="px-2">
              <div className="font-bold text-xl mb-10 ">India News</div>
              <video
                autoPlay
                loop
                muted
                controls
                className="object-contain   border-10 rounded-lg "
              >
                <source src={NewsVid1} type="video/mp4" />
              </video>
            </div>
          </div>
          {/* card */}
          <div className="rounded overflow-hidden shadow-lg flex justify-center text-center items-center  bg-red max-w-[400px ] text-2xl  font-playfair font-semibold ">
            <div className="px-2">
              <div className="font-bold text-xl mb-10 ">India News</div>
              <video
                autoPlay
                loop
                muted
                controls
                className="object-contain   border-10 rounded-lg "
              >
                <source src={NewsVid1} type="video/mp4" />
              </video>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
};

export default News;
super_data_len = len(super_data)

for i in range(super_data_len):
    center_state = super_data.at[i, "centerState"]
    purchase_type = super_data.at[i, "purchaseType"]
    book_invoice_code = ""
    ebook_invoice_code = ""
    prod_invoice_code = ""
    
    # Book Invoice Code
    if super_data.loc[i, "isBook"] == True:
        if center_state == "Maharashtra":
            if purchase_type == "Online":
                counters["mh_sc_cnt"] += 1
                book_invoice_code = state_code_mh + year_code + "SCB" + f"{counters['mh_sc_cnt']:08d}"

            elif purchase_type == "Offline":
                counters["of_sc_cnt"] += 1
                book_invoice_code = state_code_of + year_code + "SCB" + f"{counters['of_sc_cnt']:08d}"

        elif center_state == "Bihar":
            counters["br_sc_cnt"] += 1
            book_invoice_code = state_code_br + year_code + "SCB" + f"{counters['br_sc_cnt']:08d}"

        elif center_state == "Delhi":
            counters["dl_sc_cnt"] += 1
            book_invoice_code = state_code_dl + year_code + "SCB" + f"{counters['dl_sc_cnt']:08d}"

        elif center_state == "Uttar Pradesh":
            counters["up_sc_cnt"] += 1
            book_invoice_code = state_code_up + year_code + "SCB" + f"{counters['up_sc_cnt']:08d}"

        super_data.at[i, "Invoice_Book"] = book_invoice_code
        
    # E-Book Invoice Code
    if super_data.loc[i, "isEBook"] == True:
        if center_state == "Maharashtra":
            if purchase_type == "Online":
                counters["mh_sc_cnt"] += 1
                ebook_invoice_code = state_code_mh + year_code + "SCE" + f"{counters['mh_sc_cnt']:08d}"

            elif purchase_type == "Offline":
                counters["of_sc_cnt"] += 1
                ebook_invoice_code = state_code_of + year_code + "SCE" + f"{counters['of_sc_cnt']:08d}"

        elif center_state == "Bihar":
            counters["br_sc_cnt"] += 1
            ebook_invoice_code = state_code_br + year_code + "SCE" + f"{counters['br_sc_cnt']:08d}"

        elif center_state == "Delhi":
            counters["dl_sc_cnt"] += 1
            ebook_invoice_code = state_code_dl + year_code + "SCE" + f"{counters['dl_sc_cnt']:08d}"

        elif center_state == "Uttar Pradesh":
            counters["up_sc_cnt"] += 1
            ebook_invoice_code = state_code_up + year_code + "SCE" + f"{counters['up_sc_cnt']:08d}"

        super_data.at[i, "Invoice_EBook"] = ebook_invoice_code

    # Product Invoice Code
    if super_data.loc[i, "isProduct"] == True:
        if center_state == "Maharashtra":
            if purchase_type == "Online":
                counters["mh_sc_cnt"] += 1
                prod_invoice_code = state_code_mh + year_code + "SCP" + f"{counters['mh_sc_cnt']:08d}"

            elif purchase_type == "Offline":
                counters["of_sc_cnt"] += 1
                prod_invoice_code = state_code_of + year_code + "SCP" + f"{counters['of_sc_cnt']:08d}"

        elif center_state == "Bihar":
            counters["br_sc_cnt"] += 1
            prod_invoice_code = state_code_br + year_code + "SCP" + f"{counters['br_sc_cnt']:08d}"

        elif center_state == "Delhi":
            counters["dl_sc_cnt"] += 1
            prod_invoice_code = state_code_dl + year_code + "SCP" + f"{counters['dl_sc_cnt']:08d}"

        elif center_state == "Uttar Pradesh":
            counters["up_sc_cnt"] += 1
            prod_invoice_code = state_code_up + year_code + "SCP" + f"{counters['up_sc_cnt']:08d}"
        super_data.at[i, "Invoice_Product"] = prod_invoice_code
principio de la tabla:
[
  'class' => 'yii\grid\ActionColumn',
            'contentOptions' => ['style' => 'text-align:center; width:2%; vertical-align:middle;'],
 ]
Final de la tabla:
'class' => 'yii\grid\ActionColumn',
            'contentOptions' => ['style' => 'text-align:center; width:2%; vertical-align:middle;'],
  
listas:
'id_reporte' => [
            'attribute' => 'id_reporte',
            'headerOptions' => ['style' => 'text-align:center; width:5%;text-color:white;'],
            'contentOptions' => ['style' => 'text-align:center; vertical-align:middle; white-space: pre-line;'],
            'label' => 'Tipo de Reporte',
            'filter' => app\models\Reportes::lista(),
            'format' => 'html',
            'value' => function ($data) {
                $s = app\models\Reportes::find()->where(['id_reporte' => $data->id_reporte])->one();
                $desc_reporte = ($s) ? $s->desc_reporte : '';
                $desc_reporte = nl2br($desc_reporte);
                $desc_reporte = wordwrap($desc_reporte, 20, "<br>\n");
                return $desc_reporte;
            }
        ],

campos:
'attribute' => 'fecha_hora',
            'value' => 'fecha_hora',
            'headerOptions' => ['style' => 'text-align:center; width:10%;text-color:white;'],
            'contentOptions' => ['style' => 'text-align:center; vertical-align:middle;'],
.
└── sql_app
    ├── __init__.py
    ├── crud.py
    ├── database.py
    ├── main.py
    ├── models.py
    └── schemas.py
for (date in as.list(c("2022-01-01", "2022-02-01", "2022-03-01"))) {
  print(date)
}
In pre-pruning, you restrict while you’re growing. In post-pruning, you build the whole tree (greedily) and then you possibly merge notes. So you possibly undo sort of bad decisions that you made, but you don’t restructure the tree.

In scikit-learn right now, there’s only pre-pruning. The most commonly used criteria are the maximum depth of the tree, the maximum number of leaf nodes, the minimum samples in a node split and minimum decrease impurity.

global class JitHandlerExample  implements Auth.SamlJitHandler {
    
    // Do nothing on create
    global User createUser(Id samlSsoProviderId, Id communityId, Id portalId, String federationIdentifier, Map<String, String> attributes, String assertion){
        return null;
    }

    // On update
    global void updateUser(Id userId, Id samlSsoProviderId, Id communityId, Id portalId, String federationIdentifier, Map<String, String> attributes, String assertion) {
        
      	// For Encrypted assertions use
      	// assertion = attributes.get('Sfdc.SamlAssertion')
      
        // Get the subject
        String subject = getSubjectFromAssertion(EncodingUtil.Base64Decode(assertion).toString());
        
        // Do whatever you need to do with the subject
        lwt.Dbg.al(subject);
        lwt.Dbg.pub();
    }


    /**
     * @description Method to get the subject from the assertion
     */
    private String getSubjectFromAssertion(String decodedAssertion){
        
        XmlStreamReader reader = new XmlStreamReader(decodedAssertion);
    
        boolean isSafeToGetNextXmlElement = true;
        while(isSafeToGetNextXmlElement) {
            if (reader.getEventType() == XmlTag.START_ELEMENT) {
                
                // Find the nameId element
                if (reader.getLocalName() == 'NameID') {
                    
                    // Go to the text part of the element (part after the start tag)
                    reader.next();
                    
                    // Return the value of the element
                    return reader.getText();
                }
            }
    
            if (reader.hasNext()) {
                reader.next();
            }else{
                isSafeToGetNextXmlElement = false;
                break;
            }
        }
        return null;
    }
}
<script> jQuery(document).ready( () => { setTimeout( () => { jQuery('.slick-slider').slick("slickSetOption", "pauseOnHover", false, true) }, 10); }); </script>

This will stop ALL the sliders on the page, if you want to target only a certain one: add a class "slider-top" to your listing grid and then change the code to:

<script> jQuery(document).ready( () => { setTimeout( () => { jQuery('.slider-top .slick-slider').slick("slickSetOption", "pauseOnHover", false, true) }, 10); }); </script>
final dir = await getApplicationDocumentsDirectory();
final isar = await Isar.open(
  [EmailSchema],
  directory: dir.path,
);
docsearch.as_retriever(search_type="mmr")

# Retrieve more documents with higher diversity- useful if your dataset has many similar documents
docsearch.as_retriever(search_type="mmr", search_kwargs={'k': 6, 'lambda_mult': 0.25})

# Fetch more documents for the MMR algorithm to consider, but only return the top 5
docsearch.as_retriever(search_type="mmr", search_kwargs={'k': 5, 'fetch_k': 50})

# Only retrieve documents that have a relevance score above a certain threshold
docsearch.as_retriever(search_type="similarity_score_threshold", search_kwargs={'score_threshold': 0.8})

# Only get the single most similar document from the dataset
docsearch.as_retriever(search_kwargs={'k': 1})

# Use a filter to only retrieve documents from a specific paper
docsearch.as_retriever(search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}})
size_x = transform.position[0]*2;
size_y = transform.position[1];

x_offset = effect("Offset")("Shift Center To")[0]+(time*(size_x/thisComp.duration));

if(time < (thisComp.duration/2)){
	y_offset = ease(time, 0, thisComp.duration/2, size_y, size_y*2);
} else {
	y_offset = ease(time, thisComp.duration/2, thisComp.duration, size_y*2, size_y);
}

[x_offset, y_offset];
 
Q 1.
#include <stdio.h>
#include <stdlib.h>
#define MAX_SIZE 3

int stack [MAX_SIZE];
int top = -1;

void push(int value) 
{
    if(top==MAX_SIZE-1) {
        printf("Stack Overflow (Full): Cannot Push Element (%d) onto the stack.\n", value);
    }
    else {
        top++;
        stack[top] = value;
        printf("Element (%d) Pushed Onto The Stack.\n", value);
    }
}

void pop() 
{
    if(top == -1) {
        printf("Stack Underflow (Empty): Cannot Pop Element From The Stack.\n");
    }
    else {
        printf("\nElement (%d) Popped From The Stack.\n", stack[top]);
        top--;
    }
}

void display()
{
    if(top == -1) {
        printf("Stack is Empty.\n");
    }
    else {
        printf("Stack Elements are: ");
        for(int i=top; i>=0; i--) {
            printf("%d, ",stack[i]);
        }
        printf("\n");
    }
}

int main() {
    
    push(10);
    push(20);
    display();
    push(50);
    push(100);
    display();

    pop();
    display();
    pop();
    pop();
    display();

    return 0;
}

//OUTPUT:
Element (10) Pushed Onto The Stack.
Element (20) Pushed Onto The Stack.
Stack Elements are: 20, 10, 
Element (50) Pushed Onto The Stack.
Stack Overflow (Full): Cannot Push Element (100) onto the stack.
Stack Elements are: 50, 20, 10, 

Element (50) Popped From The Stack.
Stack Elements are: 20, 10, 

Element (20) Popped From The Stack.

Element (10) Popped From The Stack.
Stack is Empty.


Q3. 
#include <stdio.h>
#include <stdlib.h>
#define MAX_SIZE 100

char stack[MAX_SIZE];
int top = -1;
void push(char data) {
    if (top == MAX_SIZE - 1) {
        printf("Overflow stack!\n");
        return;
    }
    top++;
    stack[top] = data;
}

char pop() {
    if (top == -1) {
        printf("Empty stack!\n");
        return ' ';
    }
    char data = stack[top];
    top--;
    return data;
}

int is_matching_pair(char char1, char char2) {
    if (char1 == '(' && char2 == ')') {
        return 1;
    } else if (char1 == '[' && char2 == ']') {
        return 1;
    } else if (char1 == '{' && char2 == '}') {
        return 1;
    } else {
        return 0;
    }
}
int isBalanced(char* text) {
    int i;
    for (i = 0; i < strlen(text); i++) {
        if (text[i] == '(' || text[i] == '[' || text[i] == '{') {
            push(text[i]);
        } else if (text[i] == ')' || text[i] == ']' || text[i] == '}') {
            if (top == -1) {
                return 0;
            } else if (!is_matching_pair(pop(), text[i])) {
                return 0;
            }
        }
    }
    if (top == -1) {
        return 1;
    } else {
        return 0;
    }
}

int main() {
   char text[MAX_SIZE];
   printf("Input an expression in parentheses: ");
   scanf("%s", text);
   if (isBalanced(text)) {
       printf("The expression is balanced.\n");
   } else {
       printf("The expression is not balanced.\n");
   }
   return 0;
}
//OUTPUT:
Input an expression in parentheses: {[({[]})]}
The expression is balanced.
Input an expression in parentheses: [{[}]]
The expression is not balanced.
https://devhints.io/sass
https://dev.to/finallynero/scss-cheatsheet-7g6
https://gist.github.com/fredsiika/2958726da1f94a9bd447f4f7bd03a852
let reversedStr = str.split("").reverse().join("");
let isValueInArray = arr.includes(value);
star

Fri Nov 03 2023 10:57:12 GMT+0000 (Coordinated Universal Time) http://www.databasedev.co.uk/disable_shift_bypass.html

@Rooffuss

star

Fri Nov 03 2023 07:35:02 GMT+0000 (Coordinated Universal Time) https://amueller.github.io/aml/02-supervised-learning/08-decision-trees.html

@elham469

star

Fri Nov 03 2023 07:34:59 GMT+0000 (Coordinated Universal Time) https://amueller.github.io/aml/02-supervised-learning/08-decision-trees.html

@elham469

star

Fri Nov 03 2023 06:40:18 GMT+0000 (Coordinated Universal Time) https://lazyadmin.nl/win-11/disable-widgets-windows-11/

@Curable1600 ##windows

star

Fri Nov 03 2023 04:28:43 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=gQ58W7v8qyA&ab_channel=Codecademy

@cruz

star

Fri Nov 03 2023 03:46:56 GMT+0000 (Coordinated Universal Time)

@namnt

star

Fri Nov 03 2023 03:46:30 GMT+0000 (Coordinated Universal Time)

@namnt

star

Fri Nov 03 2023 03:08:58 GMT+0000 (Coordinated Universal Time)

@RahmanM #glidedatetime #pst

star

Fri Nov 03 2023 00:09:35 GMT+0000 (Coordinated Universal Time)

@Muhammad_Waqar

star

Thu Nov 02 2023 22:29:10 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/3526752/how-to-make-a-form-close-when-pressing-the-escape-key

@amman

star

Thu Nov 02 2023 22:29:01 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/1592876/make-a-borderless-form-movable

@amman

star

Thu Nov 02 2023 22:15:38 GMT+0000 (Coordinated Universal Time)

@Muhammad_Waqar

star

Thu Nov 02 2023 22:14:31 GMT+0000 (Coordinated Universal Time)

@Muhammad_Waqar

star

Thu Nov 02 2023 22:05:30 GMT+0000 (Coordinated Universal Time)

@shirnunn

star

Thu Nov 02 2023 21:01:08 GMT+0000 (Coordinated Universal Time)

@aditya443 #python

star

Thu Nov 02 2023 20:58:57 GMT+0000 (Coordinated Universal Time) https://code.visualstudio.com/docs/typescript/typescript-compiling

@blind_wanderer

star

Thu Nov 02 2023 20:58:54 GMT+0000 (Coordinated Universal Time) https://code.visualstudio.com/docs/typescript/typescript-compiling

@blind_wanderer

star

Thu Nov 02 2023 20:55:11 GMT+0000 (Coordinated Universal Time) https://www.sitepoint.com/javascript-event-delegation-is-easier-than-you-think/

@blind_wanderer

star

Thu Nov 02 2023 20:20:36 GMT+0000 (Coordinated Universal Time)

@vs #r

star

Thu Nov 02 2023 20:07:40 GMT+0000 (Coordinated Universal Time)

@alokmotion

star

Thu Nov 02 2023 16:12:38 GMT+0000 (Coordinated Universal Time)

@aatish

star

Thu Nov 02 2023 15:18:56 GMT+0000 (Coordinated Universal Time) https://fastapi.tiangolo.com/tutorial/sql-databases/

@hirsch

star

Thu Nov 02 2023 15:16:20 GMT+0000 (Coordinated Universal Time)

@vs #r

star

Thu Nov 02 2023 14:56:59 GMT+0000 (Coordinated Universal Time) https://amueller.github.io/aml/02-supervised-learning/08-decision-trees.html

@elham469

star

Thu Nov 02 2023 14:09:35 GMT+0000 (Coordinated Universal Time) https://www.codesdope.com/practice/cpp-constructor-overloading/

@yolobotoffender

star

Thu Nov 02 2023 13:19:30 GMT+0000 (Coordinated Universal Time)

@Justus #apex

star

Thu Nov 02 2023 08:08:29 GMT+0000 (Coordinated Universal Time)

@banch3v

star

Thu Nov 02 2023 04:35:49 GMT+0000 (Coordinated Universal Time) https://pub.dev/packages/isar

@ds007

star

Thu Nov 02 2023 00:27:25 GMT+0000 (Coordinated Universal Time) https://python.langchain.com/docs/use_cases/question_answering/vector_db_qa

@wesley7137 #python #langchain #vectorstore #chain

star

Wed Nov 01 2023 23:11:10 GMT+0000 (Coordinated Universal Time)

@vjg #javascript

star

Wed Nov 01 2023 22:31:51 GMT+0000 (Coordinated Universal Time)

@Mohamedshariif #java

star

Wed Nov 01 2023 20:52:13 GMT+0000 (Coordinated Universal Time) https://cheatography.com/goodphone/cheat-sheets/operating-systems/

@abhikash01

star

Wed Nov 01 2023 20:44:06 GMT+0000 (Coordinated Universal Time) https://steinbaugh.com/posts/posix.html

@abhikash01

star

Wed Nov 01 2023 20:39:29 GMT+0000 (Coordinated Universal Time) https://terminalcheatsheet.com/

@abhikash01

star

Wed Nov 01 2023 20:36:58 GMT+0000 (Coordinated Universal Time) https://www.sqlshack.com/sql-cheat-sheet-for-newbies/

@abhikash01

star

Wed Nov 01 2023 20:30:23 GMT+0000 (Coordinated Universal Time) https://devhints.io/webpack

@abhikash01

star

Wed Nov 01 2023 20:26:30 GMT+0000 (Coordinated Universal Time)

@abhikash01

star

Wed Nov 01 2023 20:22:58 GMT+0000 (Coordinated Universal Time) https://smoothprogramming.com/jquery/jquery-ajax-cheatsheet/

@abhikash01

star

Wed Nov 01 2023 20:19:49 GMT+0000 (Coordinated Universal Time) https://dev.to/codewithtee/javascript-dom-manipulation-cheatsheet-2d18

@abhikash01

star

Wed Nov 01 2023 20:13:18 GMT+0000 (Coordinated Universal Time) https://constellix.com/news/dns-record-types-cheat-sheet

@abhikash01

star

Wed Nov 01 2023 20:04:01 GMT+0000 (Coordinated Universal Time) https://devhints.io/http-status

@abhikash01

star

Wed Nov 01 2023 19:57:36 GMT+0000 (Coordinated Universal Time) https://malcoded.com/posts/angular-fundamentals-cli/

@abhikash01

star

Wed Nov 01 2023 19:54:21 GMT+0000 (Coordinated Universal Time) https://dev.to/abilashs003/rxjs-cheatsheet-15h9

@abhikash01

star

Wed Nov 01 2023 19:50:56 GMT+0000 (Coordinated Universal Time) https://devhints.io/npm

@abhikash01

star

Wed Nov 01 2023 19:46:59 GMT+0000 (Coordinated Universal Time) https://www.datacamp.com/cheat-sheet/git-cheat-sheet

@abhikash01

star

Wed Nov 01 2023 19:35:32 GMT+0000 (Coordinated Universal Time) https://www.typescriptlang.org/cheatsheets

@abhikash01

star

Wed Nov 01 2023 19:13:39 GMT+0000 (Coordinated Universal Time) https://shorturl.at/mxJTW

@abhikash01

star

Wed Nov 01 2023 18:59:39 GMT+0000 (Coordinated Universal Time)

@abhikash01

star

Wed Nov 01 2023 18:58:42 GMT+0000 (Coordinated Universal Time)

@abhikash01

Save snippets that work with our extensions

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