Friday, February 3, 2012

I see this all the time

The upcoming 9.2 release of PostgreSQL could introduce a native JSON data type and support for returning JSON-formatted query results. The patches that implement the JSON functionality were submitted by contributors Robert Haas and Andrew Dunstan in the open PostgreSQL CommittFest. Technica
Sure, JSON is a better idea than xml, so just store it like we store XML? It helps.

But the point is, without XML these machines can send each other Bson. Hence the structure of the serialization is very important as part of the query, we have to do pattern matches. It is like the industry does all the work, then delivers the value to a gazillionare. Why not go the whole route, turn Json/Bson into bots?
And, if we are going to store Bson, the names need to be exposed to the underlying indexing system.

Another example for Json

{
 "query": "SELECT * FROM .. WHERE x = ?",
 "params": [5],
 "attach": [{
             "user": "db_user",
             "database": "db_name",
             "alias": "short"},
            ..]
}
From a storage system.

I don't get the Select * FROM .. WHERE. I mean, why bother with Json if it cannot express a query by itself? But what we see is the setting up for a sqlite3 execution.

It is not that I am against SQL, but when we are doing a query, the SELECT is obvious. What we have is standard: Identify data to be collect, where to get it, and what are the conditions to collect. We are shortly going to see the select from where get embedded, a natural result of looking for somethhing, It takes time, it is something the Json crew has to think about.

@{*,user:Myname.graph:MyGraph}

Will run the wild card collector over the graph Myname.Mygraph. Convolve the query and the target. Json has to introduce the convolution operator, they can run but they can't hide.

I still don't see why we have the [] brackets. Arrays are understood to be the other thing than a document. Just use the comma.
My final point, is why send Json queries as part of the header, just tell the destination the content is Json and ship it. The entire transfer of Json/Bson is a transfer of consistent units, whether query or insertion. If the server doesn't get Json, screwing around with Http headers won't help.

Here is my routine for handling headers, all 14 lines of code. Why is the industry still fooling with Http headers?
#define JSON_TYPE "POST\r\nContent-Type:text/json\n\rContent-Length:"
#define BSON_TYPE "POST\r\nContent-Type:text/bson\n\rContent-Length:"
#define MAGIC_SIZE sizeof(JSON_TYPE)
#define HEADER_SIZE (MAGIC_SIZE+12)
int header_magic(int newfd,int * count) {
 char inbuffer[HEADER_SIZE];
 int rv; int type;int i;
 type = -1;
 rv = read(newfd, inbuffer, HEADER_SIZE);
 if(rv != -1 && rv == HEADER_SIZE) {
  if(!strncmp(inbuffer,JSON_TYPE,MAGIC_SIZE)) type = 1;
  else if(!strncmp(inbuffer,BSON_TYPE,MAGIC_SIZE)) type = 0;
 }
 if(type != -1)
  sscanf(inbuffer+ MAGIC_SIZE,"%8d",count);
 else
  *count=0;
 return (type);
}

Norquist says gut defense, Republican Communist Party rebels

WASHINGTON (CNN)
Top Senate Republicans unveiled a proposal Thursday to replace looming across-the-board budget cuts, most notably to the Pentagon, with new restrictions on both the compensation to and size of the federal work force.

The mandatory cuts are a consequence of the failure of Congress' so-called super committee in November.

Under an agreement that set up the special joint congressional panel, automatic across-the-board spending cuts of more than $1 trillion will begin in 2013 because the committee was unable to reach agreement on a broad deficit reduction plan.Orlando

Thursday, February 2, 2012

The names in name value pairs

They are an index. Value can be unnamed, their location known locally relative to their enclosing predicate. So that means the engine, ultimately has to make sure names are indexed? Well, yes, it the intent is intelligent storage in the local data base. What gets me learning, actually, I haven' gotten as far as indexing. But, just scan the store for indexed names, and put the rowid,name,table in the local named index graph? I could spend a few days and write a good enough sql indexing set up, assign it to an operator, then run the operator after a table load. Then show it to a CIO control freak an make a gazillion dollars.

How would I manage indices using type face explosion? Dunno, right now I only know aout two graps in convolution generating a result graph. I think the TE variable and insert graph routines need to wait until the Json crew thinks a bit about Json as a query by example.

But, I can sure do it in SQL, I can make the index table:
|name|table|rowid|,

good for any database of Bson stores, and its not even in triple form!. I would index on name, then look up location by name. I could actually execute a new insert name into index operator any time I want, any time I need to, fast, I have the operator all set up, precompiled.

This is the stuff you can do with the engine.

Wednesday, February 1, 2012

How to grab the http header zippy fast

// Magic header, we reject everything else
#define JSON_TYPE "POST\r\nContent-Type:text/json\n\rContent-Length:"
#define BSON_TYPE "POST\r\nContent-Type:text/bson\n\rContent-Length:"
#define MAGIC_SIZE sizeof(JSON_TYPE)
#define HEADER_SIZE (MAGIC_SIZE+10)
int header_magic(int newfd,int * count) {
    char inbuffer[HEADER_SIZE];
    int rv; int type;int i;
    type = -1;
    rv = read(newfd, inbuffer, HEADER_SIZE);
    if(rv != -1 && rv == HEADER_SIZE) {
     if(!strncmp(inbuffer,JSON_TYPE,MAGIC_SIZE)) type = 1;
     else if(!strncmp(inbuffer,BSON_TYPE,MAGIC_SIZE)) type = 0;
    }
    if(type != -1)
      *count = (int) inbuffer[MAGIC_SIZE];
    return (type);
    }

Screwing with http headers. Here is how to do it, grab the whole chunk, and if it is the magic header, go run. One single magic header gets the bots to jason or bson handlers. Both sides select the same fixed size header. A few instructions in and out.

I hold the record for the least code written!

I unpatent the encryption bot

The encryption bot travel with encryption keys, they carry them for the boss. They do occasional checksums on he boss's master ontologies. Encryption bots have support at the graph layer in paid for web farms. The high priced web farms guarantee your police bot has the highest priviledges on your data. The service can guarantee secure passage. But all of it, as secure as it is, is noting more than those Bson things. You can secure anything, your ip address, if you want. But the real applications start right now, with two things. !) This gives you control over provate IP address sharing, and 2) You get automatic downloading of a variety of common Footgiggle screens with your own private friend. You log on, you try this new set up, your friends say, hey looks great, they run the bot and get the same look and feel. formats, from these javascript warehouses. So no one is making a gazillion off flashing, irritating pop things. We will be in control of our own web.

The secure bot would wonder if time had elapsed and he had not heard your secret code. He may put out a bit of a notice that you need you eye scanned for password reset. When you die, this bot will long for your eyes.

I unpatent the entropy encoded hash table

The entropy encoded hash table is coded by Huffman as iLog(i), where i is the probability of occurance, total i being 1. The look up addresses are ordered in a linear table, shortest addresses first. Hence the total, maximum encoding of client retrievals. And as a bonus, a computation on the address size give your a very close approximation to its location. I think the access time will be linear with the overall useage.

This idea is unpatented, available for free use, perhaps along side peer to peer addressing from Dhash at MIT. I'll get these addressing algorithms, and get the look ups working as nested stores, the bot can traverse it quickly, and grab a goodie.

Some neat things to do in semantic web.

You can have your own police bot, it hangs around a server and guards your indices. Only you or your friends can gain access. Police bot can share secret encryptions, a human holds the master key. But that set up is great for trading, great for very fast look ups, ad hoc indexing. Lot's of opportunities for very private and very public associations. And zippy fast.

This is an order of magnitude more advanced than any of those other kids have. Never once does the grammar inside the machine force a key move, it all exoskeleton. Where's my exo kernel, Cray is drooling.

Writing the official Bson-Sql serialization map

How about that! I am making a standard, I'll implement the basic types, and that all I want. What am I doing?
Well, the market is semantic,predicate,object. Well that predicate decomposes into the graph layer byte, and the Bson byte, but the graph layer manages he array/document switch; because that switch forms the basis of graph. Bson defies the rest. The SQL hold the Bson data in the key. So I take the link, which bson and graph share, map that into the type, take a strlen from sql on the key. The machine still has not touched key! But the translator now has the Bson type, use that in a case statement to get the strlen of bytes from key to Bson output stream. 40 lines of code, tops.

What's missing? There should be clear way to compute the bounded document byte count, and keep accurate byte counts all the through the chain. In other words, the machine has to reconstruct the entire document from sql so it can have the byte count in the top field. No streaming. Hmmm.. I am ok with that, if we send 100 kbytes of graph, it'll fit.

Then feed them meth

Young Mexicans are being abducted from poor towns and villages and forced to work for drug gangs, rights groups say, alleging the authorities are failing to do anything to stem the problem.
Stories of young people disappearing, as if swallowed up by the earth, are spreading in parts of Mexico gripped by drug violence which has left some 50,000 dead, according to media counts, in the past five years.

Non-governmental groups in the northern states of Nuevo Leon, where Monterrey lies, as well as Coahuila and Michoacan, to the west, have documented more than 1,000 disappearances from 2007 to 2011. AFP

Get these young kids kidnapped, then smoke em out with methamphetamine, and the cartels get a Zombie Killing machine. Once the hole is in their head, they no longer have the brain function to escape.

They're both going down

Start with Facebook, which has erected a cyber fence around its 800 million-plus users and refuses to share some important data with Google. This means that Google’s searches are not quite as valuable to advertisers as they used to be when the Internet was open and when Facebook was much smaller than it is today.Read more

I have got the machine nearly ready for networking. MIT is working on distributed IP indexing, they got code and algorithms. Footbook is a format, it can be down loaded from Dojo. The data is in our computers, we have our own networks, Footbook is going to lose 800 million prople, none of whom really search more than a few hundred at most. The bots are taking over, do not invest in Facbook, its half life is getting shorter. We have a ontology switching engine, and a ton of developers working to use it.