Snippets Collections
public class Test{
    public static int maximum(int a, int b){
        return a>b?a:b;
    }
    public static int maximum(int a, int b,int c){
        return (a>b&a>c)?a:((b>c)?b:c);
    }
    public static int maximum(int[] arr){
        int max=Integer.MIN_VALUE;
		for(int elem:arr){
          if(elem>arr)
            max=elem
        }
      	return max;
    }
}
public class TestDemo{
    public static void main(String[] args){
        System.out.println(Test.maximum(100,200));
        System.out.println(Test.maximum(10.05f,200.77f,20.55f));
      	int[] test=new int[] (1,2,3,4,5);
        System.out.println(Test.maximum(test));
    }
}
import java.util.*;
public class IncreasingDemo{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n;
        n = sc.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++){
            arr[i]=sc.nextInt();
        }
        for(int i=0;i<n;i++){
            System.out.println(arr[i]);
        }
    }
}
import java.util.*;
public class Person{
  private set ID;
  private String names;
  public void setdata(int no,String str){
    ID=no;
    name=str;
  }
  public show(){
    System.out.println(ID+" "+name);
  }
  public class PersonDemo{
    public static void main(String[] args){
      Person p1=new Person();
      show(p1);
      p1=setdata(101,"Person1");
      show(p1);
    }
  }
}
import java.util.*;
public class GcdDemo{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    System.out.println("Enter 2 marks: ");
    int n1=sc.nextInt();
    int n2=sc.nextInt();
    int res=gcd(n1,n2);
    System.out.println("GCD is: "+res);
  }
	private static int gcd(int a,int b){
      if(n2==0)
        return n1;
      return(gcd(n2,n1%n2))
    }
}
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -I PREROUTING -p tcp -d 192.168.1.0/24 --dport 2222 -j DNAT --to-destination 127.0.0.1:2222

sysctl -w net.ipv4.conf.eth0.route_localnet=1
<?php

use \Drupal\taxonomy\Entity\Term;

$vocabulariNew = ["ambit_laboral", "ambit_social", "ambit_educations"];
$path =  dirname(__FILE__) . '/data/all_terms.csv';

$newCsvData = [];
$rowFe = [];
$i = 0;

//delete todos los términos 
function _l($m, $level = 'INFO') {
  echo "$level | $m \n";
}

function _delete_terms($vid) {
  _l("Delete terms form vocabulari $vid");
  $tids = Drupal::entityQuery('taxonomy_term')
    ->accessCheck(FALSE)
    ->condition('vid', $vid)
    ->execute();

  if (empty($tids)) {
    return;
  }

  $term_storage = \Drupal::entityTypeManager()
    ->getStorage('taxonomy_term');
  $entities = $term_storage->loadMultiple($tids);

  $term_storage->delete($entities);
}

// foreach($vocabulariNew as $vid){
//   _delete_terms($vid);
// }

$csv_data = [];

$handle = fopen($path, "r");
if ($handle  !== FALSE) {

  while (($row = fgetcsv($handle, 1000, ",")) !== FALSE) {
    $i++;
    if($i == 1){
      continue;
    }

    $csv_data[] = $row;
   

    }
    fclose($handle);


    foreach ($csv_data as $row) {

      $terms = \Drupal::entityTypeManager()
      ->getStorage('taxonomy_term')
      ->loadTree($row[0]);
      $term_name = $row[2];
      $term_exists = false;
      $term_id = null;

      foreach ($terms as $term) {
        if ($term->name == $term_name) {
          $term_exists = true;
          $term_id = $term->tid;
          break;
        }
      }

      if (!$term_exists) {
        $term = Term::create([
          'name' => $row[2],
          'vid' => $row[0],
          'language' => 'es',
        ]);
        $term->addTranslation("ca", [
                  'name' => $row[1]
                ]);
        $term->save();
       $term_id = $term->id();
       }


      if ($term_exists && $term_id) {
        $term = Term::load($term_id);
        if($term->hasTranslation('ca')){
          $translation = $term->getTranslation('ca');
          $translation->set('name', $row[1]);
          $translation->save();
        }else{

          $term->addTranslation("ca", [
            'name' => $row[1]
          ]);
          
        }
        
        $term->save();
      }


    }

  }
   $vocNew = \Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')
        ->loadByProperties(['name' => $map[2]]);
      

      if (!empty($vocNew)) {
        $vocNew = reset($vocNew);
        $vocabulary_id = $vocNew->id();
      }
  $lang = \Drupal::service('language_manager')
      ->getCurrentLanguage()
      ->getId();

    $current_route_name = \Drupal::service('current_route_match')
      ->getRouteName();

    $filter_all_text = t('Todo');
    $filter_all_url = Url::fromRoute($current_route_name);
    $filter_all_url->setOptions([
      'attributes' => [
      'class' => [
        'btn-main-filter',
        ],
      ],
    ]);
1- sites/default/development.services.yml

parameters:
    session.storage.options: { gc_probability: 1, gc_divisor: 100, gc_maxlifetime: 200000, cookie_lifetime: 2000000 }
    twig.config: { debug: true, auto_reload: true, cache: false }
    renderer.config: { required_cache_contexts: ['languages:language_interface', theme, user.permissions], auto_placeholder_conditions: { max-age: 0, contexts: [session, user], tags: {  } } }
    http.response.debug_cacheability_headers: true
    factory.keyvalue: {  }
    factory.keyvalue.expirable: {  }
    filter_protocols: [http, https, ftp, news, nntp, tel, telnet, mailto, irc, ssh, sftp, webcal, rtsp]
    cors.config: { enabled: false, allowedHeaders: {  }, allowedMethods: {  }, allowedOrigins: ['*'], exposedHeaders: false, maxAge: false, supportsCredentials: false }
services:
    cache.backend.null:
        class: Drupal\Core\Cache\NullBackendFactory

2- en sites/default/setting.local.php
/**
 * Enable local development services.
 */
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
3- 

sites/default/setting.php
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {  include $app_root . '/' . $site_path . '/settings.local.php';
}
hook_preprocess_menu ($variables){
  $$menuItems = &$variables['items'];
  foreach ($menuItems as $idx => &$item) {


   $idx = explode(":",$idx);
   $i = \Drupal::entityTypeManager()->getStorage('menu_link_content')->loadByProperties(['uuid' => $idx]);
   $i= reset($i);
   $idParent = $i->getParentId();
   $idParent = explode(":",$idParent);
   $parent = \Drupal::entityTypeManager()->getStorage('menu_link_content')->loadByProperties(['uuid' => $idParent]);
   $parent= reset($parent);
 
  
   $j = MenuLinkContent::load($parent->id());
 
  
  $highlited = $j->field_highlighted_id->value;
  
  }
// este ejemplo se envia la misma pagina
    $url = Url::fromRoute('<front>');
    return Link::fromTextAndUrl($minisite->label(), $url)->toRenderable();
// file modules/custom/mymodule/mymodule.module



/**
 * Implements hook_form_alter().
 */
function henka_training_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  if ($form_id == 'user_login_form') {
     $form['#submit'][] = 'redirect_submit_handler';
  }
}

/**
* Custom submit handler for login form.
*/
function redirect_submit_handler($form, FormStateInterface $form_state) {
   $url = Url::fromUri('internal:/formacion'); 
  // or $url = Url::fromRoute('view.VIEW_MACHINE_NAME.PAGE_MACHINENAME');
  //example  $url = Url::fromRoute('view.henka_training.page_training');
   $form_state->setRedirectUrl($url);
}
<?php

// module custom /src/Plugin/views/filter/CustomFilter.php
// ejemplo en smsjd_druplal
<?php

namespace Drupal\sm_utils\Plugin\views\filter;

use Drupal\views\Plugin\views\display\DisplayPluginBase;
use Drupal\views\Plugin\views\filter\InOperator;
use Drupal\views\ViewExecutable;


/**
 * Filters by current tags.
 *
 * @ingroup views_filter_handlers
 *
 * @ViewsFilter("som360_node_revelance_filter")
 */
class CurrentNodeRevelanceFilter extends InOperator {

  /**
   * {@inheritdoc}
   */
  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
    parent::init($view, $display, $options);
    $this->valueTitle = $this->t('Current Tags');
    $this->definition['options callback'] = [$this, 'generateOptions'];
  }

  /**
   * {@inheritdoc}
   */
  public function operators() {
    return [
      '=' => [
        'title' => $this->t('Is equal to'),
        'short' => $this->t('='),
        'method' => 'opFilterNodeRevelance',
        'values' => 1,
      ],
      '!=' => [
        'title' => $this->t('Is not equal to'),
        'short' => $this->t('!='),
        'method' => 'opFilterNodeRevelance',
        'values' => 1,
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function query() {
    // Override the query
    // So that no filtering takes place if the user doesn't select any options.
    if (!empty($this->value)) {
      parent::query();
    }
  }

  /**
   * {@inheritdoc}
   */
  public function validate() {
    // Skip validation
    // If no options have been chosen so we can use it as a non-filter.
    if (!empty($this->value)) {
      parent::validate();
    }
  }

  /**
   * Helper function that generates the options.
   *
   * @return string[]
   */
  public function generateOptions() {
    return [
      'current_tag' => t('Current tags'),
    ];
  }

  /**
   * Add SQL condition to filter by.
   */
  protected function opFilterNodeRevelance() {
    if (empty($this->value)) {
      return;
    }

    $this->ensureMyTable();
    $mid = 1854;
   // $field =  'node__field_ref_minisites.field_ref_minisites_target_id';
    $field = 'node_field_data.nid';
   
    $this->query->addWhereExpression($this->options['group'], "$field $this->operator $mid");
  }


}

//en sm_utils.module


/**
 * Implements hook_views_data_alter()
 *
 * Register a new filter to be used in views in this project.
 * Logic is defined in src/views/filter/CurrentNodeRevelanceFilter.php
 */
function sm_utils_views_data_alter(&$data) {

   
  $data['node_field_data']['node_revelance_filter'] = [
    'label' => t('Custom tags filter'),
    'title' => t('Current tags'),
    'group' => t('Custom Filters'),
    'filter' => [
      'title' => t('Current tags'),
      'help' => t('Filters nodes that belong to current tags'),
      'field' => 'smsjdnode_field_data',
      'id' => 'som360_node_revelance_filter',
    ],
  ];

}
// en config/schema.yml

views.filter.som360_node_revelance_filter:
  type: views.filter.in_operator
  label: 'Current tags'
git init --initial-branch=main
git remote add origin git@gitlab.com:omada-dev/irjsg-150.git
git add .
git commit -m "Initial commit"
git push --set-upstream origin main
<?php


# vendor/bin/drush php-script web/modules/custom/henka_utils/scripts/create_user.php

use Drupal\user\Entity\User;



$path = dirname(__FILE__) . '/users.csv';


$i = 0;

$handle = fopen($path, "r");
if ($handle !== FALSE) {
  while (($row = fgetcsv($handle, 1000, ",")) !== FALSE) {
    $i++;
    if ($i == 1) {
      continue;
    }

    $user = User::create([
      'mail' => $row[0],
      'field_name' => $row[1],
      'field_surname' => $row[2],
    ]); 
    $user->activate();
    $user->addRole('teacher');
    $user->save();
  }
  fclose($handle);
}
Listen 10151
<VirtualHost *:10151>
  DocumentRoot /var/www/intercat-drupal8/web
  <Directory /var/www/intercat-drupal8/web>
    AllowOverride All
    Require all granted
  </Directory>
</VirtualHost>
 $url = Url::fromUri('//' . $minisite_url);  for fix the invalid URL shema
\Drupal::request()->getScheme()  ======> return http://
\Drupal::request()->getSchemeAndHttpHost()  ======> return http://localhost/es 
<?php 
//if you want show in every li of menu diferent onformation of node sigue instruction(2) 
// in theme 
function themName_preprocess_menu(&$variables){
  $node = Node::load(2311);
  $view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
  $teaser_view = $view_builder->view($node, 'teaser');
  $variables['teaser'] = \Drupal::service('renderer')->renderRoot($teaser_view);

  //instruction(2)
    $ar = [];
  $i = 0 ;
  $ids = \Drupal::entityQuery('node')
         ->condition('status', 1)
         ->condition('type', 'blog')
         ->range(0, 30) 
         ->execute();

  foreach ($ids as $key => $value) {
    $ar[] = $value;
  }

  $menuItems = &$variables['items'];

  foreach ($menuItems as $idx => &$item) {
    $node = Node::load($ar[rand(0,30)]);
    if(empty($node)){
     continue;
    }
    $view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
    $teaser_view = $view_builder->view($node, 'teaser');
    $item['#node']= \Drupal::service('renderer')->renderRoot($teaser_view);
    // in twig corespon print foreach($item in $items){  <li> {{ $item['#node }}  </li> }
  }
  
}

// in twig menu.html.twig

//{{ teaser }}
$file = File::create([
  'uri' => $data['image']['url'],
]);
  $file->save();
$media = Media::create([
  'bundle' => 'image', 
  'field_origin_id' => $data['image']['id'],
  'field_fecha' => time(),
  'field_media_image' => [
    'target_id' => $file->id(),
    'title' => $data['image']['title']['es'],
    'alt' => $data['image']['alt']['es'],
  ],
  ]);
  $media->save();
$node->field_ref_image = $media;
$node->save();
example sitges web//modules/custom/sff_warnings
https://befused.com/drupal/ultimate-cron/
ejemplo en smsjd_drupal omg_ga_reporting.module
ejemplo sitges sff_warning module
1- install ultimate_cron -> activate
2- in custom module /file.module 
  crear 
   function custom_module_cron() {
    \Drupal::logger('custom_utility')->notice('Cron ran');
  }
3- Hit the Discover jobs button and the job you created above will appear on the list.
4- copy configuration localhost:10162/es/admin/config/development/configuration/single/export

  trabajo del cron and nombre que has creado in module 
  pega en imprendincible  que el file en config llamma ultimate_cron.job.unnombrequeqieres.yml  
  config/utility_cron.job.nombre.yml like this 
   langcode: ca
status: true
dependencies:
  module:
    - sff_warnings
title: 'Publish and Unpublish warnings based on dates'
id: sff_warnings_publish_warnings_cron
weight: 0
module: sff_warnings
callback: sff_warnings_publish_warnings_cron
scheduler:
  id: simple
launcher:
  id: serial
logger:
  id: database
in module elimina el function
crear otra del nombre callback like sff_warnings_publish_warnings_cron and put you logica
importa configuracion con comando druash
drush config-import --source=modules/custom/custom_utility/config --partial -y
<?php

namespace Drupal\irsjg_home\Plugin\DsField;

use Drupal\ds\Plugin\DsField\DsFieldBase;
use \Drupal\views\Views;


// ejemplo irsjg_hom/src/Plugin/videosMasReciente.php
/**
 * Provides a custom DsField to display home header as field
 *
 * @DsField(
 *   id = "irsjg_home_video_field",
 *   title = @Translation("IRSJG Home | Video más reciente"),
 *   entity_type = "node",
 *   provider = "irsjg_home",
 *   ui_limit = {"home|full"}
 * )
 */

class HomeMasReciente extends DsFieldBase {

  /**
   * {@inheritdoc}
   */
  public function build() {

    $view = Views::getView('irsjg_homepage_slicks');
    if (!is_object($view)) {
      return;
    }
   
    $view->setDisplay('block_home_video_slider');
    $view->preExecute();
    $view->execute();
    $view->element['#attached']['library'][] = 'irsjg_home/video_slider';
    $content = $view->buildRenderable('block_home_video_slider');  

    return $content;
    
  }

}
    $view = Views::getView('irsjg_homepage_slicks');

    if (!is_object($view)) {
      return;
    }
   
    $view->setDisplay('block_home_video_slider');
    $view->preExecute();
    $view->execute();
    $view->element['#attached']['library'][] = 'irsjg_home/video_slider';
  
   $rendered = $view->render();
   $output = \Drupal::service('renderer')->render($rendered);

   return [
     ['#markup' => $output]
   ];
 // orrrrrrrrrrr


    $view = Views::getView('irsjg_homepage_slicks');

    if (!is_object($view)) {
      return;
    }
   
    $view->setDisplay('block_home_video_slider');
    $view->preExecute();
    $view->execute();
    $view->element['#attached']['library'][] = 'irsjg_home/video_slider';
    $content = $view->buildRenderable('block_home_video_slider');  
 
    return $content;
// irsjg->home module DS fiedl HomeHeaderField
 $build = \Drupal::entityTypeManager()->getViewBuilder('media');
$a = $build->view($url, 'token');
$output = \Drupal::service('renderer')->render($a);     
$video['uri'] = $output;
$node = \Drupal::entityTypeManager()->getStorage('user')->load($e->id());
$users[] = \Drupal::service('entity_type.manager')->getViewBuilder('user')->view($node, 'contact_equip');


// render web from
 $webform = \Drupal::entityTypeManager()->getStorage('webform')->load('contacto_profesional');
   $view_builder = \Drupal::service('entity_type.manager')->getViewBuilder('webform');
A recent gaming trend and user preference for playing fantasy sports games. As a result, fancy sports game companies have benefited from gaining more profit and attracting more business in the game market. A real-life best-example app is Dream11. This is the first company in India to showcase this unique trend of fancy sports games for Indians and succeed in the Indian market, apart from other parts of the world, with their branding. As well, you can build your desired business by using our Dream11 clone app to kickstart your business journey with affordable market pricing compared to others. Not only that, we offer Dream11 clone scripts, Dream11 clone app development, and a website with more user-centric customization depending upon their client needs. Utilize this perfect opportunity to build your own fantasy sports mobile app for your business.
class D
{
    public static void main(String[] args){
        try
        {
            m1();
        }
        catch(Exception m)
        {
            System.out.println("exception handeld ");
        }
    }
    public static void m1()
    {
        m2();
    }
    public static void m2()
    {
        System.out.println(10/0);
       
    }
}
class InvalidAgeException extends Exception
{
    InvalidAgeException(String msg)
    {
        System.out.println(msg);
    }
}
class test
{
    public static void vote(int age) throws InvalidAgeException
    {
        if(age<18)
        {
            throw new InvalidAgeException("not eligible for voting");
        }
        else
        {
            System.out.println("Eligible for voting ");
        }
    }
    public static void main(String[] args){
    
    try
    {
        vote(12);
    }
    catch(Exception d)
    {
        System.out.println(d);
    }
    }
}
while True:
    try:
        marks = float(input('Enter your marks to calculate your grade: \n'))
    except ValueError:
        print('Invalid input, try again')
        continue
    if marks > 100:
        print('your input must not be greater than 100')
    else:
        break

if 85 <= marks <= 100:
    print('You have grade A')
elif 65 <= marks < 85:
    print('You have grade B')
elif 41 <= marks < 65:
    print('You have grade C')
elif 0 <= marks < 41:
    print('You failed')
else:
    print('Invalid Marks')
Here's a guide on how to start developing poker software, outlining key steps and code structure:

1. Define the Scope of Your Project:

    Game Variants: Choose which poker variants you'll include (e.g., Texas Hold'em, Omaha, 5-Card Draw).
    Features: Decide on essential features like player accounts, gameplay, betting, tournaments, chat, and multi-platform compatibility.
    Target Platforms: Determine if you're developing for web, desktop, mobile, or a combination.

2. Choose Your Programming Language and Development Environment:

    Common Languages: Python, Java, C++, C#, and JavaScript are popular choices for game development.
    Development Environments: Select an IDE (Integrated Development Environment) like Visual Studio Code, PyCharm, or Eclipse for efficient coding.

3. Structure Your Code:

    Classes: Create classes for representing cards, decks, hands, players, game tables, and the game logic itself.
    Functions: Write functions to handle shuffling, dealing, betting, evaluating hands, and managing game flow.

4. Implement Core Functionalities:

    Card Deck: Create a class to represent a deck of cards, with methods for shuffling and dealing cards.
    Player Hand: Implement a class to hold a player's hand, with methods for evaluating hand strength.
    Game Logic: Write the core game logic, including betting rounds, hand comparisons, and pot management.

5. Design the User Interface (UI):

    Visual Design: Create visually appealing UI elements using graphics libraries or frameworks.
    User Interaction: Implement intuitive controls for players to interact with the game.

6. Test Thoroughly:

    Unit Testing: Test individual code units to ensure they function as intended.
    Integration Testing: Verify that different parts of the code work together seamlessly.
    User Testing: Gather feedback from real users to identify bugs and areas for improvement.

7. Deploy and Maintain:

    Deployment: Make your poker software available to users on your chosen platforms.
    Maintenance: Address any bugs or issues, and update the software with new features or improvements over time.
import axios from "axios"; //Check this for more information

const [user, SetUser] = useState({
  name = "",
  username = "",
  email = "",
});

const { name, username, email } = user;

const onInputChange = (e) => {
  setUser({ ...user, [e.target.name]: e.target.value }); //This will append info when type
}

const onSubmit = async (e) => {
  e.preventDefault(); //This will prevent showing info in url.
  await axios.post("https://localhost:8080/user") //Link to backend server
  //We use async and await here to guarantee get the data before submit.
};

<form onSubmit = {(e) => onSubmit(e)}>
  <input
	value={name}
	onChange={(e) => onInputChange(e)}
	/>
</form>
class D
{
   public static void Wait() throws InterruptedException
    {
        for(int i=0;i<=10;i++)
        {
            System.out.println(i);
            Thread.sleep(1000);
            
        }
    }
    public static void main(String[] args) 
{
    try
    {
        Wait();
        System.out.println(10/0);
       
    }
    catch(Exception s)
    {
        System.out.println("some error find");
    }
}
}
class D
{
   public static void Wait() throws InterruptedException
    {
        for(int i=0;i<=10;i++)
        {
            System.out.println(i);
            Thread.sleep(1000);
            
        }
    }
    public static void main(String[] args) throws InterruptedException
    {
        Wait();
        System.out.println("some error find");
    }
}
class D
{
    void div(int a, int b) throws ArithmeticException
    {
        if (b == 0)
        {
            throw new ArithmeticException();
        }
        else
        {
            int c = a / b;
            System.out.println(c);
        }
    }

    public static void main(String[] args)
    {
        D r = new D(); // Fix the typo here
        try
        {
            r.div(10, 0);
        }
        catch (Exception e)
        {
            System.out.println("We cannot divide by 0");
        }
    }
}
class F
{
    public static void main(String[] args) throws InterruptedException
    {
        for(int i=1;i<=10;i++)
        {
            System.out.println(i);
            Thread.sleep(1000);
        }
    }
}
#include <stdio.h>

int main()
{
    int a, b, c, d, e, total;
    
    printf("Total miles driven per day:");
    scanf("%d", &a);
    printf("Cost per gallon of gasoline:");
    scanf("%d", &b);
    printf("Average miles per gallon:");
    scanf("%d", &c);
    printf("Parking fees per days:");
    scanf("%d", &d);
    printf("Tolls per day:");
    scanf("%d", &e);
    
    
    total = (a/c)*b+d+e;
    printf("Cost per Day: %d", total);
    
 
    return 0;
}
#include <stdio.h>

int main()
{
    float radius, diameter, circumference, area, pi=3.14;
    printf("Enter radius:");
    scanf("%f", &radius);
    
    printf("\nDiameter is %.2f\n", radius*2);
    printf("circumference is %.2f\n", 2*radius*pi);
    printf("Area is %.2f\n", pi*radius*radius);
    
    

    return 0;
}
09:22:48.[810716]	>>	======================================================================

09:22:48.[815805]	>>	                                                GET DATA FROM ANALYZER

09:22:48.[821361]	>>	======================================================================

09:22:48.[826293]	>>	 

09:22:48.[831255]	>>	R:	<ENQ>

09:22:48.[848398]	>>	S:	<ACK>

09:22:48.[856375]	>>	---

09:22:48.[994730]	>>	R:	<STX>1H|\^&|||99^2.00|||||||P|1.00|20240118084708<CR><ETX>21<CR><LF>

09:22:49.[023133]	>>	S:	<ACK>

09:22:49.[032325]	>>	---

09:22:49.[054270]	>>	Mode [P]: Production Mode

09:22:49.[163194]	>>	R:	<STX>2P|1|||^^^<CR><ETX>CD<CR><LF>

09:22:49.[193582]	>>	S:	<ACK>

09:22:49.[203532]	>>	---

09:22:49.[347893]	>>	R:	<STX>3O|1|670219483304|||R<CR><ETX>F0<CR><LF>

09:22:49.[369834]	>>	S:	<ACK>

09:22:49.[380804]	>>	---

09:22:49.[512006]	>>	R:	<STX>4R|1|^^^1|57.0|sec||||F||||<CR><ETX>2D<CR><LF>

09:22:49.[549618]	>>	S:	<ACK>

09:22:49.[563122]	>>	---

09:22:49.[626420]	>>	Insert LN: 6702194833 Barcode: 670219483304 Anacode: 1 Test Code: OL011 Result: 57 Status:  Result Flag: - Flag1: F complete!!!

09:22:49.[886168]	>>	---

09:22:50.[001793]	>>	R:	<STX>5M|1|A|C<CR><ETX>BB<CR><LF>

09:22:50.[025731]	>>	S:	<ACK>

09:22:50.[033966]	>>	---

09:22:50.[176947]	>>	R:	<STX>6R|2|^^^2|5.23|INR||||F||||<CR><ETX>DD<CR><LF>

09:22:50.[206310]	>>	S:	<ACK>

09:22:50.[219075]	>>	---

09:22:50.[280086]	>>	Insert LN: 6702194833 Barcode: 670219483304 Anacode: 2 Test Code: HM045 Result: 5.23 Status:  Result Flag: - Flag1: F complete!!!

09:22:50.[437811]	>>	---

09:22:50.[560267]	>>	R:	<STX>7M|2|A|C<CR><ETX>BE<CR><LF>

09:22:50.[588627]	>>	S:	<ACK>

09:22:50.[601312]	>>	---

09:22:50.[736161]	>>	R:	<STX>0L|1|N<CR><ETX>03<CR><LF>

09:22:50.[770972]	>>	S:	<ACK>

09:22:50.[784905]	>>	---

09:22:50.[923674]	>>	R:	<EOT>

09:22:59.[346006]	>>	 

09:22:59.[351735]	>>	======================================================================

09:22:59.[356728]	>>	                                                GET DATA FROM ANALYZER

09:22:59.[362236]	>>	======================================================================

09:22:59.[367223]	>>	 

09:22:59.[372206]	>>	R:	<ENQ>

09:22:59.[390059]	>>	S:	<ACK>

09:22:59.[398150]	>>	---

09:22:59.[535139]	>>	R:	<STX>1H|\^&|||99^2.00|||||||P|1.00|20240118084719<CR><ETX>23<CR><LF>

09:22:59.[562065]	>>	S:	<ACK>

09:22:59.[571069]	>>	---

09:22:59.[595632]	>>	Mode [P]: Production Mode

09:22:59.[705522]	>>	R:	<STX>2P|1|||^^^<CR><ETX>CD<CR><LF>

09:22:59.[739065]	>>	S:	<ACK>

09:22:59.[747136]	>>	---

09:22:59.[886041]	>>	R:	<STX>3O|1|670219483304|||R<CR><ETX>F0<CR><LF>

09:22:59.[917131]	>>	S:	<ACK>

09:22:59.[931063]	>>	---

09:23:00.[064944]	>>	R:	<STX>4R|1|^^^3|43.0|sec||||F||||<CR><ETX>2A<CR><LF>

09:23:00.[080901]	>>	S:	<ACK>

09:23:00.[088882]	>>	---

09:23:00.[116805]	>>	---

09:23:00.[225514]	>>	R:	<STX>5M|1|A|D<CR><ETX>BC<CR><LF>

09:23:00.[254735]	>>	S:	<ACK>

09:23:00.[262844]	>>	---

09:23:00.[407672]	>>	R:	<STX>6R|2|^^^4|1.50|Ratio||||F||||<CR><ETX>F1<CR><LF>

09:23:00.[433602]	>>	S:	<ACK>

09:23:00.[441579]	>>	---

09:23:00.[463145]	>>	---

09:23:00.[586856]	>>	R:	<STX>7M|2|A|D<CR><ETX>BF<CR><LF>

09:23:00.[615360]	>>	S:	<ACK>

09:23:00.[623114]	>>	---

09:23:00.[767193]	>>	R:	<STX>0R|3|^^^5|28.7|Ref.T||||F||||<CR><ETX>98<CR><LF>

09:23:00.[790163]	>>	S:	<ACK>

09:23:00.[799105]	>>	---

09:23:00.[822734]	>>	---

09:23:00.[954203]	>>	R:	<STX>1M|3|A|D<CR><ETX>BA<CR><LF>

09:23:00.[984525]	>>	S:	<ACK>

09:23:00.[997605]	>>	---

09:23:01.[139234]	>>	R:	<STX>2L|1|N<CR><ETX>05<CR><LF>

09:23:01.[170408]	>>	S:	<ACK>

09:23:01.[181377]	>>	---

09:23:01.[302864]	>>	R:	<EOT>

09:33:26.[735700]	>>	 

09:33:26.[741439]	>>	======================================================================

09:33:26.[746656]	>>	                                                GET DATA FROM ANALYZER

09:33:26.[752218]	>>	======================================================================

09:33:26.[757308]	>>	 

09:33:26.[762294]	>>	R:	<ENQ>

09:33:26.[782471]	>>	S:	<ACK>

09:33:26.[790754]	>>	---

09:33:26.[927056]	>>	R:	<STX>1H|\^&|||99^2.00|||||||Q|1.00|20240118085746<CR><ETX>25<CR><LF>

09:33:26.[958920]	>>	S:	<ACK>

09:33:26.[965901]	>>	---

09:33:26.[988125]	>>	Mode [Q]: QC Result Mode, Ignore!!!

09:33:27.[100549]	>>	R:	<STX>2P|1|||<CR><ETX>B3<CR><LF>

09:33:27.[135208]	>>	S:	<ACK>

09:33:27.[154673]	>>	---

09:33:27.[295887]	>>	R:	<STX>3O|1|12351|||R<CR><ETX>7D<CR><LF>

09:33:27.[321569]	>>	S:	<ACK>

09:33:27.[328550]	>>	---

09:33:27.[460634]	>>	R:	<STX>4R|1|^^^1|14.7|sec||||F||||20240118085746<CR><ETX>FD<CR><LF>

09:33:27.[491131]	>>	S:	<ACK>

09:33:27.[498844]	>>	---

09:33:27.[630424]	>>	R:	<STX>5M|1|A|@<CR><ETX>B8<CR><LF>

09:33:27.[660085]	>>	S:	<ACK>

09:33:27.[668317]	>>	---

09:33:27.[808325]	>>	R:	<STX>6L|1|N<CR><ETX>09<CR><LF>

09:33:27.[832260]	>>	S:	<ACK>

09:33:27.[840673]	>>	---

09:33:27.[975506]	>>	R:	<EOT>
class MyThread extends Thread {
    public void run() {
        for (int i = 1; i <= 5; i++) {
            System.out.println("Thread: " + i);
        }
    }
}

class MyRunnable implements Runnable {
    public void run() {
        for (int i = 1; i <= 5; i++) {
            System.out.println("Runnable: " + i);
        }
    }
}

public class ThreadExample {
    public static void main(String[] args) {
        MyThread thread = new MyThread();
        thread.start();

        Thread runnableThread = new Thread(new MyRunnable());
        runnableThread.start();
    }
}
import java.awt.*;
import javax.swing.*;
class border{
JFrame frame;
border(){
frame=new JFrame();
             JButton box1=new JButton("**NORTH**");
             JButton box2=new JButton("**SOUTH**");
             JButton box3=new JButton("**EAST**");
             JButton box4=new JButton("**WEST**");
             JButton box5=new JButton("**CENTER**");

              frame.add(box1,BorderLayout.NORTH);
              frame.add(box2,BorderLayout.SOUTH);
              frame.add(box3,BorderLayout.EAST);
              frame.add(box4,BorderLayout.WEST);
              frame.add(box5,BorderLayout.CENTER);

              frame.setSize(300,300);
              frame.setVisible(true);
              
}
public static void main(String args[])
{
       new border();
}
}
class Producer implements Runnable {
    Buffer buffer;

    Producer(Buffer buffer) {
        this.buffer = buffer;
        new Thread(this, "Producer").start();
    }

    public void run() {
        for (int i = 0; i < 5; i++) {
            buffer.put(i);
            System.out.println("Produced: " + i);
        }
    }
}

class Consumer implements Runnable {
    Buffer buffer;

    Consumer(Buffer buffer) {
        this.buffer = buffer;
        new Thread(this, "Consumer").start();
    }

    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println("Consumed: " + buffer.get());
        }
    }
}

public class SynchronizationExample {
    public static void main(String[] args) {
        Buffer buffer = new Buffer();
        new Producer(buffer);
        new Consumer(buffer);
    }
}
package xyzpackage;
import abcpackage.Package1;
public class Package2{
        public static void main(String args[]){
        Package1 p=new Package1();
        p.input();
        p.calculate();
}
}
package abcpackage;
import java.util.Scanner;
public class Package1
{
       Scanner sc=new Scanner(System.in);
       
       int a,b,sum; 
       double avg;
       
       public void input(){
        a=sc.nextInt();
        b=sc.nextInt();
       }
       public void calculate(){
       sum=a+b;
       avg=sum/2;

       System.out.println("sum"+sum);
       System.out.println("avg"+avg);
}
}
package abcpackage;
import java.util.Scanner;
public class Package1
{
       Scanner sc=new Scanner(System.in);
       
       int a,b,sum; 
       double avg;
       
       public void input(){
        a=sc.nextInt();
        b=sc.nextInt();
       }
       public void calculate(){
       sum=a+b;
       avg=sum/2;

       System.out.println("sum"+sum);
       System.out.println("avg"+avg);
}
}
import java.util.ArrayList;

class Account {
    protected String accountNumber;
    protected double balance;

    public Account(String accountNumber, double balance) {
        this.accountNumber = accountNumber;
        this.balance = balance;
    }

    public void deposit(double amount) {
        balance += amount;
        System.out.println("Deposited: $" + amount);
        printBalance();
    }

    public void withdraw(double amount) {
        if (amount <= balance) {
            balance -= amount;
            System.out.println("Withdrawn: $" + amount);
        } else {
            System.out.println("Insufficient funds");
        }
        printBalance();
    }

    public void printBalance() {
        System.out.println("Current Balance: $" + balance);
    }
}

class SavingsAccount extends Account {
    private double interestRate;

public SavingsAccount(String accountNumber, double balance, double interestRate) {
        super(accountNumber, balance);
        this.interestRate = interestRate;
    }

    public void applyInterest() {
        balance += balance * interestRate;
        System.out.println("Interest applied. Updated Balance: $" + balance);
    }
}

class CheckingAccount extends Account {
    private double overdraftLimit;

    public CheckingAccount(String accountNumber, double balance, double overdraftLimit) {
        super(accountNumber, balance);
        this.overdraftLimit = overdraftLimit;
    }

    @Override
    public void withdraw(double amount) {
        if (amount <= balance + overdraftLimit) {
            balance -= amount;
            System.out.println("Withdrawn: $" + amount);
        } else {
            System.out.println("Exceeded overdraft limit");
        }
        printBalance();
    }
}

class Customer {
    private String name;
    private ArrayList<Account> accounts;

    public Customer(String name) {
        this.name = name;
        this.accounts = new ArrayList<>();
    }

    public void addAccount(Account account) {
        accounts.add(account);
        System.out.println(name + " added an account: " + account.accountNumber);
    }

    public void printAccounts() {
        System.out.println(name + "'s Accounts:");
        for (Account account : accounts) {
            System.out.println(account.accountNumber);
        }
    }
}

class Employee {
    private String name;

    public Employee(String name) {
        this.name = name;
    }

    public void processTransaction(Account account, double amount) {
        account.deposit(amount);
    }
}

public class BankingApplication {
    public static void main(String[] args) {
        Customer customer1 = new Customer("John Doe");
        SavingsAccount savingsAccount = new SavingsAccount("SA123", 1000.0, 0.02);
        CheckingAccount checkingAccount = new CheckingAccount("CA456", 500.0, 200.0);

        customer1.addAccount(savingsAccount);
        customer1.addAccount(checkingAccount);
        customer1.printAccounts();

        Employee bankEmployee = new Employee("Bank Employee");
        bankEmployee.processTransaction(savingsAccount, 200.0);
        bankEmployee.processTransaction(checkingAccount, 300.0);

        savingsAccount.applyInterest();
    }
}
class D
{
    public static void main(String[] args){
        //System.out.println(10/0);
        throw new ArithmeticException("not divide it by 0");
    }
}
SELECT ProductID, ProductName, CategoryName
FROM Products
INNER JOIN Categories ON Products.CategoryID = Categories.CategoryID;
​
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
LEFT JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;
​
star

Thu Jan 18 2024 17:29:32 GMT+0000 (Coordinated Universal Time)

@login

star

Thu Jan 18 2024 17:15:35 GMT+0000 (Coordinated Universal Time)

@login

star

Thu Jan 18 2024 17:15:15 GMT+0000 (Coordinated Universal Time)

@login

star

Thu Jan 18 2024 17:08:27 GMT+0000 (Coordinated Universal Time)

@login

star

Thu Jan 18 2024 17:06:45 GMT+0000 (Coordinated Universal Time) https://askubuntu.com/questions/444729/redirect-port-80-to-8080-and-make-it-work-on-local-machine

@p0ir0t

star

Thu Jan 18 2024 17:06:17 GMT+0000 (Coordinated Universal Time) https://unix.stackexchange.com/questions/111433/iptables-redirect-outside-requests-to-127-0-0-1

@p0ir0t #bash

star

Thu Jan 18 2024 16:22:30 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 16:20:04 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 16:17:06 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 15:40:35 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 15:38:07 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 15:32:38 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 15:28:25 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 14:17:27 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 14:16:10 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 14:15:27 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 14:12:08 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 14:06:23 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 14:02:34 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 13:55:05 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 13:44:45 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 13:42:02 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 13:38:59 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 13:36:31 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 13:35:11 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 13:33:27 GMT+0000 (Coordinated Universal Time)

@saida

star

Thu Jan 18 2024 13:17:32 GMT+0000 (Coordinated Universal Time) https://appticz.com/dream11-clone-app

@aditi_sharma_ #dream11 #dream11clone #dream11cloneapp #dream11cloneapp

star

Thu Jan 18 2024 13:08:49 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Thu Jan 18 2024 11:24:30 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Thu Jan 18 2024 11:01:45 GMT+0000 (Coordinated Universal Time)

@mwebrania #python

star

Thu Jan 18 2024 10:06:32 GMT+0000 (Coordinated Universal Time) https://www.orioninfosolutions.com/poker-game-development.php

@dckumawatorion #poker #software #php #html #css #design

star

Thu Jan 18 2024 08:05:14 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=4LZKnegAm4g

@KhanhDu #javascript

star

Thu Jan 18 2024 07:55:54 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Thu Jan 18 2024 07:52:14 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Thu Jan 18 2024 07:04:01 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Thu Jan 18 2024 06:39:35 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Thu Jan 18 2024 04:27:00 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #ilink

star

Thu Jan 18 2024 00:11:21 GMT+0000 (Coordinated Universal Time)

@exam

star

Thu Jan 18 2024 00:08:49 GMT+0000 (Coordinated Universal Time)

@exam

star

Thu Jan 18 2024 00:06:54 GMT+0000 (Coordinated Universal Time)

@exam

star

Thu Jan 18 2024 00:06:04 GMT+0000 (Coordinated Universal Time)

@exam

star

Thu Jan 18 2024 00:05:35 GMT+0000 (Coordinated Universal Time)

@exam

star

Thu Jan 18 2024 00:05:34 GMT+0000 (Coordinated Universal Time)

@exam

star

Thu Jan 18 2024 00:04:47 GMT+0000 (Coordinated Universal Time)

@exam

star

Wed Jan 17 2024 06:45:00 GMT+0000 (Coordinated Universal Time)

@E23CSEU1151 #java

star

Wed Jan 17 2024 01:13:08 GMT+0000 (Coordinated Universal Time) https://www.w3schools.com/sql/trysql.asp?filename

@ivantan #undefined

star

Wed Jan 17 2024 01:13:02 GMT+0000 (Coordinated Universal Time) https://www.w3schools.com/sql/trysql.asp?filename

@ivantan #undefined

Save snippets that work with our extensions

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