Search Results

Search found 10693 results on 428 pages for 'reading'.

Page 26/428 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Recommended reading for bioinformatics

    - by Matt
    I'm keen on learning about bioinformatics. I am ideally looking for a short course introduction, with some practical tasks I can get my teeth into immediately to see if there is any interest in it for me. I already have a good understanding of molecular biology, so I should be able to skip most of the foundational work. Any suggestions?

    Read the article

  • Reading a triangle of numbers into a 2d array of ints in Python

    - by Gabriel Silk
    I want to read a triangle of integer values from a file into a 2D array of ints using Python. The numbers would look like this: 75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 ... The code I have so far is as follows: f = open('problem18.input', 'r') arr = [] for i in range(0, 15): arr.append([]) str = f.readline() a = str.split(' ') for tok in a: arr[i].append(int(tok[:2])) print arr I have a feeling this could be done in a tighter, more Pythonesque way. How would you do it?

    Read the article

  • Reading a file with a supplied name in C++

    - by Cosmina
    I must read a file with a given name (it's caled "hamlet.txt"). The class used to read the file is defined like this #ifndef READWORDS_H #define READWORDS_H /** * ReadWords class. Provides mechanisms to read a text file, and return * capitalized words from that file. */ using namespace std; #include <string> #include <fstream> class ReadWords { public: /** * Constructor. Opens the file with the default name "text.txt". * Program exits with an error message if the file does not exist. */ ReadWords(); /** * Constructor. Opens the file with the given filename. * Program exits with an error message if the file does not exist. * @param filename - a C string naming the file to read. */ ReadWords(char *filename); My definition of the members of the classis this: #include<string> #include<fstream> #include<iostream> #include "ReadWords.h" using namespace std; ReadWords::ReadWords() { wordfile.open("text.txt"); if( !wordfile ) { cout<<"Errors while opening the file!"<<endl; } } ReadWords::ReadWords(char *filename) { wordfile.open(filename); if ( !wordfile ) { cout<<"Errors while opening the file!"<<endl; } wordfile>>nextword; } And the main to test it. using namespace std; #include #include #include "ReadWords.h" int main() { char name[30]; cout<<"Please input a name for the file that you wish to open"; cin>>name; ReadWords x( name[] ); } When I complie it gives me the error: main.cpp:14: error: expected primary-expression before ']' token I know it's got something to do with the function ReadWords( char *filename), but I do not know what. Any help please?

    Read the article

  • Reading large excel file with PHP

    - by Itamar Bar-Lev
    I'm trying to read a 17MB excel file (2003) with PHPExcel1.7.3c, but it crushes already while loading the file, after exceeding the 120 seconds limit I have. Is there another library that can do it more efficiently? I have no need in styling, I only need it to support UTF8. Thanks for your help

    Read the article

  • Django gives "I/O operation on closed file" error when reading from a saved ImageField

    - by Rob Osborne
    I have a model with two image fields, a source image and a thumbnail. When I update the new source image, save it and then try to read the source image to crop/scale it to a thumbnail I get an "I/O operation on closed file" error from PIL. If I update the source image, don't save the source image, and then try to read the source image to crop/scale, I get an "attempting to read from closed file" error from PIL. In both cases the source image is actually saved and available in later request/response loops. If I don't crop/scale in a single request/response loop but instead upload on one page and then crop/scale in another page this all works fine. This seems to be a cached buffer being reused some how, either by PIL or by the Django file storage. Any ideas on how to make an ImageField readable after saving?

    Read the article

  • Reading contents of a text file using JavaScript throwing error

    - by vix
    I'm using the following code to read the content of a text file using javascript. But when I'm getting an alert message which says "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?" When I click on yes nothing is happening. I'm using IE 6.0 function ieReadFile(filename) { try { var fso = new ActiveXObject("Scripting.FileSystemObject"); var fh = fso.OpenTextFile(filename,1); var contents = fh.ReadAll(); fh.Close(); alert(contents); //return contents; } catch (Exception) { return "Cannot open file :("; } } Can anyone please help me resolve this issue?

    Read the article

  • Why isnt php reading my cookie?

    - by Jason94
    at index.php i have a form to fill out some settings. the form posts to setsettings.php at setsettings.php it uses the form data and sets some cookies and redirect back to index.php. if i print_r($_COOKIE) at setsettings.php all is well. but nothing comes up at index.php, the $_COOKIE array is empty :( Does somebody know how i go about solving this? I set det setting by (setsettings.php): /* Write new cookie */ $expire = 60 * 60 * 24 * 60 + time(); // ~2 months setcookie("user_var_001", $_POST['selection'], $expire); and in index.php print_r($_COOKIE) turns up blank;

    Read the article

  • Reading Excel files from C#

    - by dbkk
    Is there a free or open source library to read Excel files (.xls) directly from a C# program? It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've been using Export to Unicode text function of Excel, and parsing the resulting (tab-delimited) file, but I'd like to eliminate the manual step.

    Read the article

  • Reading same file from multiple threads in C#

    - by Gustavo Rubio
    Hi. I was googling for some advise about this and I found some links. The most obvious was this one but in the end what im wondering is how well my code is implemented. I have basically two classes. One is the Converter and the other is ConverterThread I create an instance of this Converter class that has a property ThreadNumber that tells me how many threads should be run at the same time (this is read from user) since this application will be used on multi-cpu systems (physically, like 8 cpu) so it is suppossed that this will speed up the import The Converter instance reads a file that can range from 100mb to 800mb and each line of this file is a tab-delimitted value record that is imported to another destination like a database. The ConverterThread class simply runs inside the thread (new Thread(ConverterThread.StartThread)) and has event notification so when its work is done it can notify the Converter class and then I can sum up the progress for all these threads and notify the user (in the GUI for example) about how many of these records have been imported and how many bytes have been read. It seems, however that I'm having some trouble because I get random errors about the file not being able to be read or that the sum of the progress (percentage) went above 100% which is not possible and I think that happens because threads are not being well managed and probably the information returned by the event is malformed (since it "travels" from one thread to another) Do you have any advise on better practices of implementation of threads so I can accomplish this? Thanks in advance.

    Read the article

  • Reading directly from the Doctrine Searchable index table

    - by phidah
    I've got a Doctrine table with the Searchable behavior enabled. Whenever a record is created, an index is made in another table. I have a model called Entry and the behavior automatically created the table entry_index. My question now is: How can I - without using the search(...) methods of my model use the data from this table? I want to create a tag cloud of the words most used, and the data in the index table is exactly what I need.

    Read the article

  • File Locked by Services (after service code reading the text file)

    - by rvpals
    I have a windows services written in C# .NET. The service is running on a internal timer, every time the interval hits, it will go and try to read this log file into a String. My issue is every time the log file is read, the service seem to lock the log file. The lock on that log file will continue until I stop the windows service. At the same time the service is checking the log file, the same log file needs to be continuously updated by another program. If the file lock is on, the other program could not update the log file. Here is the code I use to read the text log file. private string ReadtextFile(string filename) { string res = ""; try { System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read); System.IO.StreamReader sr = new System.IO.StreamReader(fs); res = sr.ReadToEnd(); sr.Close(); fs.Close(); } catch (System.Exception ex) { HandleEx(ex); } return res; } Thank you.

    Read the article

  • Reading in 4 bytes at a time

    - by alphomega
    I have a big file full of integers that I'm loading in. I've just started using C++, and I'm trying out the filestream stuff. From everything I've read, it appears I can only read in bytes, So I've had to set up a char array, and then cast it as a int pointer. Is there a way I can read in 4 bytes at a time, and eliminate the need for the char array? const int HRSIZE = 129951336; //The size of the table char bhr[HRSIZE]; //The table int *dwhr; int main() { ifstream fstr; /* load the handranks.dat file */ std::cout << "Loading table.dat...\n"; fstr.open("table.dat"); fstr.read(bhr, HRSIZE); fstr.close(); dwhr = (int *) bhr; }

    Read the article

  • OleDB Jet - Float issues in reading excel data

    - by Patrick
    When I read a sheet into a DataTable using the OleDbDataReader, floating point numbers loose their precision. I tried forcing OleDb to read the excel data as string, but although the data is now contained in a DataRow with each Column defined as System.String it looses precision (18.125 - 18.124962832). Any idea how to avoid this behaviour?

    Read the article

  • Reading server error messages for a URLLoader

    - by Rudy
    Hello, I have an URL loader with the following code: public function getUploadURL():void { var request:URLRequest = new URLRequest(); var url:String = getPath(); // Adds time to prevent caching url += "&time=" + new Date().getTime(); request.url = url; request.method = URLRequestMethod.GET; _loader = new URLLoader(); _loader.dataFormat = URLLoaderDataFormat.TEXT; _loader.addEventListener(Event.COMPLETE, getBaseURL); _loader.addEventListener(IOErrorEvent.IO_ERROR, onGetUploadURLError); _loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, getHttpStatus); _loader.load(request); } My problem is that this request might be wrong, and so the server will give me a back a 400 Bad Request, with a message to explain the error. If the Event.COMPLETE, I can see some message (a response) back from the server in the "data" field of the Event, but if onGetUploadURLError or getHttpStatus is called, it just says that the error code is 400 but does not show me the message associated with it. The "data" field is undefined in getHttpStatus and it is "" in onGetUploadURLError. On the contrary, in getBaseURL, I get: {"ResponseMetadata":{...}} I checked and I do get a similar response in my browser for a wrong request, but I cannot see it. Any idea how I can please get the message? Thank you very much, Rudy

    Read the article

  • Reading/Writing DataTables to and from an OleDb Database LINQ

    - by jsmith
    My current project is to take information from an OleDbDatabase and .CSV files and place it all into a larger OleDbDatabase. I have currently read in all the information I need from both .CSV files, and the OleDbDatabase into DataTables.... Where it is getting hairy is writing all of the information back to another OleDbDatabase. Right now my current method is to do something like this: OleDbTransaction myTransaction = null; try { OleDbConnection conn = new OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Database); conn.Open(); OleDbCommand command = conn.CreateCommand(); string strSQL; command.Transaction = myTransaction; strSQL = "Insert into TABLE " + "(FirstName, LastName) values ('" + FirstName + "', '" + LastName + "')"; command.CommandType = CommandType.Text; command.CommandText = strSQL; command.ExecuteNonQuery(); conn.close(); catch (Exception) { // IF invalid data is entered, rolls back the database myTransaction.Rollback(); } Of course, this is very basic and I'm using an SQL command to commit my transactions to a connection. My problem is I could do this, but I have about 200 fields that need inserted over several tables. I'm willing to do the leg work if that's the only way to go. But I feel like there is an easier method. Is there anything in LINQ that could help me out with this?

    Read the article

  • Perl : Reading messages in gmail account

    - by kiruthika
    Hi all, I have used the module Mail::Webmail::Gmail to read the new messages in my gmail account. I have written the following code for this purpose. use strict; use warnings; use Data::Dumper; use Mail::Webmail::Gmail; my $gmail = Mail::Webmail::Gmail->new( username => 'username', password => 'password', ); my $messages = $gmail->get_messages( label => $Mail::Webmail::Gmail::FOLDERS{ 'INBOX' } ); foreach ( @{ $messages } ) { if ( $_->{ 'new' } ) { print "Subject: " . $_->{ 'subject' } . " / Blurb: " . $_->{ 'blurb' } . "\n"; } } But it didn't print anything. Can anyone help me in this or suggest any other module for this. Thanks in advance.

    Read the article

  • Reading Web 2.0 HTML Source Code with Perl

    - by Sammy
    Is it possible to read HTML Web 2.0 Source Code that is dynamically generated ? The Perl LWP with its agent-response does not pick up any dynamically generated HTML code. Many websites today are generating dynamic html. If I am shoppping for best prices, and the prices are dynamically fetched and dumped, then I am out of business. Are we reaching the end of a era?

    Read the article

  • Reading path in templates

    - by DJPython
    Hello, is it any way to read path to current page? For example, I am at www.example.com/foo/bar/ - and I want to read '/foo/bar/'. But, all have to be done in template file without modyficating views. I have to many view files to edit each one. Sorry for my english, hope everyone understand. Cheers.

    Read the article

  • Reading a text file in c++

    - by Yavuz Karacabey
    string numbers; string fileName = "text.txt"; ifstream inputFile; inputFile.open(fileName.c_str(),ios_base::in); inputFile >> numbers; inputFile.close(); cout << numbers; And my text.txt file is: 1 2 3 4 5 basically a set of integers separated by tabs. The problem is the program only reads the first integer in the text.txt file and ignores the rest for some reason. If I remove the tabs between the integers it works fine, but with tabs between them, it won't work. What causes this? As far as I know it should ignore any white space characters or am I mistaken? If so is there a better way to get each of these numbers from the text file?

    Read the article

  • Drupal's not reading correct values from DB

    - by John
    Hey Everyone, Here is my current problem. I am working with the chat module and I'm building a module that notifies users via AJAX that they have been invited to a chat. The current table structure for the invites table looks like this: |-------------------------------------------------------------------------| | CCID | NID | INVITER_UID | INVITEE_UID | NOTIFIED | ACCEPTED | |-------------------------------------------------------------------------| | int | int | int | int | (0 or 1) | (0 or 1) | |-------------------------------------------------------------------------| I'm using the periodical updater plug-in for JQuery to continually poll the server to check for invites. When an invite is found, I set the notified from 0 to 1. However, my problem is the periodical updater. When I first see that there is an invite, I notify the user, and set notified to 1. On the next select though, I get the same results before, as if the update didn't work. But, when I got check the database, I can see that it worked just fine. It's as if the query is querying a cache, but I can't figure it out. My code for the periodical updater is as follows: window.onload = function() { var uid = $('a#chat_uid').html(); $.PeriodicalUpdater( '/steelylib/sites/all/modules/_chat_whos_online/ajax/ajax.php', //url to service { method: 'get', //send data via... data: {uid: uid}, //data to send minTimeout: '1000', //min time before server is polled (milli-sec.) maxTimeout: '20000', //max time before server is polled (milli-sec.) multiplyer: '1.5', //multiply against curretn poll time every time constant data is returned type: 'text', //type of data recieved (response type) maxCalls: 0, //max calls to make (0=unlimited) autoStop: 0 //max calls with constant data (0=unlimited/disabled) }, function(data) //callback function { alert( data ); //for now, until i get it working } ); } And my code for the ajax call is as follows: <?php #bootstrap Drupal, and call function, passing current user's uid. function _create_chat_node_check_invites($uid) { cache_clear_all('chatroom_chat_list', 'cache'); $query = "SELECT * FROM {chatroom_chat_invite} WHERE notified=0 AND invitee_uid=%d and accepted=0"; $query_results = db_query( $query, $uid ); $json = '{"invites":['; while( $row = db_fetch_object($query_results) ) { var_dump($row); global $base_url; $url = $base_url . '/content/privatechat' . $uid .'-' . $row->inviter_uid; $inviter = db_fetch_object( db_query( "SELECT name FROM {users} WHERE uid = %d", $row->inviter_uid ) ); $invitee = db_fetch_object( db_query( "SELECT name FROM {users} WHERE uid = %d", $row->invitee_uid ) ); #reset table $query = "UPDATE {chatroom_chat_invite} " ."SET notified=1 " ."WHERE inviter_uid=%d AND invitee_uid=%d"; db_query( $query, $row->inviter_uid, $row->invitee_uid ); $json .= '['; $json .= '"' . $url . '",'; $json .= '"' . ($inviter->name) . '",'; $json .= '"' . ($invitee->name) . '"' ; $json .= '],'; } $json = substr($json, 0, -1); $json .= ']}'; return $json; } ?> I can't figure out what is going wrong, any help is greatly appreciated!

    Read the article

  • how to dispaly image in grid view reading imageUrl from xml using sax parser in android

    - by Pramod kuamr
    thanks for answer but i am able to read xml file from url but i need if in xml imageUrl is there so show in grid view ..this is my xml file and read URL <?xml version="1.0" encoding="UTF-8"?> <channels> <channel> <name>ndtv</name> <logo>http://a3.twimg.com/profile_images/670625317/aam-logo--twitter.png</logo> <description>this is a news Channel</description> <rssfeed>ndtv.com</rssfeed> </channel> <channel> <name>star news</name> <logo>http://a3.twimg.com/profile_images/740897825/AndroidCast-350_normal.png</logo> <description>this is a newsChannel</description> <rssfeed>starnews.com</rssfeed> </channel> </channels>

    Read the article

  • How to draw flowchart for code involving opening from text file and reading them

    - by problematic
    like this code fp1=fopen("Fruit.txt","r"); if(fp1==NULL) { printf("ERROR in opening file\n"); return 1; } else { for(i=0;i<lines;i++)//reads Fruits.txt database { fgets(product,sizeof(product),fp1); id[i]=atoi(strtok(product,",")); strcpy(name[i],strtok(NULL,",")); price[i]=atof(strtok(NULL,",")); stock[i]=atoi(strtok(NULL,"\n")); } } fclose(fp1); These symbols sound too similar to differentiate their function,can anyone helps me by any method, or use names of shape according to this site http://www.breezetree.com/article-excel-flowchart-shapes.htm

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >