Sunday, October 18, 2009

Category-key-words

Keywords are superior to directory hierarchies because things often fit into more than one category and there's more than one way of categorizing things.

But categories are kind of easier to browse without having to think too much.

Solution: each entry is entered using keywords, but the category system is generated automatically

-a top-level category for each key word
-the second level of each category has a sub-category for each remaining keyword
-and so on

Thursday, October 15, 2009

Efficient searching for substrings

I don't know if this idea's ever been done before, so I'll post it.

It's a way to search for substrings within a large dataset. Google's code, for example, I'm sure is very efficient, but doesn't do substrings. It just indexes words. The same method wouldn't work for substrings, because the sentence "I heard it through the grape vine" has 561, give or take, possible substrings.

So here's my way. It uses SQL, but obviously using hash tables or binary trees directly would also work. It's just easier to implement it in SQL, and possibly even more efficient on account of the DBE's query optimizer and so forth.

So I'm indexing the string "I heard it through the grape vine", say it's in Record 1.

my fields are (autonumber id, int nextid, char letter, int record)
we'll call the table t, just because it's convenient.

here's what i index:

(0, 1, 'I', 1) //or normalize it to lower-case so we can do non-case-sensitive searches
(1, 2, ' ', 1)
(2, 3, 'h', 1)
(3, 4, 'e', 1)
(4, 5, 'a', 1)
(5, 6, 'r', 1)
(6, 7, 'd', 1)
(7, 8, ' ', 1)
(8, 9, 'i', 1)
(9, 10, 't', 1)
(10, 11, ' ', 1)
(11, 12, 't', 1)
(12, 13, 'h', 1)
(13, 14, 'r', 1)
(14, 15, 'o', 1)
(15, 16, 'u', 1)
(16, 17, 'g', 1)
(17, 18, 'h', 1)
(18, 19, ' ', 1)
(19, 20, 't', 1)
(20, 21, 'h', 1)
(21, 22, 'e', 1)
(22, 23, ' ', 1)
(23, 24, 'g', 1)
(24, 25, 'r', 1)
(25, 26, 'a', 1)
(26, 27, 'p', 1)
(27, 28, 'e', 1)
(28, 29, ' ', 1)
(29, 30, 'v', 1)
(30, 31, 'i', 1)
(31, 32, 'n', 1)
(32, null, 'e', 1)

now i'll search for "rape".

Now here's my search query.

select a.record from t a, t b, t c, t d on a.nextid = b.id inner join b.nextid = c.id inner join c.nextid = d.id inner join a.letter = "r" inner join b.letter = "a" inner join c.letter = "p" inner join d.letter = "e"

Or something like that. I'm actually not that experienced with SQL. But you know what I'm getting at here.

The result of that search (after it's turned into sql that will actually work) will be 1, because "rape" occurs in record 1.

---

Another thing we can do is this

(0, 1, 'I', 1, 0)
(1, 2, ' ', 1, 1)
(2, 3, 'h', 1, 2)
(3, 4, 'e', 1, 3)
(4, 5, 'a', 1, 4)
(5, 6, 'r', 1, 5)
(6, 7, 'd', 1, 6)
(7, 8, ' ', 1, 7)
(8, 9, 'i', 1, 8)

etc.

where the last field is the index within the record at which that letter occurs.
it just happens to match id and nextid-1 in this example, but it wouldn't necessarily, because the same table would include many records.

that way if I searched for "rape" i would instantly know that it occurs in Record 1, at index 24, without having to do a string search through record 1's text (which is stored as a normal sting in some other table).

Also, we might want to use ints instead of chars for the letters to speed it up.

Also, for unicode you might have to do it a little differently. The same principle still applies.

It might also be safe to forgo the "nextid" field and do "...a.id = b.id-1 inner join a.id = c.id-2 inner join a.id = d.id-3...", but i don't know which way is more efficient. i suspect this way would be much less optimized.

oh, one other thing: obviously index the "nextid" and "letter" fields.

Saturday, October 10, 2009

*Possibly* Crack-Pot Idea

Have millions of users take random photos of the night sky with their digital cameras. Let them send them in to a central server. The server uses software to automatically align/rotate them with each other and group by time of year. It averages them out in order to get a very precise image of the entire night sky. It would probably want to use this precision to be able to remove the effect of light pollution from the result.
Consider this an anti-idea..

The Virtual Species: Post-Modernism Gets Physical
or Humanity's Launch into Hyper-Reality.. Next Stop: Oblivion

It's an interesting phenomenon whereby some people actually infiltrate home computers to install programs like SETI@home or Folding@home on them without their owners' permissions. It would invoke mixed feelings in me if it happened to me: it has all the nuisance of a trojan, but the intention behind it is different. It's something like, "I COMMAND that your computer work to serve humanity (and without your knowledge or consent)." Add to that the fact that I don't even agree with the Folding@home-and-ilk initiative, and I almost want to roll my eyes at such a person's choice to boldly get on that kind of a high horse.

I don't run Folding@home, and not because I want to save electricity, but because I don't believe in it. It's just a bunch of fucking manipulation. Einstein said, "the significant problems we have cannot be solved at the same level of thinking with which we created them," and I think that maxim really applies here. Forget the Power of Creation. Forget the Heart. Forget even all the modern causes of disease. Just solve the problem with manipulation. And not even physical manpilation, just some sort of abstract conceptual manipulation. But don't use human thought to do this, use computers. But don't use *one* computer, use hundreds of thousands of these silicone machines, not even individually created by humans but rather mass-produced in factories, solving our health problems by searching for virtual solutions in some ridiculously huge abstract mathematical possibility space. If the Greys really exist, and if they actually are infertile and hence creating human-Grey hybrids in order to continue their species, then this is why: they went down the same road we're going down now a long time ago.

Fuck Folding@home, Fuck Rosetta@home, Fuck Predictor@home, Fuck Foldit, and Fuck Robetta.

Fuck It Fuck It Fuck It Fuck It Fuck It!

I can feel the healing already..

Friday, October 02, 2009

More efficient color-adjusted bulbs

Give incandescent lights a better color temperature by using phosphors on the glass, instead of the typical way of using neodymium.
If Bank Robbers Were Smart..
Bank robbers should wear all black with horizontal orange or red stripes going all the way around the body. Orange and red are 'danger' colors in nature, and this would trigger the same unconscious response in the employees and customers. The robbers would be less likely to be challenged.

Tuesday, September 29, 2009

The Expanding Homeless Utility

I've had this idea for a while, but I decided I won't be the one to implement it, or at least not any time soon. So I'm sharing it with you.

The idea is for something like a homeless shelter, only it also provides opportunity for homeless persons to get back into the job market. It actually wouldn't be one homeless shelter, but many across the nation, handled by a single not-for-profit organization.

Any given center should provide:
-food
-clothing (including professional attire to borrow)
-shelter
-bathing
-transportation
-a usable address
-computers with internet
-help with resumes by someone competent in resume-making
-training in certain job skills
-a small library (with books pertaining to those skillsets, and on landing jobs)

But that's not all.
Every homeless person who enters into this program must sign a contract. The contract states that, if they get a job using this service, they must pay a certain percentage of their wages to the organization for as long as they're working. That means until retirement. This is how the organization would be able to afford all these services; without this, it might be impractical, or at least it wouldn't have the ability to expand into something very large.
It might seem harsh to garnish someone's wages for the rest of their working life. Some people think it's exploitation. But it's the only way to provide an opportunity for *mass* numbers of homeless people to get off the streets (with enough money, the program could afford also to take care of some homeless people who have no interest and/or no capability to get a job..), and for those working, I'm sure they'd rather be working and paying gratuities than still being on the streets. One could even consider it like any other tax and its accompanying social service, applicable only to a certain sub-economy within the United States. The US, as it is, has the lowest taxes of almost any developed nation, and in some of the richer countries, like Switzerland, those without jobs can collect unemployment benefits indefinitely; so rather than exploitation, the program can be considered a step in the direction of other developed nations.

Of course, it would be cruel to demand money of people who are just barely making it by as it is: consider someone who's just gotten off the streets, has 3 kids, one in college, and has some chronic medical condition.. while "expenses rise to meet income" and therefore we need to be careful with providing breaks to those "barely making it" by their own standards, in some situations we really should provide breaks. This should be a part of the contract, with the general rules laid out, though specific cases would, of course, be handled by third-party arbiters (or at least would be in the cases in which the person denied a break files an appeal).

Another option to explore, would be to require payback only during the first year (or two years, or three years or whatever) of employment directly after use of the services. This would seem less heavy-handed to would-be objectors, but it would provide only a *small fraction* of the funding otherwise available, so the program might be able to help only a small fraction of homeless persons that it otherwise might -- particularly among those who simply can't (or won't) enter into the workforce.

Monday, September 28, 2009

Duh. Benchmarks

Why does everyone struggle with unrealistic benchmarks?
Just do some logging of key presses and mouse strokes as users do normal activities within certain usage categories. Play them back within the system/language/application being benchmarked and see what the total time is. Do this for a number of different common tasks for each usage category, run them all and average the times

Saturday, September 26, 2009

Maze-in-a-pocket (A Mazing Idea!)

A hand-held device with either accelerometers or a GPS receiver (probably the latter), that can randomly generate mazes that it stores in memory. You walk around holding this device, and when you hit a wall it does one visual/sound, and when you find the exit it does another visual/sound. So you basically navigate this invisible maze until you make it out.

(it won't let you walk through walls -- if you try it'll just keep giving you the ugly noise until you get back to within eyeshot (within the maze) of the point at which you transgressed. or alternatively, it'll scrap the maze and you'll have to try a new one.)

Should be able to specify dimensions (in feet) of the maze and maze complexity (which determines thinness of the corridors).
Cheap, Tiny Computers

You know how they sell old-style gaming systems in little boxes nowadays?
Well, just do the same thing with the PC

-Use the Atom processor, so you don't need a cooling system, and you can run normal x86 apps.
-Make the whole thing a little box like no more than 3"3
-TV out instead of monitor out, so you just connect it to your TV (or, in alternative models, DVI or VGA output). simple graphics, about 2mb, no hardware 3d support
-ethernet port (and/or WiFi in alternative models)
-SSD harddrive, size depending on model - can go down to very small because you might want to use an OS for mobile devices
-DC-in and includes an adapter
-6 or so USB ports, for all your peripherals, keyboard, and mouse. (just forgo the ps/2 ports and any other ports.)
-RAM? Nowadays 1 GB goes for $10, at least for PC RAM. On the downside, for cost, PC RAM is more mass-produced, but on the upside this RAM doesn't have to be nearly as fast.
-main board? *shrug* make something up. this device is meant to be *functional*, it doesn't necessarily have to be super-fast.
-OS? Linux geeks might get a kick out of these, so make a version with linux. Also, maybe one with XP. Maybe even Windows 7, it's pretty efficient. Other considerations: Windows CE, Windows XP Embedded, Google Chrome OS, FreeBSD, ReactOS? (probably not finished enough), Xandros, PCLinuxOS, Mandriva, Aurox (all easy linux distributions)

Night Vision Without Electronics

a way to have night vision goggles
-in full color
-not requiring any electronics
-perfect resolution

Use BINOCULARS except having a magnification of exactly 1x.
if your front lenses are, say, twice as wide as your viewing lenses, your view will be gathering 4x as much light. if they're three times as wide your view will be gathering 8 times as much light, etc.