Daily Archives

Articles indexed Wednesday March 31 2010

Page 7/124 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Counting the number of characters in a file

    - by Kat
    I'm writing a program that for one part asks for the program to print how many characters (including whitespaces) are in a file. The code I have right now though returns 0 every time though and I'm not sure why it isn't counting the characters. public int getcharCount(Scanner textFile) { int count = 0; while(textFile.hasNext()) { String line = textFile.nextLine(); for(int i=0; i < line.length(); i++) count++; } return count; }

    Read the article

  • Check to See if File is in Repository with SharpSVN

    - by Jason
    How do I check if a file is already in a repository (or NOT in the repository) so I can determine whether I need to 'add' it first before doing the check in? (For the record, I have check-in working, but I get an exception when I try to check in a file that has not yet been added to the repository.) Thanks

    Read the article

  • Legacy application creates dialogs in non-ui thread.

    - by Frater
    I've been working support for a while on a legacy application and I've noticed a bit of a problem. The system is an incredibly complex client/server with standard and custom frameworks. One of the custom frameworks built into the application involves validating workflow actions. It finds potential errors, separates them into warnings and errors, and passes the results back to the client. The main difference between warnings and errors is that warnings ask the user if they wish to ignore the error. The issue I have is that the dialog for this prompt is created on a non-ui thread, and thus we get cross-threading issues when the dialog is shown. I have attempted to invoke the showing of the dialog, however this fails because the window handle has not been created. (InvokeRequired returns false, which I assume in this case means it cannot find a decent handle in its parent tree, rather than that it doesn't require it.) Does anyone have any suggestions for how I can create this dialog and get the UI thread to set it up and call it?

    Read the article

  • Working with android and ant scripts for building applications

    - by y ramesh rao
    I want to know if we can create builds using ant's build.xml and when i'm trying to do this an error is displayed SDK location not mentioned and besides that I'm unable to find local.properties file to mention the SDK Location My aim is that I want to use my exiting code and make a build for new Android SDK's with changes in the resources and and some constant values is this task Possible with making a build using Ant and if by some other way. I have no idea about Ant and its functioning so it would very appreciable if minute details are also provided.

    Read the article

  • Using ftplib for multithread uploads

    - by Arty
    I'm trying to do multithread uploads, but get errors. I guessed that maybe it's impossible to use multithreads with ftplib? Here comes my code: class myThread (threading.Thread): def __init__(self, threadID, src, counter, image_name): self.threadID = threadID self.src = src self.counter = counter self.image_name = image_name threading.Thread.__init__(self) def run(self): uploadFile(self.src, self.image_name) def uploadFile(src, image_name): f = open(src, "rb") ftp.storbinary('STOR ' + image_name, f) f.close() ftp = FTP('host') # connect to host, default port ftp.login() # user anonymous, passwd anonymous@ dirname = "/home/folder/" i = 1 threads = [] for image in os.listdir(dirname): if os.path.isfile(dirname + image): thread = myThread(i , dirname + image, i, image ) thread.start() threads.append( thread ) i += 1 for t in threads: t.join() Get bunch of ftplib errors like raise error_reply, resp error_reply: 200 Type set to I If I try to upload one by one, everything works fine

    Read the article

  • Oracle Enterprise Server SOAP/Servlet/SoapRouter

    - by JACK
    Does anyone know any sample Oracle SOAP XML requests that that queries the database? For example, the url: http://myoracle:7778/oracle/soap/soaprouter/ I'd like to program xml requests and get return xml database. But I have no idea on the Oracle SOAP format. Please provide an example.

    Read the article

  • Increasing the width of the autocomplete extender list

    - by Kumar
    I have an ASP.NET AJAX autocomplete extender with CompletionListCssClass=autocomplete_completionListElement : .autocomplete_completionListElement { width:500px; margin : 0px!important; background-color : inherit; color : windowtext; border : buttonshadow; border-width : 1px; border-style : solid; overflow :auto; height : 200px; text-align : left; } But for some odd reason the width of the auto complete list always takes up the width of the textbox even when I set the width to 500px. Is there a way to fix this?

    Read the article

  • How to connect to a queue manager with ssl enabled server connection channel when authentication is

    - by Dr. Xray
    I am trying to write a java application connecting to server connection channel with SSL enabled. So far, I have been successfully connected to the channel by setting authentication to 'optional'. However, when I set it to be 'required', the connection fails. Here is what I did: Create key db for queue manager and keystore for the java client user. Create key/self-signed certificates for the queue manager and the client user, with names prefixed ibmwebspheremq. Export, exchange and import certificates for the queue manager and the client. (I did answered 'yes' when being asked whether I trust the queue manager cert). The location and password to the truststore and keystore are set to point to the same keystore at the client side, where the orgininal created client user key and the imported queue manager key are. With other settings being the same, if I switch back to 'optional' authentication, the connection works. I think there is something I understand incorrectly about this ssl authenticaion but cannot figure out what. Could someone kindly help me?

    Read the article

  • c++ global operator not playing well with template class

    - by John
    ok, i found some similar posts on stackoverflow, but I couldn't find any that pertained to my exact situation and I was confused with some of the answers given. Ok, so here is my problem: I have a template matrix class as follows: template <typename T, size_t ROWS, size_t COLS> class Matrix { public: template<typename, size_t, size_t> friend class Matrix; Matrix( T init = T() ) : _matrix(ROWS, vector<T>(COLS, init)) { /*for( int i = 0; i < ROWS; i++ ) { _matrix[i] = new vector<T>( COLS, init ); }*/ } Matrix<T, ROWS, COLS> & operator+=( const T & value ) { for( vector<T>::size_type i = 0; i < this->_matrix.size(); i++ ) { for( vector<T>::size_type j = 0; j < this->_matrix[i].size(); j++ ) { this->_matrix[i][j] += value; } } return *this; } private: vector< vector<T> > _matrix; }; and I have the following global function template: template<typename T, size_t ROWS, size_t COLS> Matrix<T, ROWS, COLS> operator+( const Matrix<T, ROWS, COLS> & lhs, const Matrix<T, ROWS, COLS> & rhs ) { Matrix<T, ROWS, COLS> returnValue = lhs; return returnValue += lhs; } To me, this seems to be right. However, when I try to compile the code, I get the following error (thrown from the operator+ function): binary '+=' : no operator found which takes a right-hand operand of type 'const matrix::Matrix<T,ROWS,COLS>' (or there is no acceptable conversion) I can't figure out what to make of this. Any help if greatly appreciated!

    Read the article

  • How do interpreters functions written in the class C++ in the main

    - by T_Geek
    Hi I'm working on a project about Data structures. In the first , I wrote everything in main but it sounds like C . But as I learned, I tried to thinkk OOP and do as little as possible in my main() methods. I've implemented some opertation in my class like add,delet,find.it's too easy to implement its . class ARB { private: struct BT { int data; BT *l; BT *r; }; struct BT *p; public ARB(); ~ARB(); void del(int n); void add(int n); }; void ARB::del(int num) { //The code ,don't care about it }; main() { // BTR T; T.add(3); T.add(5); }; But I arrived to the big program How can I define a methode which have to use a binary tree and to get a stack STACK ARB::MyFunct(BT* p) { // The code don't care about it } How can I apply it in the main programme main() { // BT T; T.add(3); T.add(5); STACK S; BT* p S=T.MyFunct(p); // error C2664 cannot convert parametre 1 }; **mention :I implement STACK class

    Read the article

  • Installing jdk without sudo?

    - by Legend
    Currently, I have a machine on which I am working in Eclipse, it says that the JRE System Library version is sun-jdk-1.5.0.11 but on my active development machine, it is java-6-sun-1.6.0.16. What is the difference between these two (of course, besides the versioning)? Is there any way I can make the first machine to use the same "java-6-sun-1.6.0.16" version without having sudo permissions on the machine?

    Read the article

  • Eclipse gives me a weird error when compiling...

    - by Legend
    I have this function which returns a datatype InetAddress[] public InetAddress [] lookupAllHostAddr(String host) throws UnknownHostException { Name name = null; try { name = new Name(host); } catch (TextParseException e) { throw new UnknownHostException(host); } Record [] records = null; if (preferV6) records = new Lookup(name, Type.AAAA).run(); if (records == null) records = new Lookup(name, Type.A).run(); if (records == null && !preferV6) records = new Lookup(name, Type.AAAA).run(); if (records == null) throw new UnknownHostException(host); InetAddress[] array = new InetAddress[records.length]; for (int i = 0; i < records.length; i++) { Record record = records[i]; if (records[i] instanceof ARecord) { ARecord a = (ARecord) records[i]; array[i] = a.getAddress(); } else { AAAARecord aaaa = (AAAARecord) records[i]; array[i] = aaaa.getAddress(); } } return array; } Eclipse complains that the return type should be byte[][] but when I change the return type to byte[][], it complains that the function is returning the wrong data type. I'm stuck in a loop. Does anyone know what is happening here?

    Read the article

  • How to distribute email's delivery between 2 or more servers

    - by user181186
    We provide Email Marketing service through our online App. We have about 30 customers. And each one has it's own mailling list (5k to 20k emails each). What we really want is to distribute email's delivery between 2 or more servers. I was wondering What kind of aproach/solutions MailChimp , Constant Contact uses to provide a great service ? use many servers ? many IPs ? Our spam policy suspends ANY user/customer that gets 10% bounced .

    Read the article

  • How to find long running transactions in Websphere MQ Series?

    - by raistlin
    In a J2EE environment the MQ server log shows the following: Process(954584.5) User(mqm) Program(amqzmuc0) AMQ7469: Transactions rolled back to release log space. .... While increasing the logfile size/space might be a temporary solution, the definitive solution must be to identify the culprit process/queue that causes this long transaction. Is there any solution/tool for this? Note: MQ is used via JMS only

    Read the article

  • Copy one jagged array ontop of another.

    - by George Johnston
    How could I accomplish copying one jagged array to another? For instance, I have a 5x7 array of: 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0 and a 4x3 array of: 0,1,1,0 1,1,1,1 0,1,1,0 I would like to be able to specify a specific start point such as (1,1) on my all zero array, and copy my second array ontop of it so I would have a result such as: 0, 0, 0, 0, 0, 0, 0 0, 0, 1, 1, 0, 0, 0 0, 1, 1, 1, 1, 0, 0 0, 0, 1, 1, 0, 0, 0 0, 0, 0, 0, 0, 0, 0 What would be the best way to do this?

    Read the article

  • php PHPExcel split Excel cell coordinate

    - by Shiro
    currently, I used PHPExcel to import excel file, there is a function $cell-getCoordinate(); I would like to ask any solution for split the cell coordinate alphabet and integer? e.g A1, A2, I need to know currently which row, and until which column. I do some research about split, but not luck for it. Any idea?

    Read the article

  • Good Package for Fitting Polynomial Trend Lines

    - by Rev316
    Given a simple data set, I would like to be able to calculate a trending formula given it's a second order polynomial regression. In fact, it would be great if one could even forecast X periods during calculation (similar to what Excel does). I'm looking for a portable C/C++ package that's relatively easy to use, and allows it to spit out the "best-fit" (highest R^2 value) curve. Any suggestions? Thanks!

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >