Here's a quick scribbled description of an application of FOAF I've been thinking about lately. I am forever forgetting the passwords for various Web sites; usually those of my friends (photos etc), rather than huge dot-com sites. I'd like to make it easy for such sites to offer password-protected access to their content, without my having to remember loads of different passwords.
So I'm wondering how feasible it would be to do something like the following: in my FOAF file, or another RDF/XML document linked from it, list a bunch of 'account descriptions' giving my username and (in some cases) crypted passwords. Some of these could be generic accounts, eg 'generic friends photo login'. FOAF-aware sites could use this if they want to give me access but defer password management to external systems. I'd update/edit/delete account descriptions, including passwords, and sites would read my FOAF file regularly to keep up to date.
The bare bones of this could be implemented with relatively little scripting, but it raises some issues that need careful thought. First up, it isn't super-wise to have a single username/password used on loads of sites, especially if it is sent in cleartext HTTP, or if you're not careful about which sites you send it to. Secondly,we'd need to use something like PGP's identity-assurance mechanisms, otherwise my friends might accidentally use evil-danbri-impersonator.rdf to check passwords, and allow the wrong users to see their content. So I might PGP-sign a chunk of RDF that says 'this is danbri@rdfweb.org's low-security photo-website generic account'.
There's more to think and write and test on all this, but I just wanted to scribble the basic idea. I suspect the next step is a prototype...
Posted by danbri at December 30, 2002 01:19 AMThanks!
Posted by: Ferienhäuser Mallorca on January 17, 2004 01:12 PMNote first that favoriteNumbers type changed. Instead of our familiar int, we're now using int*. The asterisk here is an operator, which is often called the "star operator". You will remember that we also use an asterisk as a sign for multiplication. The positioning of the asterisk changes its meaning. This operator effectively means "this is a pointer". Here it says that favoriteNumber will be not an int but a pointer to an int. And instead of simply going on to say what we're putting in that int, we have to take an extra step and create the space, which is what does. This function takes an argument that specifies how much space you need and then returns a pointer to that space. We've passed it the result of another function, , which we pass int, a type. In reality, is a macro, but for now we don't have to care: all we need to know is that it tells us the size of whatever we gave it, in this case an int. So when is done, it gives us an address in the heap where we can put an integer. It is important to remember that the data is stored in the heap, while the address of that data is stored in a pointer on the stack.
Posted by: Hercules on January 20, 2004 07:27 AMNote the new asterisks whenever we reference favoriteNumber, except for that new line right before the return.
Posted by: Juliana on January 20, 2004 07:27 AMWe can see an example of this in our code we've written so far. In each function's block, we declare variables that hold our data. When each function ends, the variables within are disposed of, and the space they were using is given back to the computer to use. The variables live in the blocks of conditionals and loops we write, but they don't cascade into functions we call, because those aren't sub-blocks, but different sections of code entirely. Every variable we've written has a well-defined lifetime of one function.
Posted by: Helegor on January 20, 2004 07:27 AMBut some variables are immortal. These variables are declared outside of blocks, outside of functions. Since they don't have a block to exist in they are called global variables (as opposed to local variables), because they exist in all blocks, everywhere, and they never go out of scope. Although powerful, these kinds of variables are generally frowned upon because they encourage bad program design.
Posted by: Jucentius on January 20, 2004 07:27 AMThis variable is then used in various lines of code, holding values given it by variable assignments along the way. In the course of its life, a variable can hold any number of variables and be used in any number of different ways. This flexibility is built on the precept we just learned: a variable is really just a block of bits, and those bits can hold whatever data the program needs to remember. They can hold enough data to remember an integer from as low as -2,147,483,647 up to 2,147,483,647 (one less than plus or minus 2^31). They can remember one character of writing. They can keep a decimal number with a huge amount of precision and a giant range. They can hold a time accurate to the second in a range of centuries. A few bits is not to be scoffed at.
Posted by: Dolora on January 20, 2004 07:27 AMLet's take a moment to reexamine that. What we've done here is create two variables. The first variable is in the Heap, and we're storing data in it. That's the obvious one. But the second variable is a pointer to the first one, and it exists on the Stack. This variable is the one that's really called favoriteNumber, and it's the one we're working with. It is important to remember that there are now two parts to our simple variable, one of which exists in each world. This kind of division is common is C, but omnipresent in Cocoa. When you start making objects, Cocoa makes them all in the Heap because the Stack isn't big enough to hold them. In Cocoa, you deal with objects through pointers everywhere and are actually forbidden from dealing with them directly.
Posted by: Sampson on January 20, 2004 07:27 AMBeing able to understand that basic idea opens up a vast amount of power that can be used and abused, and we're going to look at a few of the better ways to deal with it in this article.
Posted by: Charity on January 20, 2004 07:27 AMTo address this issue, we turn to the second place to put variables, which is called the Heap. If you think of the Stack as a high-rise apartment building somewhere, variables as tenets and each level building atop the one before it, then the Heap is the suburban sprawl, every citizen finding a space for herself, each lot a different size and locations that can't be readily predictable. For all the simplicity offered by the Stack, the Heap seems positively chaotic, but the reality is that each just obeys its own rules.
Posted by: Ellis on January 20, 2004 07:27 AMInside each stack frame is a slew of useful information. It tells the computer what code is currently executing, where to go next, where to go in the case a return statement is found, and a whole lot of other things that are incredible useful to the computer, but not very useful to you most of the time. One of the things that is useful to you is the part of the frame that keeps track of all the variables you're using. So the first place for a variable to live is on the Stack. This is a very nice place to live, in that all the creation and destruction of space is handled for you as Stack Frames are created and destroyed. You seldom have to worry about making space for the variables on the stack. The only problem is that the variables here only live as long as the stack frame does, which is to say the length of the function those variables are declared in. This is often a fine situation, but when you need to store information for longer than a single function, you are instantly out of luck.
Posted by: Abraham on January 20, 2004 07:28 AMInside each stack frame is a slew of useful information. It tells the computer what code is currently executing, where to go next, where to go in the case a return statement is found, and a whole lot of other things that are incredible useful to the computer, but not very useful to you most of the time. One of the things that is useful to you is the part of the frame that keeps track of all the variables you're using. So the first place for a variable to live is on the Stack. This is a very nice place to live, in that all the creation and destruction of space is handled for you as Stack Frames are created and destroyed. You seldom have to worry about making space for the variables on the stack. The only problem is that the variables here only live as long as the stack frame does, which is to say the length of the function those variables are declared in. This is often a fine situation, but when you need to store information for longer than a single function, you are instantly out of luck.
Posted by: Benedict on January 20, 2004 07:28 AMsms sprüche
Posted by: handylogos on January 22, 2004 01:31 PMexcellent
Posted by: online casino on January 23, 2004 08:08 AMnice site
Posted by: escorts on January 23, 2004 08:08 AMnice site
Posted by: philadelphia hotel on January 23, 2004 08:08 AMwin $100,000
Posted by: play online golf on January 23, 2004 08:08 AM