|
solinb wrote: The site I need to access has a table of proteins featuring links to their sequence data. I need to be able to go from protein to protein, into the pages with their sequence data, get the data, and move to the next to one.
But are you wanting to download a file given its URL?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
http://www.ncbi.nlm.nih.gov/sites/entrez?Db=genome&Cmd=Retrieve&dopt=Protein+Table&list_uids=23523
Thats the page which lists all the genes I'm interested in.
from that I need to write a program that goes from each entry linked under the 'accession' column. For instance, for this homoserine kinase:
http://www.ncbi.nlm.nih.gov/protein/218698422
from that, I need the sequence of text under 'ORIGIN'
after that, I need it to loop through and check out all the others. I haven't worked out yet if i want it to kick all sequences it picks up indexed somewhere, or just perform the analysis I need, store that, and move on to the next one. I could write either, but it's a moot point if I can't get the data initially.
It doesn't seem like it should be to hard to do, but I need a push in the right direction.
|
|
|
|
|
Do you have direct access to the genome database? If not, the only solution I can think of would be to parse the obj_table23523 table that is being returned in the HTML.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I don't know how to get said HTML returned. Which is where the hang up is.
|
|
|
|
|
for the record, i'm now going with python because i was able to write a program to get the data i needed in about 3 lines.
|
|
|
|
|
|
Hello,
I want to hide textbox/label at run time, Could you please let me know what's the 2nd parameter to pass to below WIN API function,
SendMessage(hComponentName, ?, 0, 0);
Best Regards,
Supriya
|
|
|
|
|
How about WM_SHOWWINDOW ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
WM_SHOWWINDOW[^] only notifies the given window that it is about to be hidden or shown, it doesn't actually hide or show the window.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
I realized that right after I responded but got distracted with something else before fixing it. Thanks.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I don't think you can do that with SendMessage (except for maybe doing it indirectly if you show and hide the given window in the message handler), you should use ShowWIndow[^] for this.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
modified on Tuesday, December 1, 2009 2:45 PM
|
|
|
|
|
Thank you very much for suggestion!
I tried below and it worked for me
hComponentName = GetDlgItem(hDlg,IDC_STATIC3);
SendMessage(hComponentName, SW_HIDE, 1, 0);
Thanks again.
Best Regards,
Supriya.
|
|
|
|
|
You can send SW_HIDE to a window to make it hidden? That's completely new to me, i learn something every day, thanks.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Code-o-mat wrote: You can send SW_HIDE to a window to make it hidden?
Only if that window processes the WM messages and responds accordingly. Most standard window types in a dialog will do this.
|
|
|
|
|
ok
Best Regards,
Supriya Tonape
|
|
|
|
|
I have an ancient program that creates logs named using the time when they are created.
I need to delete the oldest files in the folder, only keeping the most recent 20, during runtime.
Is there any way to do this in C?
I can use Remove(filename), but then I have to go through each filename and compare dates. Seems like a hassle. Is there any function that returns the date of a file for comparison?
Thanks.
|
|
|
|
|
ChemmieBro wrote: Is there any way to do this in C?
Yes.
ChemmieBro wrote: Is there any function that returns the date of a file for comparison?
How about GetFileTime() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Your program has to check all the log files to find which 20 files are the latest. Then the program can delete all the old ones.
The program can get file times using CFileFind::GetLastWriteTime() (if you are using MFC). You said the filenames contain the time also. In that case you can also parse the filenames to get the times.
You can load the file times (together with the pathnames) into an array and sort them to find out the files that should be deleted. Sorting can be done easily by STL utilities.
Seems to be a hassle, but it's done by your program. The only hassle to you will be to write this program, just once. By using MFC and STL to implement this, it's not a big deal at all.
Good luck!
|
|
|
|
|
That's about what I thought. (parsing the names)
I'm stuck with standard C with no MFC support. This is an old, and very basic program, that I'm modifying. Looks like I'll just have to sort and use the Remove("filename.txt") function. Even with getting the file times, I'll still have to do some comparing/sorting.
I'm actually thinking of just changing the file naming to adding a number to the end of the file. Since there are only 20 or 30 files (whatever I choose), I'll just increment those each time and delete when there gets to be 31 in the folder... it is crude, but easy.
Thanks for the input. Thank goodness for programming advances since this was written...
|
|
|
|
|
Since your program creates log files names based on date and time, you can parse file names for the time when they were created. That would be better method, than finding the file's last write time.
|
|
|
|
|
just create a file with number like file1.txt,file2.txt ..... file20.txt.
after that, check like this,
for (int i=0;i<20;i++)
{
CString str;
str.Format(_T("file%d"),i);
if(!PathFileExists(str))
break;
DeleteFile(str);
}
if file doesn't exists then break the loop.
Regards,
Srinivas
|
|
|
|
|
Hai all,
I am searching one string (ex.Hello-Welcome) in text file using SQL query.
its searching Hello and Welcome seperatly and giving a result , i think bcoz hyphen(-) is a word breaker
in SQL .can any one give me the idea how to resolve the problem.
i need to use hyphen in searching string, and i need a combined string search result.
thanks
mahe
|
|
|
|
|
This does not appear to be a C++ question. You may get better visibility by posting in the General Database forum.
|
|
|
|
|
thanks
if u have any idea pls let me know.
|
|
|
|
|
You may escape the hyphen, see, for instance [^] (have a look at example "C. Using the ESCAPE clause").
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|