265 Topics

Member Avatar for daviddoria

I can see visible wearing on my keys in the phrase "Please use code tags when you post code" (just kidding...). Is there a way to try to auto-detect when this happens and remind the user to do so? In c++ it shouldn't be too hard, look for a few …

Member Avatar for jon.kiparsky
0
430
Member Avatar for daviddoria

I am trying to include a file 'header.php' that is in [url]http://ewh.ieee.org/r1/schenectady/[/url] From a file in [url]http://ewh.ieee.org/r1/schenectady/Events/[/url] if I do: [code] <?php include '../header.php';?> [/code] it works fine, as expected. However, if I do: [code] <?php include 'http://ewh.ieee.org/r1/schenectady/header.php';?> [/code] it does not work (the header is not displayed). Can anyone …

Member Avatar for diafol
0
166
Member Avatar for daviddoria

I have a sidebar.php which contains: [code] <a href="page.html"><src="images/MyImage.gif"></a> [/code] If I do: [code] <?php include 'sidebar.php';?> [/code] from a file that is in '/', everything works properly (because it looks in /images for the gif). However, if I do: [code] <?php include '../sidebar.php';?> [/code] from a file in, say, …

Member Avatar for Arkinder
0
152
Member Avatar for daviddoria

This page works fine in Firefox and Chrome: [url]http://ewh.ieee.org/r1/schenectady/events.php[/url] but in IE, the maincontent appears way at the bottom (below the sidebar) instead of to the right of the sidebar as it should. Google convinced me that IE has trouble with CSS, but this is such a basic thing I …

Member Avatar for Arkinder
0
159
Member Avatar for daviddoria

I have this: [code] int serialInt = 40000359; [/code] but what I really need is this: [code] int serialHex = (int)0x40000359; [/code] What can I do to turn serialInt into serialHex? I found some code that claimed to do this: [code] int IntToHex(int input) { std::stringstream ss; for (int i=2*sizeof(int) …

Member Avatar for daviddoria
0
177
Member Avatar for daviddoria

I have a style: [code] .title1 { color: #0000BB; font-size: 25pt; text-align: center; } [/code] but when I use it with: [code] <span class="title1">Schenectady Section of the IEEE More Words</span> [/code] it doesn't center the text! You can see this behavior here: [url]http://ewh.ieee.org/r1/schenectady/New/[/url] Surely I am just doing something silly... …

Member Avatar for daviddoria
0
148
Member Avatar for daviddoria

I have two pages, header.php and sidebar.php which I want to include on several pages using: [code] <?php include 'header.php'; ?> <?php include 'sidebar.php'; ?> [/code] However, there are two different issues. On this page [url]http://ewh.ieee.org/r1/schenectady/New/index.php[/url] , the included text is put BELOW the text on index.php, even thought it …

Member Avatar for daviddoria
0
89
Member Avatar for daviddoria

Currently at the top of every page I have this: [code] <HTML> <HEAD> <TITLE>Schenectady Section of the IEEE</TITLE> <META NAME='url' CONTENT='http://www.ewh.ieee.org/r1/schenectady/'> <META NAME='author' CONTENT='Authorname'> <META NAME='email' CONTENT='author email'> <META NAME='expires' CONTENT=''> <META NAME='revision-date' CONTENT='6-Sep-1999'> <META NAME='keywords' CONTENT='Schenectady Section'> <META NAME='description' CONTENT='Schenectady Section of the IEEE'> </HEAD> [/code] If I move …

Member Avatar for hielo
0
107
Member Avatar for daviddoria

I have recently taken over as a volunteer webmaster for this website: [url]http://www.ewh.ieee.org/r1/schenectady/newsletter.html[/url] Under the "Schenectady Section News" heading, you can see that there are a bunch of simple pages that all look the same. The current process to add a new one is to copy and paste an old …

Member Avatar for daviddoria
0
120
Member Avatar for daviddoria

I put a simple script: [code] <? php print "Hello world"; ?> [/code] here: [url]http://ewh.ieee.org/r1/schenectady/HelloWorld.php[/url] When I go to the page, I don't see "Hello world" displayed. Does that mean PHP is not enabled on the server? Thanks, David

Member Avatar for daviddoria
0
267
Member Avatar for daviddoria

When trying to pass a template parameter to another template, I am getting an 'invalid template parameter' error. I even tried to force it with 'typename' with no success. Can anyone see what's wrong with this? [code] #include <itkImage.h> #include <itkImageFileWriter.h> #include <itkRescaleIntensityImageFilter.h> template <class T> void WriteImage(typename T::Pointer image, …

Member Avatar for Fbody
0
4K
Member Avatar for daviddoria

If I use a template function with T where T = itk::Image<unsigned char>::Pointer, everything is fine: [code] #include <itkImage.h> class Test { public: template <class T> void Add(T patch); }; template <class T> void Test::Add(T patch) { } int main(int, char*[]) { Test a; itk::Image<unsigned char>::Pointer image; a.Add(image); return EXIT_SUCCESS; …

Member Avatar for daviddoria
0
3K
Member Avatar for daviddoria

I have a line like this: [code] <EMBED SRC="ObtainingAndBuilding_Linux.swf" WIDTH=200 HEIGHT=300</EMBED> [/code] that I want to replace 200 and 300 by the browser window width and height. I found some code like this which correctly gets and displays the width and height: [code] <HTML> <head> <script> function showWH(){ if (document.all){ …

Member Avatar for daviddoria
0
141
Member Avatar for daviddoria

I have a folder A with files 001.jpg, 002.jpg, etc I also have a folder B with different files but with the same names; 001.jpg, 002.jpg, etc I want to put all the files in the same directory - is there something that will automatically rename them or something so …

Member Avatar for MaroBey
0
170
Member Avatar for daviddoria

After reading some tutorials it looks like this is how to embed a video with html5: [code] <html> <body> <video width="560" height="340" controls> <source src="big_buck_bunny.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> </video> </body> </html> [/code] (That video is in the same directory has the .html file) When I do this, I see the …

Member Avatar for hindlist
0
92
Member Avatar for daviddoria

In the past when I've done this: [code] int function(int a) { if(a == 2) { return true; } else { return false; } } [/code] the compiler has complained that the function may not return a value. I've fixed this by adding: [code] int function(int a) { if(a == …

Member Avatar for mrnutty
0
220
Member Avatar for daviddoria

I just learned about heaps today. It looks like STL wants you to create a heap by first creating a vector, then using make_heap from <algorithm>: [code] std::vector<SimpleClass> Numbers(8); // ... populate ... // convert Numbers into a heap make_heap(Numbers.begin(), Numbers.end()) ; [/code] Why is there not a <heap> just …

Member Avatar for Narue
0
106
Member Avatar for daviddoria

Can anyone explain why the last line works? It seems like it is trying to cast a CRectangle as a CTriangle (which I imagine should fail?) but it outputs "5" as the function should. [code] // virtual members #include <iostream> using namespace std; class CPolygon { protected: int width, height; …

Member Avatar for mitrmkar
0
118
Member Avatar for daviddoria

Can anyone explain why this would fail: [code] assert(cap >= 0); [/code] But this passes? [code] if(cap < 0) { exit(-1); } [/code] That is, the assert is triggered, but if I replace it with conditional, the exit() function is never called. Thoughts? Thanks, David

Member Avatar for daviddoria
0
88
Member Avatar for daviddoria

Is it just me? Or has everyone a drastic slow down in recent days? David

Member Avatar for Stevishere
0
135
Member Avatar for daviddoria

Can anyone explain why this doesn't work? [code] #include <iostream> class Parent { public: virtual int Add(int a, int b) = 0; int Add(int a) { return this->Add(a,a); } }; class Child : public Parent { public: int Add(int a, int b) { return a+b; } }; int main() { …

Member Avatar for mike_2000_17
0
219
Member Avatar for daviddoria

I am trying to remove the need to #include stl elements in my header (a requirement for a project I work on). I wrote a "wrapper" for std::vector called "MyVector". I declare a pointer to a MyVector as a member of MyClass. Then when I try to use this in …

Member Avatar for daviddoria
0
262
Member Avatar for daviddoria

I posted a while back about how to overload << It seems all the examples online have the second argument as const, ie [code] ostream & operator << (ostream &output, const Point &p); [/code] but if I have a member function that simply returns a double [code] double Point::getX() { …

Member Avatar for daviddoria
0
196
Member Avatar for daviddoria

Dani and community, I saw this thread: [url]http://www.daniweb.com/forums/thread296478.html[/url] and it gave me an idea. With nearly 800,000 members, we should try to leverage the massive talent that has amassed on DaniWeb to collectively do some projects for some worthy causes. For example, the web design/programmers could work together to make …

Member Avatar for Lusiphur
5
246
Member Avatar for daviddoria

With std::queue I've been using this: [code] std::queue<int>::iterator pos = std::find( q.begin(), q.end(), 5); [/code] But when I try that with std::stack : [code] std::stack<int>::iterator pos = std::find( s.begin(), s.end(), 5); [/code] I get [code] error: ‘iterator’ is not a member of ‘std::stack<int, std::deque<int, std::allocator<int> > >’ [/code] Anyone know …

Member Avatar for AuburnMathTutor
0
5K
Member Avatar for daviddoria

Currently I am pointing my domain (mydomain.com) somewhere by using this as the index.html: [code] <html> <head> <meta HTTP-EQUIV="REFRESH" content="0; url=http://somewhere.com"> </head> <body> </body> </html> [/code] However, when I go to mydomain.com, it redirects to somewhere.com, but the URL is actually changed to "somewhere.com" in the browser. Is there a …

Member Avatar for diafol
0
58
Member Avatar for daviddoria

I hear perl is the way to go for string parsing, so here is the test! I have a file like this: [code] ... <li><a href="DSC_9866.JPG"> DSC_9866.JPG</a></li> <li><a href="DSC_9867.JPG"> DSC_9867.JPG</a></li> ... [/code] and I want to get a list of the file names. That is, the result I want is …

Member Avatar for daviddoria
0
90
Member Avatar for daviddoria

Hi all, I have started a wiki that I hope to make the "unofficial Daniweb wiki". Its mission is to present short, compilable answers to many commonly asked questions here on the forum. [url]http://programmingexamples.net[/url] I have seeded it with a handful of c++ examples, but I'm hoping that some of …

0
31
Member Avatar for daviddoria

Hi all, I have started a wiki that I hope to make the "unofficial Daniweb wiki". Its mission is to present short, compilable answers to many commonly asked questions here on the forum. [url]http://programmingexamples.net[/url] I have seeded it with a handful of basic operations. Please feel free to edit, add …

Member Avatar for Bench
4
151
Member Avatar for daviddoria

Hi all, I have started a wiki that I hope to make the "unofficial Daniweb wiki". Its mission is to present short, compilable answers to many commonly asked questions here on the forum. [url]http://programmingexamples.net[/url] I have seeded it with a handful of c++ examples, but I'm hoping that some of …

1
45
Member Avatar for daviddoria

I am trying to rally some troops to make some additions to WikiVersity - anyone interested? [url]http://www.pledgebank.com/openeducation[/url] Dave

0
42
Member Avatar for daviddoria

I've seen that a vector can be sorted using [code] vector<double> V; vector<int> Index; V.push_back(9); V.push_back(10); V.push_back(8); Index.push_back(0); Index.push_back(1); Index.push_back(2); sort(V.begin(), V.end()); [/code] If I want to sort Index according to how V was sorted, there is an optional third parameter to sort() that will do this. I don't understand …

Member Avatar for daviddoria
0
2K
Member Avatar for daviddoria

Any Drupal users out there?? I have created several articles ("Article1", "Article2", etc) and I want to display them on the page called "Projects". Someone told me to look at "views". I went to "structure->views" and there are a bunch of options such as "archive", "backlinks", "comments", etc. but I …

0
49
Member Avatar for daviddoria

I've seen a couple of "short lists" posted - are you guys aware of [url]http://uservoice.com/[/url] ? Here is a live site if you want to poke around: [url]http://paraview.uservoice.com/[/url] It is a really nice way to (openly) keep a list like this and collect in an extremely organized fashion users wants …

Member Avatar for daviddoria
2
288
Member Avatar for daviddoria

I posted this a while ago: [url]http://www.daniweb.com/forums/thread287028.html[/url] Since there were not many replies, I'm assuming something like this doesn't exist? Maybe DaniWeb would like to start one? Just a thought. Dave

0
102
Member Avatar for daviddoria

Is the only way to get to the "advanced search" page by searching for a blank string? Should there be an "advanced search" link under the "Search" button? Dave

Member Avatar for happygeek
1
42
Member Avatar for daviddoria

Yesterday I received a "Site Temporarily Unavailable" message on daniweb.com. The instructions asked to send an email to inform Dani of the problem. I bet that almost no one actually does this. Would it make sense to add a button that simply says "click here to report the problem" and …

Member Avatar for daviddoria
0
147
Member Avatar for daviddoria

I saw a post today that I said "hm I'd like to have a closer look at that tonight". Is there anyway to "mark" or "flag" a thread to put it in your "favorites" or something like that? Dave

Member Avatar for daviddoria
0
97
Member Avatar for daviddoria

Hi Dani et al., I don't know if you'll have any interest in this, but I'm going to describe what I have done over the past couple of years on an open source project that I think could be extremely beneficial to Daniweb as well. The project I work on …

Member Avatar for daviddoria
0
398
Member Avatar for daviddoria

I've seen a few posts on here talking about "databases" as if they were just files and using fstream to manipulate the file pointer, etc. I'm familiar with SQL, so it would be nice to simply be able to execute sql command (as can be done from vb.net) such as: …

Member Avatar for tesuji
0
235
Member Avatar for daviddoria

(I posted this in the "Geeks Lounge" but didn't get any responses - maybe there'll be better luck here?) Hi all, I was wondering if anyone one could point me to (if they exist) some places to nominate people for enormous contributions to open source and open source philosophy? There …

Member Avatar for popin
0
405
Member Avatar for daviddoria

I'm not convinced it isn't just something wrong with my installation, but has anyone else had this problem? Here is a screenshot of daniweb.com in Google Chrome on Fedora 13: [url]http://rpi.edu/~doriad/Daniweb/chrome.png[/url] And here it is (normal) in firefox: [url]http://rpi.edu/~doriad/Daniweb/firefox.png[/url] Are there any known issues like this? Or can someone else …

Member Avatar for daviddoria
0
156
Member Avatar for daviddoria

Is there a way to edit a post? I think there used to be, right? I don't see an edit button anymore :(

Member Avatar for Biker920
0
106
Member Avatar for daviddoria

I applied for the "Dinner with Dani" a while ago but haven't heard anything else. I also didn't see any mention of when things would be finalized etc. Is the status "wait patiently"? Or did I miss something? Thanks, Dave

Member Avatar for Dani
0
143
Member Avatar for daviddoria

I'm having a bit of trouble with dynamic_casting. I need to determine at runtime the type of an object. Here is a demo: [code] #include <iostream> #include <string> class PersonClass { public: std::string Name; virtual void test(){}; //it is annoying that this has to be here... }; class LawyerClass : …

Member Avatar for daviddoria
0
71
Member Avatar for daviddoria

I have some white text I am putting over a very light background. Is there anyway to outline the text in black? After some googling it looks like there are some pretty complicated solutions, but I am looking for something like a check box that says "outline". Is there such …

Member Avatar for daviddoria
0
1K
Member Avatar for daviddoria

I set the .Interval of a timer to "10", which I believe means 10 milliseconds. Since there are 1000 ms in 1 second, if I count to 100, I should have 1 second, right? The problem is, if I use a physical stop watch and compare it to my program, …

Member Avatar for kvprajapati
0
271
Member Avatar for daviddoria

Some of you may have noticed that I am always harping about "abstracting the problem" and "posting the smallest compilable piece of code that demonstrates a problem." I rambled a bit about why this is important if anyone cares to read: [url]http://daviddoria.blogspot.com/2010/05/problem-abstraction-helping-others-help.html[/url] Dave

Member Avatar for Ketsuekiame
0
90
Member Avatar for daviddoria

When I click the "Unanswered" tab to see all of the posts that have 0 replies, I get a page of threads that indeed have 0 replies. When I click on the "2" (for page 2) or the "next" button at the bottom to go to the next page of …

Member Avatar for Dani
0
44
Member Avatar for daviddoria

Consider these functions: [code] void OperateOnDoublePointer(double* a) { std::cout << a[0] << std::endl; } void OperateOnFloatPointer(float* a) { std::cout << a[0] << std::endl; } [/code] This works as expected: [code] double* c = new double[1]; c[0] = 3.3; OperateOnDoublePointer(c); [/code] but when I try to do this: [code] double* c …

Member Avatar for Narue
0
2K

The End.