Arnab Chakraborty

Arnab Chakraborty

29 Articles Published

Articles by Arnab Chakraborty

Page 3 of 3

How can I write in order with for loop or while loop?

Arnab Chakraborty
Arnab Chakraborty
Updated on 20-Jun-2020 304 Views

Example#include #include void main() {    int i,j,a=0,b=1,n;    clrscr();    printf("****************OUTPUT*****************");    printf("enter the value of n : ");    scanf("%d",&n);    printf(" the required order is: " );    for(i=1;i

Read More

How to capture multiple matches in the same line in Java regex

Arnab Chakraborty
Arnab Chakraborty
Updated on 20-Jun-2020 3K+ Views

Exampleimport java.util.regex.*; class PatternMatcher {    public static void main(String args[]) {       int count = 0;       // String to be scanned to find the pattern.       String content = "aaa bb aaa";       String string = "aaa";       // Create a Pattern object       Pattern p = Pattern.compile(string);       // get a matcher object       Matcher m = p.matcher(content);       while(m.find()) {          count++;          System.out.println("Match no:"+count);         ...

Read More

Java Regular Expression that doesn't contain a certain String.

Arnab Chakraborty
Arnab Chakraborty
Updated on 20-Jun-2020 712 Views

Exampleimport java.util.regex.*; class PatternMatch{    public static void main(String args[]) {       String content = "I am a student";       String string = ".*boy.*";       boolean isMatch = Pattern.matches(string, content);       System.out.println("The line contains 'boy'?"+ isMatch);    } }Outputthe line contains 'boy'?falsematches()­­It is used to check if the whole text matches a pattern. Its output is boolean. It returns true if match is found otherwise false.This is one of simplest and easiest way of searching a String in a text using Regex .There is a another method compile() , if you want ...

Read More

Operating system time slicing in round robin scheduling

Arnab Chakraborty
Arnab Chakraborty
Updated on 20-Jun-2020 451 Views

process Burst time A 4 B 1 C 8 D 1time slice=10 unitA B C D A C C C 0 2 3 5 6 8 10 12 14So A will complete 8 cycles.

Read More

Reply to user text using Python

Arnab Chakraborty
Arnab Chakraborty
Updated on 16-Jun-2020 2K+ Views

You can solve this problem by using if-elif-else statements. And to make it like, it will ask for a valid option until the given option is on the list, we can use while loops. When the option is valid, then break the loop, otherwise, it will ask for the input repeatedly.You should take the input as an integer, for that you need to typecast the input to an integer using int() method.ExamplePlease check the code to follow the given points.print("Come-on in. Need help with any bags?") while True: # loop is used to take option until it is not valid. ...

Read More

Count spaces, uppercase and lowercase in a sentence using C

Arnab Chakraborty
Arnab Chakraborty
Updated on 27-Jan-2020 948 Views

#include int main() {    char str[100],i;    int upper = 0, lower = 0, number = 0, special = 0,whitesp=0;    printf("enter string");    gets(str);    for (i = 0; i < str[i]!='\0'; i++) {       if (str[i] >= 'A' && str[i] = 'a' && str[i] = '0' && str[i]

Read More

How to execute Python CGI Script on Apache Server?

Arnab Chakraborty
Arnab Chakraborty
Updated on 30-Jul-2019 596 Views

in apache server normally python script will not run. SO you have to go httpd.conf file in apache server, inside that you will find some .php, .asp etc in a property called AddHandler, you have to put there .py. save the file and restart the server. then run your python CGI script, it will run properly 

Read More

How to write Python CGI program to interact with MySQL?

Arnab Chakraborty
Arnab Chakraborty
Updated on 30-Jul-2019 1K+ Views

suppose you want to login into you account using Python CGi script, below is the details login.html email: password: login.py #!C:\Python27\python.exe import MySQLdb import cgi import Cookie # Open database connection db = MySQLdb.connect("localhost", "root", "", "student" ) # prepare a ...

Read More

How to use R in Java-8 regex.

Arnab Chakraborty
Arnab Chakraborty
Updated on 30-Jul-2019 545 Views

\R matches any line break as defined by the Unicode standardPattern p = Pattern.compile("\R");Unicode line-break sequence is equivalent to \u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]

Read More
Showing 21–29 of 29 articles
« Prev 1 2 3 Next »
Advertisements