Arnab Chakraborty has Published 32 Articles

Java regex to exclude a specific String constant

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Sep-2024 02:51:09

2K+ Views

In this program, we will use a regular expression to check if a given string does not contain the substring "kk" using Java. The regular expression ^((?!kk).)*$ is designed to match strings that do not include the "kk" pattern anywhere in the string. The program will evaluate a sample string ... Read More

How to validate a form using jQuery?

Arnab Chakraborty

Arnab Chakraborty

Updated on 09-Sep-2023 23:26:40

32K+ Views

At first you have to make a html form like. Validation of a form First name: Last name: Email: Now use jQuery validation plugin to validate forms' data in easier way.first, add jQuery library in your file. then ... Read More

How to process a simple form data using Python CGI script?

Arnab Chakraborty

Arnab Chakraborty

Updated on 09-Sep-2023 23:02:23

4K+ Views

Suppose there is an HTML file as below − FirstName: LastName: After submitting this form it should go to a Python page named "getData.py", where you should fetch the data from this HTML page and show. ... Read More

How can I remove all child elements of a DOM node in JavaScript?

Arnab Chakraborty

Arnab Chakraborty

Updated on 11-Aug-2022 10:45:43

14K+ Views

Suppose you are building a web app that manages the data of daily tasks, the user inserts the task and a list of tasks gets formed. But at some point in time, the user wants to remove all the tasks from the list and wants to make the list empty. ... Read More

How to horizontally center a

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Dec-2021 06:36:55

306 Views

Here I have one html form and one css file(style.css).”o-div” is the outer div and “i-div“is the inner div class.Example           center a div                              I am OUTER DIV   ... Read More

How to test if a Java String contains a case insensitive regex pattern

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jun-2020 07:29:15

383 Views

the syntax? i:x makes the string search case-insensitive. for egpublic class RegCaseSense {    public static void main(String[] args) {       String stringSearch = "HI we are at java class.";       // this won't work because the pattern is in upper-case       System.out.println("Try ... Read More

Can someone help me fix this Python Program?

Arnab Chakraborty

Arnab Chakraborty

Updated on 24-Jun-2020 07:26:01

116 Views

The first problem u are getting in the bold portion is due to non-indent block, put one indentation there.second problem is name variable is not definedfollowing is the corrected one -print ("Come-on in. Need help with any bags?") bag=input ('(1) Yes please  (2) Nah, thanks   (3) Ill get em ... Read More

How to use enums in Python classes?

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Jun-2020 14:47:21

255 Views

There is a module name "enum" in python with the hep of which enum is used in python.#import enum import enum # use enum in class class Car(enum.Enum):    suzuki = 1    Hyundai = 2    Dezire = 3 print ("All the enum values are : ") for c in (Car):    print(c)

Match all occurrences of a regex in Java

Arnab Chakraborty

Arnab Chakraborty

Updated on 23-Jun-2020 14:46:06

262 Views

public class RegexOccur {    public static void main(String args[]) {       String str = "java is fun so learn java";       String findStr = "java";       int lastIndex = 0;       int count = 0;       while(lastIndex != -1) {          lastIndex = str.indexOf(findStr,lastIndex);          if(lastIndex != -1) {             count ++;             lastIndex += findStr.length();          }       }       System.out.println(count);    } }Output2

How to send the result of Python CGI script to the browser?

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Jun-2020 15:37:06

298 Views

# Get data from fields from HTML page first_name = form.getvalue('first_name') last_name  = form.getvalue('last_name') send data to Browser print("Content-type:text/html") print print("") print("") print("Hello - Second CGI Program") print("") print("") print(" Hello %s %s " % (first_name, last_name)) print("") print("")

Advertisements