User Profile

Collapse

Profile Sidebar

Collapse
akdemirc
akdemirc
Last Activity: May 5 '10, 05:26 AM
Joined: Sep 23 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • akdemirc
    started a topic key search in files
    in Ruby

    key search in files

    i am trying to find a set of keys within specific files under a specific
    directory. i read the keys from a file and iterate through them opening
    and looking all the files under the specified directory. However only
    the last key seems to be found in the files..

    Code:
    srcFiles = Dir.glob(File.join("**", "*.txt"))
    keys = File.readlines("sp.txt")
    
    keys.each{ |key|
    ...
    See more | Go to post

  • akdemirc
    replied to Error while compiling
    in C
    you should check the macro expansion at line 164

    Code:
    IMPLEMENT_DYNCREATE(CGLEnabledView, CView)
    besides it is not a good practice to implement more than one class in one cpp, try splitting into different files one for each class..
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to Error while compiling
    in C
    The error should be in your GLNew class.. I think the code you send is for CGLEnabledView and if you are able to compile CGLEnabledView. cpp without error, then we should have a look at GLNew.h and GLNew .cpp files
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to Error while compiling
    in C
    can you please post the source, it seems to be an error about 'CGLEnabledView ' class/namespace when you try to use it GLNew class
    See more | Go to post

    Leave a comment:


  • in fn function you are trying to access the first element of the iterator without checking its value (when it reaches the end of map, it will cause segmentation if you try to print), try this

    Code:
    if (i != m.end())
    { 
         cout << "i->first: " << i->first << endl; 
    }
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to Casting to void*.
    in C
    that should because you use LinkedListObjec t *object in add method without allocating it
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to Nested if statement syntax issue
    in C
    it is always a good practice to cover all if/else statements with { } to make the block clear.. Unless you make it, the compiler cannot decide for which if statement the else statement is an alternative..

    Here is what the erroneous part of your code means by the moment:

    Code:
    if(num == 4) 
    {
    cout << "4.Convert degrees c to degrees f.\n";
    } 
    
    /* the below statements are not
    ...
    See more | Go to post

    Leave a comment:


  • Herbu,

    The code looks pretty good that make it hard for me to give advice:) Perhaps you can think of removing the member variable tmp of type Vector in Matrix class which i can not see any usage of it.. Besides adding a print method both for Vector and Matrix class may be helpful in using them.. print method of Vector can simply print all elements it holds, while Matrix's print method iterates and calls the member vector's elements'...
    See more | Go to post

    Leave a comment:


  • const T &operator[] (int) const; declaration tells that this function returns a const reference of type T that cannot be modified (that make the return value only a r-value) and the const statement at the end tells us that the function guarantees not to modify any of the members of the class.
    See more | Go to post

    Leave a comment:


  • However, it could not check "tmp[0][-1] = 1.00;" is not completely true i think.. As you have boundary checks in Vector class and the -1 index is passes as parameter to Vector class' [] operator, it is the Vector class that should control the validity of this parameter.
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to How to fix ambiguous column error?
    when dealing with columns with the same name from different tables you should uniquely define each such column by preceding the table name before its name.. so in your query you should declare which you mean by WorkCodeID.. Is it tblHOURS.WorkCo deID or tblWORKCODES.Wo rkCodeID ?
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to C++ Array Question
    in C
    you are using = instead of == in both if statements,
    if (item = VALID_ITEM[sub])
    if (foundIt = "Y")

    and the statement may also cause error because of the extra << operator at the end

    cout << MSG_YES <<;
    See more | Go to post

    Leave a comment:


  • adding two similar member functions to matrix class as you have in vector seems to do what you want:

    declaration:
    Code:
    	Vector<T> &operator[] (int);
    	const Vector<T> &operator[] (int) const;

    definition:

    Code:
    template <class T>
    Vector<T> &Matrix<T>::operator[] (int idx) 
    {
    	if(idx < 0 || idx >= bitErrCntCI.size()) {
    ...
    See more | Go to post

    Leave a comment:


  • perhaps you can think of Matrix class having a member variable of type Vector<Vector<T >> rather than deriving it from Vector<Vector<T >> which makes your matrix code as follows:

    Code:
    #include "Vector.h"
    
    #ifndef _MATRIX
    
    #define _MATRIX
    
    using namespace std;
    
    
    template <class   T>   
    class Matrix {   
    public:
    ...
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to Infinite while loop
    in C
    have a look at do-while loop, it is more convenient in your case, simply force user to input as long as it has a length < 40

    do
    {
    cout << "Scrambled Text: ";
    cin >> scrambledText;

    }while (scrambledText. length < 40);

    // here you will get scrambledText.l ength > 40
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to what's wrong with my copy function?
    in C
    perhaps you should write the below line of code at the beginning:

    using namespace std;
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to doubt in declaration
    in C
    it is the same with the below which declares a function taking a first parameter of type long and a second one of type array of char:

    void pw(long, char*)
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to No matching function to call
    in C
    As point class has no c'tor without parameters and when you create a Circletype you also create a point, what the compiler complains about is that it cannot decide how to create the point class without any parameters.. as far as i see you are using the first two parameters (double initial_x, double initial_y) to initalize the members inherited from point.. so simply you can pass these two to point class and let it do its job:

    circletype::cir cletype(double...
    See more | Go to post

    Leave a comment:


  • akdemirc
    replied to how to declare ostream???
    in C
    you can try this:

    #include <fstream>
    using namespace std;
    See more | Go to post

    Leave a comment:


  • i am using 2005 server, a program actually generates these large csv files (about at size of gb) and this import process should also be done through the application by means of stored procs. as the files are generated at the computer the application runs, i shared the folder for sql server machine to have direct access for bulk insert.. the program calls a procedure from the server by passing the name of the file to be imported and the name of the...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...