chadedge dot-com
personal blog related to technology, coding and publishing.
personal blog related to technology, coding and publishing.
Feb 23rd
So I’m still working on all that SQL stuff – now it’s up to figuring out how to get the multiple keyword search going again.
I have a method, not sure how efficient it is (I’m going to run some tests) but so far it’s working.
Update: I figured I’d use that search method above for now until I find a better method.
That’s not the end of my troubles, however. I’ve got some issue with a JOIN statement that’s not returning the right result set (the right row):
If you notice, the first query returns the CE_search_log.id row of 186. The second query returns the correct row of 194. I think it might be because of my join statement, but I’m not sure. Argh, frustrating!
Update (again): Looks like it was a JOIN problem. I needed a LEFT JOIN for the CE_dblist line. D’oh!
Feb 13th
OK, so here’s the new issue:
I’ve got a resultset with a screwy FilePath column (normally, the FilePath column has a full system-path (mac-style) stored in it). The screwy results need to have their path replaced with the correct data, without losing the actual filename that’s stored in the FilePath column.
Here’s what I’m looking at:
PMS_1106:Photos:001P1106PM.JPG
What I need to do is strip out everything but the filename (001P1106PM.JPG) and replace it with the new full system-path data.The filenames are unique, but not consistent in naming (length, letters, underscores, etc). I suppose I could work some regex magic (any a-z or A-Z 0-9 and _, – character(s), followed by a ‘.’ and [JPG|EPS|ext?]).
Hrm. might just have to experiment with this one.
Feb 9th
From How Stuff Works:
Many of us have heard of the so-called “beer goggle” effect. It’s the phenomenon that occurs when someone’s had a few alcoholic drinks and suddenly, all of those people who looked semi-attractive on entering the bar look really, really appealing. Scientists have shown that it’s not just a lowering of standards — alcohol actually stimulates the part of the brain that judges facial attractiveness.
The formula:
| β = | √L x (Vo)2 |
Source: BBC News
The formula works out a “beer goggle” score ranging from 1 to 100+. When β = 1, the observer is perceiving the same degree of beauty he or she would perceive in a sober state. At 100+, everybody in the room is a perfect 10.
Feb 9th
So I’m working on some code that will allow me to search multiple databases in a single query, returning a resultset.
Note: this is MySQL
What I’m having a tough time with is the clipper.columnName part. Each search may have many, many C[n] and O[n] values (these are the keyword items as they relate to the joins). If I have clipper.THIS and clipper.THAT, then how do I add image_server.THIS and image_server.THAT*?
I’m thinkink I might just loop the queries and pool all the results together into one XML resultset.
There should be a more efficient way, however, right?
* “clipper” and “image_server” are two databases where images are stored.
Could this be the answer?
Solved:
Thanks to Greg Miley, the problem has been solved: