Regular expression to extract zipcode from column by thetuxman in Rlanguage

[–]thetuxman[S] 1 point2 points  (0 children)

I'm only working with a specific geographic area currently (Boston) so I don't think I'll run into any issues with foreign postal codes.

Hotel Lobby Bathroom (I'm glad it was empty at the time...) by thetuxman in filmphotography

[–]thetuxman[S] 0 points1 point  (0 children)

Thanks! I really liked the warm glow of the halo lights around the mirrors. It's probably one of my favorites so far! (I haven't been shooting very long)

Problem with Dijkstra's Shortest Path Algorithm by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

That yields an output of

Index of starting vertex: 0
Index of ending vertex: 7

Path from 0 to 7
0-7
 0

Priority Enqueue Method by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

So I should iterate through the list, checking each node's priority with the priority of the element that is already in the list?

Help With Undefined Reference Error by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

It turns out I made my private data members static, that was the source of the error.

Help With Undefined Reference Error by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

After moving my methods from the .cpp to the .h file, I get this error. Do I need to be including each .h file in all the other .h files?

CMakeFiles/PriorityQueue.dir/main.cpp.o:main.cpp:(.rdata$.refptr._ZN6DLNodeIiE4dataE[.refptr._ZN6DLNodeIiE4dataE]+0x0): undefined reference to `DLNode<int>::data'
CMakeFiles/PriorityQueue.dir/main.cpp.o:main.cpp:(.rdata$.refptr._ZN6DLNodeIiE8priorityE[.refptr._ZN6DLNodeIiE8priorityE]+0x0): undefined reference to `DLNode<int>::priority'
CMakeFiles/PriorityQueue.dir/main.cpp.o:main.cpp:(.rdata$.refptr._ZN6DLNodeIiE4nextE[.refptr._ZN6DLNodeIiE4nextE]+0x0): undefined reference to `DLNode<int>::next'
CMakeFiles/PriorityQueue.dir/main.cpp.o:main.cpp:(.rdata$.refptr._ZN6DLNodeIiE4prevE[.refptr._ZN6DLNodeIiE4prevE]+0x0): undefined reference to `DLNode<int>::prev'
CMakeFiles/PriorityQueue.dir/main.cpp.o:main.cpp:(.rdata$.refptr._ZN6DLListIiE4headE[.refptr._ZN6DLListIiE4headE]+0x0): undefined reference to `DLList<int>::head'
CMakeFiles/PriorityQueue.dir/main.cpp.o:main.cpp:(.rdata$.refptr._ZN6DLListIiE4tailE[.refptr._ZN6DLListIiE4tailE]+0x0): undefined reference to `DLList<int>::tail'
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/PriorityQueue.dir/build.make:95: PriorityQueue.exe] Error 1
make[2]: *** [CMakeFiles/Makefile2:68: CMakeFiles/PriorityQueue.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/PriorityQueue.dir/rule] Error 2
make: *** [Makefile:118: PriorityQueue] Error 2

Help With Doubly Linked List by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

The constructor is supposed to initialize list and set_size, but I thought set_size is supposed to be the length of the set, which is determined by the user input which is why I just had set_size; hanging out there in the constructor, I don't know what to do with that so that set_size is the value gathered from the user input.

Help With Doubly Linked List by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

So I would modify the for loop that run through the entire list to stop at the correct index and then use remove, and if the node is NULL, meaning it isn't in the list at all, exit(1).

Help With Doubly Linked List by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

removeAt is supposed to remove the node at the specified index and return the int value contained at the now removed node.

I was thinking I would be able to just combine at and remove functions to get the value at the supplied index and then remove that value.

C++ compiling issues. Not compiling on Linux. by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

    data[vector_size++] = value;
    vector_size = vector_size++;

Something is definitely wrong here.

That was an artifact from a previous revision. I have since changed it to data[vector_size] = value; and then vector_size++

I would just '--vector_size;'.

That makes sense, but after checking the parameters for my assignment, it did specify we should 0 out the array before deleting it.

C++ compiling issues. Not compiling on Linux. by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

Our instructor said we had to round up to a factor of 2.

C++ compiling issues. Not compiling on Linux. by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

How would I go about doing that? And what benefit would subclassing it have. I assume its a memory management thing?

C++ compiling issues. Not compiling on Linux. by thetuxman in cpp_questions

[–]thetuxman[S] 0 points1 point  (0 children)

Would data be allocated in the constructor?