Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

10-31-2011 , 11:04 PM
Quote:
Originally Posted by goofyballer
So, I don't use C++ a lot and just became quite confused when I figured out that instances of child classes can't actually use virtual functions defined (only) in their parent unless you cast it to an instance of the parent class:


Is there a good reason for this?
I do you C++ a lot and don't expect it to be an error.

So I compiled your code. You were missing ; after your class definitions.

I did not get an error in vc 2010.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2011 , 02:22 AM
Really? Hrm, I wonder if that's a bug in our custom C++ implementation. The example above was just something I wrote on the fly, I wasn't missing any semicolons in the code I was working with.

For me the build error was when I tried to do

Child child;
child.DoStuff();

and after staring at it for 10 minutes wondering wtf was going on I changed it to

((Parent*)&child)->DoStuff();

and that fixed it. DoStuff() is declared virtual in the parent class (should that even matter?), not implemented in the child. Weird.

(still possible I made some insanely stupid mistake, guess I'll find out tomorrow when I look at it again!)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2011 , 04:09 AM
Quote:
Originally Posted by goofyballer
our custom C++ implementation.


Quote:
The example above was just something I wrote on the fly, I wasn't missing any semicolons in the code I was working with.
oic. In that case, I wonder if you did:

class Child : public Parent

Quote:
This is because we have used the public keyword to define the inheritance relationship on each of the derived classes:


class CRectangle: public CPolygon { ... }


This public keyword after the colon (:) denotes the most accessible level the members inherited from the class that follows it (in this case CPolygon) will have. Since public is the most accessible level, by specifying this keyword the derived class will inherit all the members with the same levels they had in the base class.

If we specify a more restrictive access level like protected, all public members of the base class are inherited as protected in the derived class. Whereas if we specify the most restricting of all access levels: private, all the base class members are inherited as private.
Now all we need is a not-helpful compiler error message and it all makes sense.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2011 , 11:41 AM
yeah lol custom C++ implementation. how you doing on incorporating the new C++11 features?

if you work with c++ and haven't read Effective C++: 55 Specific Ways to Improve Your Programs and Designs , you probably should (although one of my co-workers suggested that a better subtitle would be '55 specific reasons not to write software in c++').
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2011 , 01:48 PM
Quote:
Originally Posted by Chips Ahoy
Quote:
Originally Posted by tyler_cracker
yeah lol custom C++ implementation. how you doing on incorporating the new C++11 features?

if you work with c++ and haven't read Effective C++: 55 Specific Ways to Improve Your Programs and Designs , you probably should (although one of my co-workers suggested that a better subtitle would be '55 specific reasons not to write software in c++').
With our C++ implementation it's actually really rare that I have issues with it and it adds some really nifty features that I don't know how I'll live without if I ever leave.

I'm blissfully unaware of what C++11 is.


Anyway, it turns out the example that I wrote above is over-simplified and it actually works for me - the issue seems to be with overloading virtual functions, which I wasn't doing in the example. I tried compiling this and it gave an error:

Code:
struct StructOne
{
	float x;
	float y;
};

struct OtherStruct
{
	int x;
	int y;
};

class Parent
{
public:
	virtual ~Parent() {}
	virtual int DoStuff( StructOne* x ) { return x->x + x->y; }
	virtual int DoStuff( OtherStruct* y ) { return (int)(y->x + y->y); }
};

class Child : public Parent
{
public:
	// redefine one function from parent
	virtual int DoStuff( OtherStruct* y ) { return (int)(y->x - y->y); }
};

int main( void )
{
	StructOne x = { 1, 2 };
	Child child;
	child.DoStuff( &x );
}
Quote:
'()' : incompatible types converting from 'struct StructOne*' to 'struct OtherStruct*'
see parameter #1 for Child:: DoStuff
Does that work for you, Chips?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2011 , 02:57 PM
Quote:
Originally Posted by goofyballer
Anyway, it turns out the example that I wrote above is over-simplified and it actually works for me - the issue seems to be with overloading virtual functions, which I wasn't doing in the example.
ah ha.

Quote:
Does that work for you, Chips?
It does not.

If I comment DoStuff out of child then it does compile.

Overloading in a derived class hides the base class names. Virtual has nothing to do with it.

Since mixing overloading and virtual has this trouble, don't do it. If you want the public interface of the classes to have overloads, then put public non-virtual overloads in the base class that call private virtuals with distinct names.

Last edited by Chips Ahoy; 11-01-2011 at 03:05 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2011 , 04:01 PM
Code:
class Child : public Parent
{
public:
	// redefine one function from parent
	using Parent::DoStuff;
	virtual int DoStuff( OtherStruct* y ) { return (int)(y->x - y->y); }
};
fixed your compile error.

http://publib.boulder.ibm.com/infoce...se_derived.htm

I've never seen this trouble before because aside from initialization, I always use base classes. Usually pure virtual base classes -- like COM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2011 , 04:55 PM
Yessss, thanks!



That fixed it for me as well.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 06:55 AM
Quote:
Originally Posted by kyleb
lol wtf
Quote:
Originally Posted by _dave_
sticking this (glob.glob python) into the google led me to an article suggesting glob.iglob is faster on hudge lists of files since it returns an iterator and not an in-memory list: http://everydayscripting.wordpress.c...s-really-cool/

Maybe worth a try! tbh tho I have no idea, I only googled it because I know zero python yet and wondered wtf glob.glob meant

2.3 million files in the worst directory. Using os.dirlist takes about 5 minutes of CPU time to list them. Not near as long the next run so other stuff must have been going on. Will have to see if there is a way to poll the load on the box while the script is running and kill it if the load is too high.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 02:00 PM
Stupid quick question:

In SQL is there a difference between

Select Items.Status From Items

and

Select Status From Items ?

(Assuming the From table is not a join with multiple of the same field, its one table)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 02:05 PM
Quote:
Originally Posted by kerowo
2.3 million files in the worst directory. Using os.dirlist takes about 5 minutes of CPU time to list them. Not near as long the next run so other stuff must have been going on. Will have to see if there is a way to poll the load on the box while the script is running and kill it if the load is too high.

Googling lead me to this
You can list a directory containing 8 million files! But not with ls..


Havent really tested it but maybe something to try?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 02:15 PM
Quote:
Originally Posted by Jeff_B
Stupid quick question:

In SQL is there a difference between

Select Items.Status From Items

and

Select Status From Items ?

(Assuming the From table is not a join with multiple of the same field, its one table)
I expect someone will correct me with a technical distinction but in practice they're equivalent. For anything beyond the most trivial ad-hoc query I try to specify the table (by abbreviation) generally as anytime I don't I end up joining another table in later and have to revisit virtually every line of the query.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 02:48 PM
Quote:
Originally Posted by Jeff_B
Stupid quick question:

In SQL is there a difference between

Select Items.Status From Items

and

Select Status From Items ?

(Assuming the From table is not a join with multiple of the same field, its one table)
As far as I am aware, these are identical.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 02:58 PM
Quote:
Originally Posted by Jeff_B
Googling lead me to this
You can list a directory containing 8 million files! But not with ls..


Havent really tested it but maybe something to try?
Nice, that link didn't work for me but this did: http://www.olark.com/spw/2011/08/you...t-not-with-ls/

We aren't to the point were we can't use listdir yet and hopefully won't get there...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 06:24 PM
So if I'm a total newbie to SEO and just would like to get my company's appearance in google improved, what's the best way to proceed?

If I was paying someone, what should I pay? Anyone here do this?

Thanks in advance.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 06:36 PM
backlinks backlinks backlinks. If you're paying "SEO people", be very careful lol.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 06:36 PM
I would check out this thread:

http://forumserver.twoplustwo.com/30...rience-282753/

It's huge, but the last few pages are about that topic.

Tough to specify where to start, but SEOmoz is a good place to read their blogs and such.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 06:56 PM
Yeah just to add more information, I'm not currently looking at paying someone now...

We just launched an entirely new version of our website and we're aggressively moving into new states with our SaaS product (requires customization for each state), so it would be nice to generate some organic leads at some point from search engines.

We do currently advertise to a limited degree on search engines, so certainly we could show in the top part of google results in the ads. I'd just like to have my company show up somewhere in results when you search relevant keywords. We've put zero effort into that over the years and I have no clue how to go about improving that (or tweaking what shows when someone searches my company name).

Kyle, thanks for the thread, I'll check that out. Appreciate any other input as well.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 06:59 PM
SEOmoz has lots of free info, so you don't have to pay them a dime for it. It's all legitimate too, unlike a lot of the BS garbage out there.

Landing pages for geographic locations is super common and easy to setup. You basically outlined how you want to do it already.

An affiliate program where you get tons of inbound organic links is one of the best ways to set up incoming links; do you have something like that setup?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 07:01 PM
Quote:
Originally Posted by _dave_
backlinks backlinks backlinks. If you're paying "SEO people", be very careful lol.
rofl that's one of the best summations of SEO out there
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 07:03 PM
Gullanian:

They caught on to our SEOmoz thing
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 07:04 PM
Technical SEO for your website is pretty easy once you know all the things to do (alts, titles, nofollows, header tags, semantic tags etc).

Backlinking is the biggest PITA, time consuming and boring thing you could do if you want to do it properly (white hat). But even links that give us 1 hit a day average with 5 page views per visit average, thats 365 people a year, maybe a handful of sales! If you have a few dozen links like this you start building up nice numbers of sales. So every link really is great to have.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 07:04 PM
Yeah I saw that a month or so ago lol Thanks so much for it though it did help us out a lot! I tried to be as covert as I could lol
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 07:05 PM
Yeah it wasn't you; they just finally saw the billing thing or whatever.

Anyway if you're going to pay anyone, SEOmoz is a good organization to pay. For a little bit, anyway. It's expensive and the tools are super useful for a 3 month period, IMO.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-03-2011 , 07:07 PM
Yeah if your embarking on an SEO campaign 3 months of SEO moz is a great thing. It's expensive though
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m