As an actual lazy slacker even I put in a little bit of work before asking my peers for help. That way I can maximize the benefit I get from asking my peers by making sure they don't give me the same answer I could get frmo Google. That just makes good sense. It also helps me determine who else is a lazy slacker:)
I happen to have a printout of an article on "The Liskov Substitution Principle" and was wondering just yesterday how it is that as programmers we use these principles in everyday life yet don't know their names or the stories of how they came about. As the first US woman to earn a PhD in CS, I'm sure there are some interesting stories to tell about it.
For those who might not have her original text handy, the Liskov Substitution Principle states (rather obviously):
If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T
which, when stated in the words of Robert "Uncle Bob" Martin as something we probably all intuitively understand from our daily work, is:
Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it
"Further, violators are tagged with a complete history of their downloading activities, which is easily translated to create customer profiles for online marketing purposes"
This looks like they'll be using file sharing statistics to provide the content owners a benefit too. Seems only fair that the file sharers who, by their very actions, actually give them the information about what is popular and what is not should get compensated for that. Instead they will be fined. Way to go Nexicon/RIAA!
I've always thought the IP data types were a bit frivolous but the one thing that always gets me is that in MySQL you cannot have a table with two timestamp fields with both default to now() (or equivalent). Oh and timestamptz from PostgreSQL... life saver.
Oh and an example of a table w/ two timestamps that need a value of now():
I usually have two fields labelled creation and last_update on tables that require them. Aids in debugging and can be useful info to provide to users. I typically have them both set to now() and use a trigger to alter last_udpate just before updates. Doesn't work in MySQL though.
Don't even get me started on the lack of timestamptz.
I think he might've meant "clients" instead of "applications". In a single web application you can have multiple clients connecting to the database. Each apache child will be a new client for the db.
A foreign key has about as much impact as a unique index. I hope you don't offload unique indexes onto your application instead of letting your database handle it specially if you have multiple clients talking to a single database.
Actually the aol parental controls are installed on the computer as a separate adapter - kinda like vpn adapters. All traffic goes through them regardless of whether you're using the client or not.
This means all users (unless you're exempt on that machine) are forced to login using their aol screen names and passwords. This, in turn, means things like parental controls, online time tracking, etc become possible.
Just thought I'd throw that out there since I use it for only that purpose.
Typically I've not allowed people to use the value field (i.e. where they specify the criterion) to also specify the operator for that comparison. I keep a separate drop-down with non-mathematical and non-SQL names that I check against a whitelist of valid operators and then translate them into SQL.
As an example, for an age field i have the following operators: equals, contains, less than, greater than, etc. The "value" portion of each is identical to what's displayed on the pull down. However there's an internal method that maps "less than" to . No other operators other than those on the whitelist are allowed.
Once all that legwork is done I actually construct a full statement using helper methods that is full of your friends and mine: placeholders. Create a list of bind parameters automatically and then call prepare and execute (perl style for this example).
This has the benefit of make it safer at least from my pov. Any suggestions on improvement are very welcome!
Also a final point: I've never even thought of using non-prepared statements.. I'm surprised with all the security-testing companies making such heavy use of sql injection to butter their bread that people are _still_ using non-prepared statements. Very scary!
Looks like the midnight Black Friday sale at ChumpUSA is causing most of the/. readership (read: 75+% of american geeks) to not be around. Can this be called the Black Friday Effect?
Good thing I dont take yohimbine then. The last thing I want is to be on speed but a little dizzy. I'd rather take something that's an aphrodisiac + caffeine any day.
But that's just me.;)
Svennig,
Not sure if this answers your question but here goes:
create view svennigs_view as select * from test where criterion = 1;
select * from svennigs_view where id = 52;
The first statement will create a view which automatically filters the contents of the test table by the column named criterion. The next statement will perform a select on the view to fetch rows that not only have criterion = 1 but also have id = 52.
Just my $0.02
S
Lindos would probably be mispronounced as Lin-DOS thus relating it to a somewhat older OS:) Lindoes, however, seems to retain the pronounciation of the original Lindows.
Just my $0.02
Three words: Hack the Code. If you can't, feel free to file a bug report or just use something else. This is assuming, of course, that you RTFM. If not, then have someone who can RTFM put an mp3 server up for you.
George R. R. Martin as well. He's taking forever and a decade finishing a dance with dragons.
As an actual lazy slacker even I put in a little bit of work before asking my peers for help. That way I can maximize the benefit I get from asking my peers by making sure they don't give me the same answer I could get frmo Google. That just makes good sense. It also helps me determine who else is a lazy slacker :)
Damnit... I want to keep information on my peaks for capacity planning!
AVERAGE isn't the only archiving function you can use with rrdtool. For your purposes, you should create an additional RRA with an archiving function of MAX. http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html#IRRA_CF_cf_arguments
6. Bertrand Russell "Introduction to Mathematical Philosophy" (1919)
Europeans and the rest of the world which writes dates that way can make 22nd of July Pi day. We're sticking to March 14th.
For those who might not have her original text handy, the Liskov Substitution Principle states (rather obviously):
which, when stated in the words of Robert "Uncle Bob" Martin as something we probably all intuitively understand from our daily work, is:
"Further, violators are tagged with a complete history of their downloading activities, which is easily translated to create customer profiles for online marketing purposes" This looks like they'll be using file sharing statistics to provide the content owners a benefit too. Seems only fair that the file sharers who, by their very actions, actually give them the information about what is popular and what is not should get compensated for that. Instead they will be fined. Way to go Nexicon/RIAA!
I've always thought the IP data types were a bit frivolous but the one thing that always gets me is that in MySQL you cannot have a table with two timestamp fields with both default to now() (or equivalent). Oh and timestamptz from PostgreSQL ... life saver.
Oh and an example of a table w/ two timestamps that need a value of now():
I usually have two fields labelled creation and last_update on tables that require them. Aids in debugging and can be useful info to provide to users. I typically have them both set to now() and use a trigger to alter last_udpate just before updates. Doesn't work in MySQL though.
Don't even get me started on the lack of timestamptz.
I think he might've meant "clients" instead of "applications". In a single web application you can have multiple clients connecting to the database. Each apache child will be a new client for the db.
A foreign key has about as much impact as a unique index. I hope you don't offload unique indexes onto your application instead of letting your database handle it specially if you have multiple clients talking to a single database.
Actually the aol parental controls are installed on the computer as a separate adapter - kinda like vpn adapters. All traffic goes through them regardless of whether you're using the client or not. This means all users (unless you're exempt on that machine) are forced to login using their aol screen names and passwords. This, in turn, means things like parental controls, online time tracking, etc become possible. Just thought I'd throw that out there since I use it for only that purpose.
Typically I've not allowed people to use the value field (i.e. where they specify the criterion) to also specify the operator for that comparison. I keep a separate drop-down with non-mathematical and non-SQL names that I check against a whitelist of valid operators and then translate them into SQL.
.. I'm surprised with all the security-testing companies making such heavy use of sql injection to butter their bread that people are _still_ using non-prepared statements. Very scary!
As an example, for an age field i have the following operators: equals, contains, less than, greater than, etc. The "value" portion of each is identical to what's displayed on the pull down. However there's an internal method that maps "less than" to . No other operators other than those on the whitelist are allowed.
Once all that legwork is done I actually construct a full statement using helper methods that is full of your friends and mine: placeholders. Create a list of bind parameters automatically and then call prepare and execute (perl style for this example).
This has the benefit of make it safer at least from my pov. Any suggestions on improvement are very welcome!
Also a final point: I've never even thought of using non-prepared statements
Looks like the midnight Black Friday sale at ChumpUSA is causing most of the /. readership (read: 75+% of american geeks) to not be around. Can this be called the Black Friday Effect?
multiplexo,
Lie down here and tell me about your mother...
Or perhaps "KHA^H^H^HJOOOBS!
Best.. sig.. in a long time!
Good thing I dont take yohimbine then. The last thing I want is to be on speed but a little dizzy. I'd rather take something that's an aphrodisiac + caffeine any day. But that's just me. ;)
Think of it as a surrogate primary key ;)
If you don't mind Java GUIs, Db Visualizer is pretty slick.
Lindos would probably be mispronounced as Lin-DOS thus relating it to a somewhat older OS :) Lindoes, however, seems to retain the pronounciation of the original Lindows.
Just my $0.02
Three words: Hack the Code. If you can't, feel free to file a bug report or just use something else. This is assuming, of course, that you RTFM. If not, then have someone who can RTFM put an mp3 server up for you.