tag:blogger.com,1999:blog-64913202024-03-13T21:30:54.815-07:00Ideasinhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.comBlogger117125tag:blogger.com,1999:blog-6491320.post-73419894396177582982012-01-20T16:11:00.001-08:002012-01-20T16:11:16.198-08:00formspring.meAsk me anything <a href="http://www.formspring.me/inhahe" target="_blank">http://www.formspring.me/inhahe</a>inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com78tag:blogger.com,1999:blog-6491320.post-48878486202478570142011-05-04T08:25:00.000-07:002011-05-04T08:25:17.366-07:00I heard a joke today, "Why are camels called the ships of the desert?" "...because they're full of Arab seamen"<div><br />
</div><div>and it got me thinking, you really could make ships of the desert. all you really need is a huge vehicle with a) gigantic tires, and b) sails. it works just like a ship, and the tires are big enough to make running over bumps and cacti negligible.</div><div><br />
</div>inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-35175411343753802982011-03-01T18:39:00.000-08:002011-03-01T18:41:33.938-08:00skimming over my previous post and i have nfi what i was talking about. anyway, here's a good idea.<br />
<br />
make a book of one-liners creatively describing depression. no, idon't think it'll just make people more depressed; i think it mayhelp cure it.here's an example:<br />
<br />
<br />
»<br />
<br />
shelbyfero shelby fero <br />
I think depression must feel like getting kicked off of every reality show first.<br />
4 minutes ago Unfavorite Undo Retweet Reply<br />
<br />
just ask like 300 people how they think of depression - on creative terms.. and compile. voila!<br />
<br />
hmmm. i bet weird al likes this idea. <prays al="" to="" weird=""><prays al="" to="" weird=""></prays></prays>inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-3346699441067564672011-01-09T14:06:00.000-08:002011-01-09T14:06:10.440-08:00ok so my idea<br />
it's like a school, but part of the function is to impregnate people's minds with a collection of symbols that will do them well for a long, long time.<br />
<br />
i can give you a couple of candidate lists<br />
<br />
1a - courage, bravery, loyalty, nerve and (yuck) chivalry<br />
1b - hard work, tolerance, loyalty, and fair play<br />
1c - intelligence, creativity, learning, and wit<br />
1d - ambition, cunning, leadership, resourcefulness, expertise <br />
<br />
2a - http://www.ascendpress.org/language-of-light/LOLsingle.html<br />
2b1 - http://www.ascendpress.org/language-of-light/LOLdual.html<br />
2b2 - http://www.ascendpress.org/language-of-light/LOLdual2.html<br />
2b3 - http://www.ascendpress.org/language-of-light/LOLdual3.html<br />
2c1 - http://www.ascendpress.org/language-of-light/LOLtri1.html<br />
2c2 - http://www.ascendpress.org/language-of-light/LOLtri2.html<br />
<br />
3 - http://www.ascendpress.org/loone-main.html <br />
<br />
warning: 3 is really high info - you could get dizzy - take the symbols slowly.<br />
<br />
impregnation could work through a) meditating on the symbols, b) sharing in groups with other people on the same symbol path, andor c) having people take a symbol, and then practice on it for a while to the mentor's satisfaction.. if they want.<br />
<br />
this is all just an idea, and i don't really know if it's a good one. i'll let you be the judge of that.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-64449471422090804762011-01-03T06:56:00.000-08:002011-01-03T06:56:00.779-08:00To help ease the tension of cops saying what you are and aren't allowed to do to fulfill their ego, I propose that cops' uniforms be brighter colors.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-12224578289625773892010-12-01T12:59:00.001-08:002010-12-01T12:59:07.703-08:00I always think a good icebreaker would be to give away gifts. Like you just need to carry one around with you in your pocket or something.<br />
So… what we need, is a social excuse for ppl to bring around gifts to give to supposedly random people!<br />
Now, the excuse is…<br />
You buy the gifts in contract with some charity cause - the gifts that are sold that way, in the stores that support it - and the trick is that the charity money can only be activated by somebody who didn’t buy the gift. <br />
I don’t know how to verify it - obviously the cashier would have to know something about your information. If you pay with cash or credit, I suppose that part’s easy. If you pay with cash, who knows… a driver’s license number or phone number maybe.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com19tag:blogger.com,1999:blog-6491320.post-88622385553564492392010-11-24T07:50:00.000-08:002010-11-24T07:50:58.091-08:00i used to keep this idea to myself because I wanted to be the one to start and/or run the organization. Now I care about other things..<br />
<br />
The idea is called ProCat, or Project Catalyst Organization. The idea is to establish a non-profit organization, with legal bindings, and they allow it to allow the citizens to establish ideas, submit variations on ideas, and vote on them - ideas for improving the town, like, for example, establishing a new park. But it's not this simple.<br />
<br />
The citizens themselves -- maybe, at least sometimes -- pay for the project (because there may be no other way). So, how does it work?<br />
<br />
Say 1,000 people vote on a new park. Bob submitted an idea, Marly modified it, more people voted on Marly's modification, all 1,000 of them (or maybe not all) committed to paying a certain amount toward the project, but ONLY IF the project passes successfully. They probably committed varying amounts of money, but if it adds up to being enough then they all win. If it doesn't?? Nobody pays!<br />
<br />
Obviously we can't trust somebody with that last $100 it takes to make a park just because they committed to it, so what the idea should probably be is that they *already* pay and THEN if it falls through - for lack of enough funds or for some other reason - then they all get paid back; the organization we *can* trust.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-11502085284991464762010-11-24T07:39:00.001-08:002010-11-24T07:39:44.724-08:00i always want to see - i don't know if exists - i know something like it did for a while - a forum where people review bills, people translate bills to plain english, to varying levels of detail, and make sure not to forget the zingers, and and people - average citizens - comment on bills, rate them, submit ideas for variations, rate them, rate variations, submit variations of variations, and rate or vote up/vote down others' comments.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com41tag:blogger.com,1999:blog-6491320.post-60378502757093828882010-11-21T16:12:00.001-08:002010-11-21T16:12:47.684-08:00i will never say goodbye but you will not talk to me and everyone hates me and i don't want to inflict twilight upon you.<br />
<br />
two tries with twitter is enough for me.<br />
<br />
if you want anything, please contact me.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com0tag:blogger.com,1999:blog-6491320.post-69082666950868602712010-11-21T15:03:00.001-08:002010-11-21T15:03:49.912-08:00I always think a good icebreaker would be to give away gifts. Like you just need to carry one around with you in your pocket or something.<br />
<br />
So… what we need, is a social excuse for ppl to bring around gifts to give to supposedly random people!<br />
<br />
Now, the excuse is…<br />
You buy the gifts in contract with some charity cause - the gifts that are sold that way, in the stores that support it - and the trick is that the charity money can only be activated by somebody who didn’t buy the gift. <br />
<br />
I don’t know how to verify it - obviously the cashier would have to know something about your information. If you pay with cash or credit, I suppose that part’s easy. If you pay with cash, who knows… a driver’s license number or phone number maybe.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com0tag:blogger.com,1999:blog-6491320.post-22397129616334545232010-10-15T02:25:00.001-07:002010-10-15T02:25:07.237-07:00for tv shows and cartoons<br />
have one individual writer write for each individual character.<br />
(more or less, even.)inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-5930688145060741652010-08-24T04:08:00.000-07:002010-08-24T04:09:09.620-07:00Graphics cards should be able to mix indexed 256-color palette modes with 32-bit color modes, as a texture or 2-d overlay or something. That way you could do cool tricks that involved changing the palette without having to change your system's screen mode.<br />
<br />
Even cooler, allow this in JavaScript.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-45978591497796054592010-08-17T15:41:00.000-07:002010-08-17T15:44:02.061-07:00Wouldn't it be great if I could, say, for example, listen to music playing Winamp visualizations and stream it to one of my blogs as a dynamically changing background?<br />
<br />
As the communication channels get faster, how will IT technology adapt to take advantage of it?<br />
<br />
NativeClient (one of Gooogle's pet projects) takes native code and rigorously proves using proof theory that it can't commit any kind of violation or infraction under any circumstances, so it's safe. That allows websites to send native code to the client for execution, which is probably dozens of times faster than JavaScript with JIT. The drawback is, of course, that any CPU architecture that isn't supported - well - won't be supported. But x86 isn't the only architecture they're pursuing, and as of now, Windows, Linux, FreeBSD and Mac computers all use x86 anyway. Mobile devices don't, but some of them don't even show Flash..(>:)).. and ARM is probably one of the architectures they're pursuing anyway. <br />
<br />
With NativeClient I could program my *own* visualizations to be running as a page background, all the time. <br />
<br />
But let's say I wanted to stream it? HTML 5 might be able to handle that, with sufficient speed. But of course if it's a public blog site, the blog site must allow that kind of connectivity for me to stream it. How generalized would this ability be? Quickest solution: JavaScript can send requests to domains other than the document's origin. XmlRpcRequests aren't that good at streaming, though; you'd normally have to use a hidden frame for that. <br />
<br />
And let's say 5 people read my blog simultaneously? Would I want to have to waste bandwidth streaming the same visual to all 5 of them? Why couldn't I just use multicast? But now we have to allow the consumer to use multicast, and we have to allow JavaScript to tap in.. <br />
<br />
I imagine new APIs usable by blogger sites or any other site that would make such communications (and much more) possible, but what exactly will the APIs contain? <br />
<br />
Basically we're talking about shifting into a more dynamic and freely flowing information age. I have mixed feelings about that in general, but it's -going- to happen, so the sooner we get to thinking about how we're going to do it *right*, the better.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-41381943796878347862010-08-16T23:27:00.000-07:002010-08-16T23:27:18.025-07:00inhahe: i just thought of a good prank to pull on telemarketers<br />
inhahe: first time one calls, answer, don't speak, record their reaction<br />
theteofscuba: they don't even use the do not call registry any more<br />
inhahe: second time one calls, play back the recording of the first one<br />
inhahe: and record their response<br />
theteofscuba: we get telemarketers calling daily<br />
inhahe: third time one calls, play back the second telemarkter's response and record their response<br />
inhahe: etc.<br />
theteofscuba: hmminhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-13243550531069961472010-06-30T15:17:00.001-07:002010-06-30T15:22:16.960-07:00Ngodot1800: we were talking about my former or her present boss Barbara <br />inhahe: oh, my mom was talking about bosses today.<br />inhahe: she had a great idea<br />inhahe: it was<br />Ngodot1800: which was?<br />inhahe: there should be a radio show called 'be careful, your boss may be listening'<br />inhahe: people can call in to complain about their bosses<br />inhahe: and now and then play a song like 'shove this job'<br />inhahe: and once a year have a thing where you praise bosses who are nice<br />Ngodot1800: I will spend one nanosecond per decade doing thatinhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com0tag:blogger.com,1999:blog-6491320.post-43927343702241968882010-04-22T15:01:00.000-07:002010-04-22T15:45:38.020-07:00<span style="font-weight:bold;">Idea for images.google.com</span><br /><br />A link under each image for "similar images." This isn't some AI comparison feature. This is simply finding more-or-less identical images, that may just be in other resolutions or image formats. <br /><br />The way to do this would be to scale each picture down into a smaller grid, i hear 4x4 is a good number. Then just take a hash of the 16 color values. (the color gamut should also be scaled down, but not sure by how much.) Everything with the same hash is an identical picture. <br /><br />It would be nice if relative comparisons could be made, i.e. ordering pictures by similarity, too. How many pixels (and the color gamut) you scale the image down to determines how precise a match has to be to fit; so google could choose a level that they think will satisfy the average user. Or, they could even create multiple hashes for each image based on different scales, then order image results by which hashes match...<br /><br />Even more convenient would be if there were some kind of hash where the linear difference between any two hashes is also the level of difference between two pictures. I'm not quite sure if that's logically possible, but then, the above idea can actually be thought of that way..<br /><br />To actually compare image distances, a good way could be to take color distance between every corresponding pixel between the two grids, square each distance, sum them, then take the square root of that.. but that's way too intensive a comparison for a google search. (Also it ignores the dimension of object borders changing location, but that could be solved by a 2-dimensional levenshtein distance.. which is even more insanely computation-intensive. and i wonder how you can integrate that with a color distance formula.. i wonder if it would work to take an n-dimensional levenshtein distance ( http://www.itl.nist.gov/iad/mig/publications/storage_paper/lrec06_v0_7.pdf ) where L*a*b are three dimensions and x, y location are two more..)inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-33788471830189859632010-03-11T09:56:00.000-08:002010-03-11T10:34:35.315-08:00<span style="font-weight:bold;">This needs to be done.</span><br /><br />Wouldn't you like to be able to take a day - or a week - off, whenever you wanted?<br /><br />Is it me, or is one of the main stresses in life due to having to be at work *every* work day for years on end, *on time*, or risk being fired, which poses the further risk of living on the street?<br /><br />Aside from the needlessly totalitarian exactly-on-time aspect, I can see why a company wouldn't let you just take a day, or a week, off whenever you wanted. If there's only 10 other people working there who can fulfill your position, then they can't necessarily afford to lose a spot unplanned. Even if there's 1,000 people working for the company who can fulfill your position, most of them are probably in other cities. <br /><br />If there were 1,000 people who could fill in for the same position working within one facility, they should be able to afford to let people take some time off whenever they want (barring holidays, etc.), because statistically it will even out and you'll always have roughly the same amount of people who *want* to work that day because they need to make enough money to live. Of course, whether companies actually *would* provide that grace to their employees just because they can is probably a different matter, but that's not the point here.<br /><br />What if people, in general, had say...5 different jobs? Instead of working the same job every day, you'd work a different one every day of the week. Except it would be more efficient if you didn't always work the same job the same day of the week - if it switched around according to need. Now, instead of hiring one person for a position, they'd hire 5, and each person would work 1/5th of the time, more or less. If a company otherwise had 10 people interchangeable for a certain position, now they have 50. Arrangements would have to be made, somehow, inter-company and between companies and employees, on a day-by-day basis. This could all be automated online, by simply letting the employee bid for a day or string of days off, and letting the computer do the rest of the work and tell people where to go.<br /><br />This also makes life more fulfilling for the employee, by breaking the monotony of having to do the same thing, and work with the same people, every single work day, and by expanding his/her working skillset.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com2tag:blogger.com,1999:blog-6491320.post-83077638673857843122010-03-10T02:01:00.001-08:002010-03-10T02:01:39.850-08:00formspring.meAsk me anything <a href="http://formspring.me/inhahe" target="_blank">http://formspring.me/inhahe</a>inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com0tag:blogger.com,1999:blog-6491320.post-1370338123076603982010-03-05T23:59:00.000-08:002010-03-06T00:14:31.658-08:00<span style="font-weight:bold;">Uniform / easier PC's</span><br /><br />PCs would be a lot easier for a lot of people if there were only one type of connection - for everything. <br /><br />ps/2 ports for keyboard and mouse are all but obsolete, pretty much any new k/b or mouse uses usb. but we still have, for example, cat-5e ports. why not make network cables use USB ends? <br /><br />that still leaves a few more things that could be converted - at least once we get the new usb 3.0 spec. <br /><br />SATA? Why? Just replace it with USB. Put USB ports inside the computer. <br /><br />PCIe? Replace it with USB. Provide sufficient means for cards to dock inside the computer. In fact, strategically place the USB port inside the dock so we don't have to use wires. This could be done with internal drives, too.<br /><br />That pretty much leaves just HDMI, VGA, and DVI output. VGA is analog but totally obsolete. There's no reason to use VGA anymore. In fact it's a travesty unless you have a CRT. HDMI is a bit outside our domain of consideration because it's an interface to a non-computer device; you can't control that, there are too many non-computer devices out there. DVI, on the other hand, could be usurped by USB. Let's see.. usb 3.0 will be 3.2 gbit/s after protocol overhead, one pixel is 24 bits, that's a possible 64 frames per second at 1920x1080 resolution. Well, I guess it just barely cuts it in that department. We can always sell new monitors with USB connectors that require up to 3.2 gbit/s, and after that use dvi... until we get USB 4.0<br /><br />Wouldn't it be awesome if there all computers had exactly one type of port and came with about 12 of them?inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-68899373748115547722010-01-13T06:39:00.000-08:002010-01-13T07:04:02.143-08:00<span style="font-weight:bold;">Better Translating Service</span><br /><br />the problem of making an intelligible automated translation -- much more one that's actually reasonable-sounding -- is not easy, and it's not exactly solved anywhere.<br /><br />the proposal is to make translations more direct and decipherable by not "sugar-coating" them trying to put them into regular English (or any other recipient language obviously) grammar. For example, Mandarin grammar is *completely* different from English grammar. When translating from Mandarin, notation (brackets, etc.) could be used instead of normal English grammatical structures to relay the grammatical structure of the Mandarin phrase. Most people aren't too stupid to get the hang of such a system after a couple of translations; the bigger problem is simply not knowing the words of another language. <br /><br />Another example of this feature is how to handle agglutination. To translate a complicated German agglutinated word into English, we could simply say present something like zeitgeist, for example, as "time-spirit." People are intelligent enough to infer the real meaning behind such things based on context in a lot of cases; again, the translator only needs to come half-way. The reader simply can't be bothered to spend years learning a language just to translate one text.<br /><br />Another great feature would be the ability to click on any word in the translation and get a pop-up list of various other words it could have been translated as. Obviously translations aren't strictly word-by-word, but most of the time a word should be able to be tagged (in html id attribute for example) as having been a translation of another word in the foreign text, for use during lookup. <br /><br />Also, in some cases where there are only 2 or 3 different possible translations of a word but they're significantly different from each other, the word could be presented in a way that shows all of them; for example, "geist" could be show up as "[ghost|spirit]"inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com9tag:blogger.com,1999:blog-6491320.post-71248826131962228162009-12-04T14:26:00.000-08:002009-12-04T19:56:14.621-08:00<span style="font-weight:bold;">SimpleSort</span><br /><br />This is an algorithm to compete with the current slowest sorting algorithms.<br /><br />1. We're given our list to sort, L<br />2. Create a list of length 0, M<br />3. Randomly, either append a random* value to the end of M, or remove the last value. If M has length 0 then we do not remove the last non-existent value.<br />4. Check if all elements of M are in L.**<br />5. If yes, check if all elements of L are in M.<br />6. If yes, check if M is in order.***<br />7. If no, repeat from Step 3. If yes, we've sorted it.<br /><br />* this could be problematic.<br />if it's an int of size 32 for example, we can just add a number from -2^31 to 2^31-1. <br />if it's a float, we could do something similar for the 80-bit or 64-bit floating point value. <br />if it's a bignum, we can apply step 3 to the number itself as a string of digits.<br />if it's a string, we could also apply step 3 here. <br />if it's some arbitrary object, we can randomize every primitive type it's composed of in the above manners<br /><br />** something like:<br />for x in M:<br /> if not x in L: <br /> break<br />else:<br /> it's in there.<br />and vice versa for Line 5.<br /><br />*** something like:<br />M += [+inf]<br />for i in 0...len(M):<br /> if M[i] > M[i+1]:<br /> break<br />else:<br /> it's sortedinhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com1tag:blogger.com,1999:blog-6491320.post-67508485484514237162009-12-04T01:23:00.000-08:002009-12-04T01:27:04.261-08:00<span style="font-weight:bold;">RJavaScript</span><br /><br />theteofscuba: it would be veryu cool if html provided support for the same idea behind silverlight and allow people to use javascript to script it instead of using actionscript in flash or .net in silverlight<br />theteofscuba: and providing support for an xml format of 3d models so javascript could be the basis for a 3d engine<br />theteofscuba is offline (3:59:46 AM)<br /><br />Your IM will be delivered when the buddy goes online.<br />inhahe: i agree<br />inhahe: that javascript should be integrated with something like silverlight<br />inhahe: so that you use teh same language for everything<br />inhahe: there is one problem wit hthat though<br />inhahe: silverlight/flash apps might be more cpu intensive in some case because they're more graphics involved<br />inhahe: and javascript, even the next-gen js engines, is very slow compared to .net <br />inhahe: not sure about flash, i would imagine actionscript is faster too<br />inhahe: this is a fundamental limitation given by the afct that javascript is a more dynamic language<br />inhahe: one interesting prospect would be to provide something syntactically similar to javascript but that is really just a subset of the language, so operations requiring teh particular dynamicism of javascript won't work within a restricted javascript block<br />inhahe: so that they can be compiled into faster code and used for things that need more speed<br />inhahe: ideally you would be able to define a restricted javascript block whether or not you're doing graphics-speciifc thinsg and you should be able to do graphics-specific things whether or not you're using restricted jaovascript<br />theteofscuba's offline IM storage is full.<br /><br />RJavaScript would be to JavaScript what RPython is to Python.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com0tag:blogger.com,1999:blog-6491320.post-54236714143373797882009-12-03T08:00:00.000-08:002009-12-04T03:11:03.979-08:00<span style="font-weight:bold;">Hash Table Sort</span><br /><br />For a given input list of size n, make a hash table of size n*2. <br /><br />Run through the list once to determine its maximum and minimum values. <br /><br />Create a hash function that puts an item in a slot depending on where it lies in between the minimum and maximum values. For example, if there are 50 slots, the minimum value is 10, and the maximum value is 20, then a value of 12 would go into the 10th slot. (A comparable formula *can* be used for strings.)<br /><br />After placing all the items, go through the hash table and sort each individual linked list, using the sorting method most efficient for its size (probably always an insertion sort where the input list is randomly distributed). Concatenate all the sorted lists end-to-end.<br /><br />This algorithm is less particularly advantageous the less unevenly distributed the input list, but we can always mitigate that problem by using an n*n hash table or just a larger hash table to any degree. Even an n*(n/x) hash table where each secondary table is a table of linked lists.<br /><br />This algorithm could also use a histogram to determine individual slot ranges and secondary table sizes.<br /><br />Where the range of values is smaller than the length of the list, you don't actually need a hash table of size n*2. It can be of size range*2.<br /><br />I think this whole idea is just reinventing the bucket sort. Oh well.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com0tag:blogger.com,1999:blog-6491320.post-143668943459241952009-10-18T12:29:00.001-07:002009-11-29T03:47:32.893-08:00<span style="font-weight:bold;">Category-key-words</span><br /><br />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.<br /><br />But categories are kind of easier to browse without having to think too much.<br /><br />Solution: each entry is entered using keywords, but the category system is generated automatically<br /><br />-a top-level category for each key word<br />-the second level of each category has a sub-category for each other keyword existing in all its elements<br />-and so on<br /><br />for example<br /><br />object a, keywords b, c, e<br />object b, keywords d, e<br />object c, keywords q<br /><br />hierarchy:<br /><pre><br />b (object a)<br /> c (object a)<br /> e (object a)<br /> e (object a)<br /> c (object a)<br />c (object a)<br /> b (object a)<br /> e (object a)<br /> e (object a)<br /> b (object a)<br />d (object b)<br /> e (object b)<br />e (object a, object b)<br /> d (object b)<br /> c (object a)<br /> b (object a)<br /> b (object a)<br /> c (object a)<br />q (object c)<br /></pre><br />it might look like a really complicated hierarchy, but my theory is that it's not so complicated when you're collapsing and expanding branches at will from the top down.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com0tag:blogger.com,1999:blog-6491320.post-3637922253946748772009-10-15T18:25:00.001-07:002009-10-15T19:24:39.525-07:00<span style="font-weight:bold;">Efficient searching for substrings</span><br /><br />I don't know if this idea's ever been done before, so I'll post it.<br /><br />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.<br /><br />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.<br /><br />So I'm indexing the string "I heard it through the grape vine", say it's in Record 1.<br /><br />my fields are (autonumber id, int nextid, char letter, int record)<br />we'll call the table t, just because it's convenient.<br /><br />here's what i index:<br /><br />(0, 1, 'I', 1) //or normalize it to lower-case so we can do non-case-sensitive searches<br />(1, 2, ' ', 1)<br />(2, 3, 'h', 1)<br />(3, 4, 'e', 1)<br />(4, 5, 'a', 1)<br />(5, 6, 'r', 1)<br />(6, 7, 'd', 1)<br />(7, 8, ' ', 1)<br />(8, 9, 'i', 1)<br />(9, 10, 't', 1)<br />(10, 11, ' ', 1)<br />(11, 12, 't', 1)<br />(12, 13, 'h', 1)<br />(13, 14, 'r', 1)<br />(14, 15, 'o', 1)<br />(15, 16, 'u', 1)<br />(16, 17, 'g', 1)<br />(17, 18, 'h', 1)<br />(18, 19, ' ', 1)<br />(19, 20, 't', 1)<br />(20, 21, 'h', 1)<br />(21, 22, 'e', 1)<br />(22, 23, ' ', 1)<br />(23, 24, 'g', 1)<br />(24, 25, 'r', 1)<br />(25, 26, 'a', 1)<br />(26, 27, 'p', 1)<br />(27, 28, 'e', 1)<br />(28, 29, ' ', 1)<br />(29, 30, 'v', 1)<br />(30, 31, 'i', 1)<br />(31, 32, 'n', 1)<br />(32, null, 'e', 1)<br /><br />now i'll search for "rape".<br /><br />Now here's my search query. <br /><br />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"<br /><br />Or something like that. I'm actually not that experienced with SQL. But you know what I'm getting at here.<br /><br />The result of that search (after it's turned into sql that will actually work) will be 1, because "rape" occurs in record 1.<br /><br />---<br /><br />Another thing we can do is this<br /><br /> (0, 1, 'I', 1, 0)<br /> (1, 2, ' ', 1, 1)<br /> (2, 3, 'h', 1, 2)<br /> (3, 4, 'e', 1, 3)<br /> (4, 5, 'a', 1, 4)<br /> (5, 6, 'r', 1, 5)<br /> (6, 7, 'd', 1, 6)<br /> (7, 8, ' ', 1, 7)<br /> (8, 9, 'i', 1, 8)<br /><br />etc.<br /><br />where the last field is the index within the record at which that letter occurs. <br />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. <br /><br />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).<br /><br />Also, we might want to use ints instead of chars for the letters to speed it up.<br /><br />Also, for unicode you might have to do it a little differently. The same principle still applies.<br /><br />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. <br /><br />oh, one other thing: obviously index the "nextid" and "letter" fields.inhahehttp://www.blogger.com/profile/16554709976493679009noreply@blogger.com0