Search Results

Search found 1055 results on 43 pages for 'sunil kumar sahoo'.

Page 11/43 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Parse a text file into multiple text file

    - by Vijay Kumar Singh
    I want to get multiple file by parsing a input file Through Java. The Input file contains many fasta format of thousands of protein sequence and I want to generate raw format(i.e., without any comma semicolon and without any extra symbol like "", "[", "]" etc) of each protein sequence. A fasta sequence starts form "" symbol followed by description of protein and then sequence of protein. For example ? lcl|NC_000001.10_cdsid_XP_003403591.1 [gene=LOC100652771] [protein=hypothetical protein LOC100652771] [protein_id=XP_003403591.1] [location=join(12190..12227,12595..12721,13403..13639)] MSESINFSHNLGQLLSPPRCVVMPGMPFPSIRSPELQKTTADLDHTLVSVPSVAESLHHPEITFLTAFCL PSFTRSRPLPDRQLHHCLALCPSFALPAGDGVCHGPGLQGSCYKGETQESVESRVLPGPRHRH Like above formate the input file contains 1000s of protein sequence. I have to generate thousands of raw file containing only individual protein sequence without any special symbol or gaps. I have developed the code for it in Java but out put is : Cannot open a file followed by cannot find file. Please help me to solve my problem. Regards Vijay Kumar Garg Varanasi Bharat (India) The code is /*Java code to convert FASTA format to a raw format*/ import java.io.*; import java.util.*; import java.util.regex.*; import java.io.FileInputStream; // java package for using regular expression public class Arrayren { public static void main(String args[]) throws IOException { String a[]=new String[1000]; String b[][] =new String[1000][1000]; /*open the id file*/ try { File f = new File ("input.txt"); //opening the text document containing genbank ids FileInputStream fis = new FileInputStream("input.txt"); //Reading the file contents through inputstream BufferedInputStream bis = new BufferedInputStream(fis); // Writing the contents to a buffered stream DataInputStream dis = new DataInputStream(bis); //Method for reading Java Standard data types String inputline; String line; String separator = System.getProperty("line.separator"); // reads a line till next line operator is found int i=0; while ((inputline=dis.readLine()) != null) { i++; a[i]=inputline; a[i]=a[i].replaceAll(separator,""); //replaces unwanted patterns like /n with space a[i]=a[i].trim(); // trims out if any space is available a[i]=a[i]+".txt"; //takes the file name into an array try // to handle run time error /*take the sequence in to an array*/ { BufferedReader in = new BufferedReader (new FileReader(a[i])); String inline = null; int j=0; while((inline=in.readLine()) != null) { j++; b[i][j]=inline; Pattern q=Pattern.compile(">"); //Compiling the regular expression Matcher n=q.matcher(inline); //creates the matcher for the above pattern if(n.find()) { /*appending the comment line*/ b[i][j]=b[i][j].replaceAll(">gi",""); //identify the pattern and replace it with a space b[i][j]=b[i][j].replaceAll("[a-zA-Z]",""); b[i][j]=b[i][j].replaceAll("|",""); b[i][j]=b[i][j].replaceAll("\\d{1,15}",""); b[i][j]=b[i][j].replaceAll(".",""); b[i][j]=b[i][j].replaceAll("_",""); b[i][j]=b[i][j].replaceAll("\\(",""); b[i][j]=b[i][j].replaceAll("\\)",""); } /*printing the sequence in to a text file*/ b[i][j]=b[i][j].replaceAll(separator,""); b[i][j]=b[i][j].trim(); // trims out if any space is available File create = new File(inputline+"R.txt"); try { if(!create.exists()) { create.createNewFile(); // creates a new file } else { System.out.println("file already exists"); } } catch(IOException e) // to catch the exception and print the error if cannot open a file { System.err.println("cannot create a file"); } BufferedWriter outt = new BufferedWriter(new FileWriter(inputline+"R.txt", true)); outt.write(b[i][j]); // printing the contents to a text file outt.close(); // closing the text file System.out.println(b[i][j]); } } catch(Exception e) { System.out.println("cannot open a file"); } } } catch(Exception ex) // catch the exception and prints the error if cannot find file { System.out.println("cannot find file "); } } } If you provide me correct it will be much easier to understand.

    Read the article

  • java profiler in java

    - by Sunil
    Hello I want to run a java program on linux server in profiling mode means I want to profile a java program on linux server.Is there any java profiling software that can profile java program on linux server. please suggest me what can I do for profiling. Thanks in advance.

    Read the article

  • Enum value in C++

    - by Sunil
    enum AccessSource { AccessSourceNull = 0x00000001, AccessSourceSec = 0x00000002, AccessSourceIpo = 0x00000004, AccessSourceSSA = 0x00000008, AccessSourceUpgrade = 0x00000010, AccessSourceDelta = 0x00000020, AccessSourcePhoneM = 0x00000040, AccessSourceSoft = 0x00000080, AccessSourceCR = 0x00000100, AccessSourceA = 0x00000200, AccessSourceE = 0x00000400, AccessSourceAll = 0xFFFFFFFF }; What is the value of AccessSourceAll ?? is it -1? or is it maximum value? I have a parameter ULONG x , whose default value is AccessSourceAll(that means access to all). How do i remove the access right of AccessSourceE only? How to add the access right of AccessSourceE again? If i have a particular value in x, then how do i know whether AccessSourceE is set or not?

    Read the article

  • Java HashMap with Int Array

    - by Sunil
    Hello I am using this code to check that array is present in the HashMap. public class Test { public static void main(String[]arg) { HashMap<int[],String> map= new HashMap<int[],String>(); map.put(new int[]{1,2}, "sun"); System.out.println(map.containsKey((new int[]{1,2}))); } } But this prints False. How can I check that array is present in the HashMap. Thanks in advance.

    Read the article

  • Castle windsor security exception

    - by Sunil
    I developed a small WCF service that uses Castle Windsor IoC container and it works fine on my PC. When I deploy it onto a Win 2008 R2 server and host the WCF service in IIS 7 it fails with the following error. I checked the server level web.config and the trust level is set to "Full". What do I need to do to get this to work. As a test I deployed the same service as it is onto a Windows 2003 server with the trust level set to "Full" and it works fine. I am unable to figure out what setting/configuration I am missing on the 2008 server that is making the service fail. Stack Trace: [SecurityException: That assembly does not allow partially trusted callers.] Castle.Windsor.WindsorContainer..ctor() +0 WMS.ServiceContractImplementation.IoC.IoCInstanceProvider..ctor(Type serviceType) in D:\WCF\WCFProofOfConcept\WMSServices \WMS.ServiceContractImplementation\IoC\IoCInstanceProvider.cs:19 WMS.ServiceContractImplementation.IoC.IoCServiceBehavior.ApplyDispatchBehav­ior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) in D:\WCF \WCFProofOfConcept\WMSServices\WMS.ServiceContractImplementation\IoC \IoCServiceBehavior.cs:24 System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(Ser­viceDescription description, ServiceHostBase serviceHost) +377 System.ServiceModel.ServiceHostBase.InitializeRuntime() +37 System.ServiceModel.ServiceHostBase.OnBeginOpen() +27 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +49 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +261 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

    Read the article

  • javascript image toggling

    - by Sunil Ramu
    I have a tree view which has a folder icon by default and once clicked it has to be changed to a checkbox icon. And further on clicking the checkbox icon should display a folder icon. Sample Code, Server side : c# htmlSb.AppendFormat(" {0}", emptyContent); JS code var Test= new Object(); Test.Controls=new Object(); Test.Controls.TreeView = new Object(); **Test.Controls.TreeView.SelectNode = function (TreeId, nodeLabel) { $("#" + TreeId + " li span, ul li span").css("background-color", "transparent"); nodeLabel.style.backgroundColor = "white"; nodeLabel.style.background = "url(../images/selected.gif) 0 0 no-repeat"; }** The other Image : if (nodeLabel.style.background = "url(../images/folderclosed.gif) 0 0 no-repeat") I need to toggle between "selected.gif" and "folderclosed.gif" images. If one is clicked the other should display. and vice versa. Please help.

    Read the article

  • Adding roles from a DB Table

    - by Sunil Ramu
    Can anyone expalin me how to dynamically ger the Role from a DB table instead of hard coding it in the code. ClaimsIdentity outputIdentity = new ClaimsIdentity(); outputIdentity.Claims.Add(new Claim(System.IdentityModel.Claims.ClaimTypes.Name, principal.Identity.Name)); outputIdentity.Claims.Add(new Claim(ClaimTypes.Role, "Manager")); outputIdentity.Claims.Add(new Claim(ClaimTypes.Country, HttpUtilities.GetProgramIdentifierFromUrl())); return outputIdentity;

    Read the article

  • How to get Google Search Query Kind of Content Indexed ?

    - by Sunil
    Hello: I was looking for something like flash grabber and I came across this result http://www.giveawayoftheday.com/flash+grabber+firefox/ I am just wondering how giveawayoftheday has managed to get "flash+grabber+firefox/" indexed in Google ? Did they submit via Google Sitemap or is Google doing this on its own ? Or something else ? Kindly enlighten. Thanks.

    Read the article

  • Populate asp.net MVC Index page with data from the database

    - by Sunil Ramu
    I have a web application in which I need to fetch data from the database and display in the index page. As you know, asp.net mvc has given options to edit delete etc... I need to populate the page using the conventional DB way and it uses a stored procedure to retrieve results. I dont want to use LINQ. This is my model entity class using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace LogMVCApp.Models { public class Property { public int Id { get; set; } public string LogInId { get; set; } public string Username { get; set; } public string Action { get; set; } public string Information { get; set; } public bool Passed{get; set; } public string LogType { get; set; } } } and I need to retrieve data using something like this... var conString = ConfigurationManager.ConnectionStrings["connection"].ToString(); var conn = new SqlConnection(conString); var command = new SqlCommand("LogInsert", conn){CommandType=CommandType.StoredProcedure};

    Read the article

  • Pushing a vector into an vector

    - by Sunil
    I have a 2d vector typedef vector <double> record_t; typedef vector <record_t> data_t; data_t data; So my 2d vector is data here. It has elements like say, 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 Now I want to insert these elements into another 2d vector std::vector< vector<double> > window; So what I did was to create an iterator for traversing through the rows of data and pushing it into windowlike std::vector< std::vector<double> >::iterator data_it; for (data_it = data.begin() ; data_it != data.end() ; ++data_it) window.push_back ( *data_it ); Can anybody tell me where I'm wrong or suggest a way to do this ? Thanks

    Read the article

  • Facebook API question - uids and email

    - by Sunil
    Hello Folks, I am trying to develop a application where The user 'X' has logged into Facebook app has a set of email addresses (possible friends of user 'X') app gets the list of friends of user 'X' (uids) Want to check if user with email address [email protected] is a valid facebook user by using email address and is user X's friend (basically a uid to email mapping) Thanks!

    Read the article

  • "User-defined type not defined" error in VB 6 under Windows 7

    - by sunil.nishad87
    I am using Windows 7 and my project is in VB 6.0. I am getting errors while I am executing my program. It shows the error: User-defined type not defined. Here is my code: Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "trace": Call mntrace_Click Case "snrplot": Call mnSnrplot_Click Case "skyplot": Call mnskyplot_Click Case "nmea": Call mnNmea_Click Case "navigation": Call mnNavigation_Click Case "survey": Call mnSurvey_Click Case "pause/start": Call mnpause_Click Case "save": Call mnsave_Click Case "print": Call mnprint_Click Case "offline": Call mnoffline_Click End Select End Sub How can I solve this error?

    Read the article

  • Pushing a vector into an vector

    - by Sunil
    I have a 2d vector typedef vector <double> record_t; typedef vector <record_t> data_t; data_t data; So my 2d vector is data here. It has elements like say, 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 Now I want to insert these elements into another 2d vector std::vector< vector<double> > window; So what I did was to create an iterator for traversing through the rows of data and pushing it into window like std::vector< std::vector<double> >::iterator data_it; for (data_it = data.begin() ; data_it != data.end() ; ++data_it){ window.push_back ( *data_it ); // Do something else } Can anybody tell me where I'm wrong or suggest a way to do this ? BTW I want to push it just element by element because I want to be able to do something else inside the loop too. i.e. I want to check for a condition and increment the value of the iterator inside. for example, if a condition satisfies then I'll do data_it+=3 or something like that inside the loop. Thanks P.S. I asked this question last night and didn't get any response and that's why I'm posting it again.

    Read the article

  • How to parse SQL files using C# ?

    - by Sunil Agarwal
    Hi, Can anyone please help me? I am having bunch of .sql files. I want to parse (validate) those files before executing them on server. I have many online sites which parse the code. But I want to parse the code using C#. So please can you guide. If there is any tool, dll I need to use. I just want to parse the file and not execute it

    Read the article

  • How to undo SQL changes using installer

    - by Sunil Agarwal
    I have installer to install procedures, scripts, views, etc in SQL server 2005/2008. Now I want to add a condition in the installer like if there is any error while installing, I want to undo all the changes done in SQL server. I tried to store the procedures, views, etc which I am changing while installing and reverting them back if I get any error. But am not able to do it the way I want. Can someone guide me if he had done the same thing? To specify I am using WIX installer. Also if someone has tried SMO, it will be of great help.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >