Profile

Cover photo
Nitish Mittal
Attended Dhirubhai Ambani Institute of Information and Communication Technology
Lives in Hyderabad
198 followers|31,032 views
AboutPostsPhotosYouTube

Stream

Nitish Mittal

Shared publicly  - 
1

Nitish Mittal

Shared publicly  - 
1
 
 
ISWC 2013 is the premier international forum for the Semantic Web / Linked Data Community. Here, scientists, industry specialists, and practitioners meet to discuss the future of practical, scalable, user-friendly, and game changing solutions.  #iswc2013 #semanticweb #datascience  
1

Nitish Mittal

Code/Snippets  - 
 
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Solution {

    public static void main(String[] args) throws IOException {
     
         int k = getInt();
         String s = getString();
      
         int n=0,m=1;
         int l = s.length();
         int no = (l*(l+1))/2;
         String[] sub = new String[no];
         int i =0;
         while(n<=l && i<no)
         {
             if(m==l+1){
                 n++;
                 m=n+1;
             }
             
                 sub[i] = s.substring(n,m);
                 
                 i++;
                 m++;
         }
         int total = 0;
         System.out.println(sub.length);
         for(int j=0;j<sub.length-1;j++)
         {
             for(int z=j+1;z<sub.length;z++)
             total = total + mismatch(sub[j],sub[z],k);
         }
         System.out.println(total);
         
     }
     public static int mismatch(String s1, String s2,int k)
     {
         char[] c1 = s1.toCharArray();
         char[] c2 = s2.toCharArray();
         int i=0;
         int n=0;
         int b = c1.length;
         int c = c2.length;
         while(i<b && b==c){
             if(c1[i]!=c2[i]) 
                 n++;
           
             i++;
         }
          // System.out.println(s1 + " " + s2 +" "+n);
        // System.out.println(k);
         if(n<=k && b==c){
         return 1;
         }
         else
             return 0;
     }
     
     public static String getString() throws IOException{
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        String s = br.readLine();
        return s; 
    }
    
    public static int getInt() throws IOException{
        String s = getString();
        return Integer.parseInt(s);
    }
}


in the line " int l = s.length();" i am getting NULLPOINTEREXCEPTION error can anyone suggest what wrong is there??
1
Add a comment...
 
#include<stdio.h>
#include<conio.h>

int main(){
   void (*p)();
   int (*q)();
   int (*r)();
   p = clrscr;
   q = getch;
   r = puts;
  (*p)();
  (*r)(" C Programming");
  (*q)();
  return 0;
}

what would be the output of this program?
2
Lucas Dohring's profile photoMapy ZONGO's profile photoFlorian Philipp's profile photoChris McClelland's profile photo
11 comments
 
I was curious to see how char read_write[] = "C Programming" is typically compiled, so I had a look: http://pastebin.com/raw.php?i=UU8N6xDZ
Add a comment...
In his circles
244 people
Have him in circles
198 people
Ashish Jain's profile photo
Dharak Shah's profile photo
Dhanesh Kapadia's profile photo
Lavish Mantri's profile photo
Abhijeet Sharma's profile photo
dhruvin panseriya's profile photo
Yash Luhadiya's profile photo
Anurag Singh's profile photo
Zeel Shah's profile photo

Nitish Mittal

Shared publicly  - 
1

Nitish Mittal

How-To/Tutorials  - 
 
Hello Everyone!!!
I need a help, I want to find the probability of a word occurring given one or two previous words in a sentence. For example if sentence is " The color of rose is red" then what is the probability of occurring red given is and rose.
Any kind of link of Api or research articles would be helpful
1
Add a comment...
1
 
void main()
{
clrscr();
if(sizeof(!6.0))
printf("%d",sizeof(6.0,2));
else
printf("i don't know");
getch();
}
the output is 4 can someone explain me this code?
2
1
Nitish Mittal's profile photoJuan Carlos Díaz's profile photoPaulo Portela's profile photoSaqib Mamoon's profile photo
6 comments
 
+Adrian Ho I was always talking about the result of the if statement that's why I've always use "1 (true)" and used "if (sizeof(something))". Of course the sizeof(x) could be something different than one, just as I've pointed on my first comment.
Add a comment...
People
In his circles
244 people
Have him in circles
198 people
Ashish Jain's profile photo
Dharak Shah's profile photo
Dhanesh Kapadia's profile photo
Lavish Mantri's profile photo
Abhijeet Sharma's profile photo
dhruvin panseriya's profile photo
Yash Luhadiya's profile photo
Anurag Singh's profile photo
Zeel Shah's profile photo
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Hyderabad
Previously
gandhinagar
Links
Education
  • Dhirubhai Ambani Institute of Information and Communication Technology
    ICT, 2010 - 2014
Basic Information
Gender
Male