I have a 1998 Chevrolet Cavalier, and in the winter it becomes very hard to turn the key in the locks in the car door. I've literally ripped the rubber off the key's grip from forcing the key to turn.

How can I keep the locks on my car from sticking?

I did this project last year, under some interesting constraints: it's a thin webserver which lives in a Raspberry Pi, which is networked to an embedded system in an industrial sign which is running a proprietary and heavily modified version of *nix. I didn't touch the embedded system in the sign at all.

The whole thing is a kinetic sculpture, installed in a private residence.

Because of some of the project constraints (i.e., we were working in someone's house) I wasn't as aggressive refactoring as I would otherwise have been. There are also no tests. Bad, I know, but it was a situation where the complexity of the project was almost certainly not going to grown in any dramatic way beyond its current level.

Here is the code for the Tornado server. A sanitized fork of the entire repo is here.

The stack is Python/Tornado, HTML, JS and SASS.

""" theSculpture server.

    Launch the server with 'python sculptureController.py' Currently the server defaults to port
    8888. The server provides an interface to the theSculpture,
    allowing the sculpture's mode to be changed.

    Front end and back end code by Liav Koren 2013 - 2014. """

    import tornado.httpserver
    import tornado.ioloop
    import tornado.options
    import tornado.web
    import tornado.auth
    import tornado.escape
    import os
    from tornado.options import define, options
    import tornado.httputil
    import time
    import paramiko
    import subprocess
    import json

    define("port", default=8888, help="run on the given port", type=int)


    class ModeHandler(tornado.web.RequestHandler):
        ''' Handler for the main interface. This serves up the mode selector page. '''

        ssh = ""

        def get(self):
            self.render('modes.html', current_mode='TESTING')

        def post(self):
            """ Mode handler. The mode selector page presents 'slow', 'medium', 'fast',
            'return to landing page' and 'logout' options to user. This handler is also
            the endpoint for the main page options 'ON' and 'OFF'. Slow, medium, fast, on
            and off all initiate a series of remote operations on theSculpture that involve
            opening an SSH tunnel, triggering various shell scripts and transfering files
            between the Pi and theSculpture. """

            path = ""
            data = self.request.arguments

            if 'slow' in data or 'slow-swatch' in data:
                path = '/home/pi/theSculpture/dat/slower1.dat'
            if 'medium' in data or 'medium-swatch' in data:
                path = '/home/pi/theSculpture/dat/med.dat'
            if 'fast' in data  or 'fast-swatch' in data:
                path = '/home/pi/theSculpture/dat/AGH4.dat'
            if 'on' in data or 'on-swatch' in data:
                self.kill_theSculpture()
                self.reset_theSculpture()
                time.sleep(5)
                self.write(json.dumps({"file_transfer": "finished"}))
            if 'off' in data or 'off-swatch' in data:
                self.kill_theSculpture()
                time.sleep(5)
                self.write(json.dumps({"file_transfer": "finished"}))

            if path:
                self.file_transfer(path)
                #self.file_transfer_mock(path)

        def file_transfer_mock(self, path):
            """ A debugging utility method for accepting commands but not
            passing them on to theSculpture. """
            new_path = "new path is: %s" % path
            print new_path
            time.sleep(10)
            self.write(json.dumps({"file_transfer": "finished"}))

        def kill_theSculpture(self):
            """ Turns theSculpture off. """
            cmd = "cd /bin; ./kill_theSculpture.sh"
            self.talk_to_sign(cmd)

        def reset_theSculpture(self):
            """ Restarts theSculpture from an off or currently running state. """
            self.kill_theSculpture()
            self.talk_to_sign("/bin/reset_theSculpture.sh")

        def file_transfer(self, path):
            """ This function deals with resetting theSculpture and
            transferring the new dat files. """
            self.kill_theSculpture()
            print "waiting 30s"
            time.sleep(30)
            print "starting scp"
            proc = subprocess.Popen(['scp', path,
                                    'root@***.**.57.230:/data/theSculpture.dat'],
                                    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
            proc.wait()
            print "stdOut: %s " % proc.stdout.readline()
            print "stdErr: %s" % proc.stderr.readline()
            self.talk_to_sign("/bin/reset_theSculpture.sh")
            self.write(json.dumps({"file_transfer": "finished"}))

        def talk_to_sign(self, cmd):
            ''' Talk_to_sign calls open_ssh to get an ssh client object, then emits
            commands to the target system.'''
            if not self.ssh:
                self.ssh = self.open_ssh_tunnel('***.**.57.230', 'root', 'foobar')
            stdin, stdout, stderr = self.ssh.exec_command(cmd)
            if stderr.readlines():
                print "Error: %s" % stderr.readlines()
            if stdout.readlines():
                print "Cmd returned: %s" % stdout.readlines()


        def get_current_sign_status(self): # ToDo: narrow the exception handling
            ''' Tries to get the current state of the sign and return it to the
            client. '''
            if not self.ssh:
                self.ssh = self.open_ssh_tunnel('***.***.1.105', 'pi', 'foobar')
            stdin, stdout, stderr = self.ssh.exec_command('cat test')
            if stderr.readlines():
                print "Error reading current sign state."
            output = stdout.readlines()
            if output:
                print "current sign state is: "
                print output[0][:-1]
                return output[0][:-1]


        def open_ssh_tunnel(self, ip, username, passwd):
            ''' Provides a ssh client to the talk_to_sign method '''
            try:
                s = paramiko.SSHClient()
                s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
                s.connect(ip, username = username, password = passwd)
                return s
            except paramiko.AuthenticationException:
                self.write(json.dumps(
                    {"status": "Failed to login to sign server successfully."}))
                return
            except paramiko.ChannelException:
                self.write(json.dumps(
                    {"status": "Error opening channel to sign server."}))
                return
            except paramiko.SSHException:
                self.write(json.dumps(
                    {"status": "SSH error when trying to contact sign server."}))
                return


    class MainHandler(ModeHandler):
        """ The landing page once the user has logged in. """

        def get(self):
            self.render('main_revised.html')


    def main():
        tornado.options.parse_command_line()
        settings = dict(
            template_path=os.path.join(os.path.dirname(__file__), "static"),
            debug=True,
            static_path=os.path.join(os.path.dirname(__file__), "static"),
            login_url="/login",
        )
        application = tornado.web.Application([
            (r"/mode", ModeHandler),
            (r"/", MainHandler),
            (r"/main", MainHandler),
        ], **settings)
        http_server = tornado.httpserver.HTTPServer(application)
        http_server.listen(options.port)
        tornado.ioloop.IOLoop.instance().start()

    if __name__ == "__main__":
        main()

I'm designing a program which makes queries to a database stored locally which could potentially contain a lot of sensitive information. As such the information must be kept secure as possible from any possible attack. I plan on doing this by encrypting the data by AES-256 in CBC mode. The encryption / decryption key will be kept secure.

My question is, using this scheme, how should the database be encrypted to ensure the data is kept secure against attacks? Originally I planned on encrypting the database cell by cell (with each row having 10 or so columns) and storing a unique, randomly generated IV for each row.

However, to my understanding of the generated stream this could cause problems as I would be using the same key + IV combination to encrypt / decrypt all the cells of this row. This would allow an attacker to potentially compute the XOR of two cells and reveal enough information where they could decrypt the entire row (two-time pad). I know this is more of a problem in CTR mode but I have read that it could also be a problem in CBC if two of the cells began with the same sequence of bytes. Please correct me if I misunderstand the concept of this type of attack as I am still a little unsure of its exact mechanism.

Encrypting the entire database itself is not very pretty and obviously will cause performance issues if the database is large enough. Therefore, the only other method I could think of is having EACH CELL have a unique, random IV which on the surface seems like a lot of extra data to have to store but I will go this route if need be.

Just as a side note; this program isn't being implemented anywhere in which security will be an issue. It is more of a side project for myself to learn the intricacies of cryptography and ways of defending against attacks. Thank you for all your help in advance!

For some spells, like Darkvision, no one else can cast permanency on you to make the effect last until dispelled*. So for non-caster's there's no way to permanently get that... unless you can find a way to use someone else's caster level while casting a spell, such as when reading a scroll.

*Permanency makes the duration of certain other spells permanent. You first cast the desired spell and then follow it with the permanency spell.

Depending on the spell, you must be of a minimum caster level and must expend a specific gp value of diamond dust as a material component.

You can make the following spells permanent in regard to yourself. You cannot cast these spells on other creatures. This application of permanency can be dispelled only by a caster of higher level than you were when you cast the spell.

Can there be a scroll of permanency? - Yes, according to Ernir, but the cost (both for CL and diamond dust) would depend on what you intend to make permanent with it, thus it would be a very specific item.

However, once you get it: When using UMD to successfully cast it, while under the influence of a spell that's to be made permanent, will that work?

When playing Puzzle Strike online, my friends and I encountered a sort of "Sudden Death" mode that activated after many turns of a particularly slow game, resulting in 2-Gems being anted each turn instead of 1-Gems. We could not figure out exactly what the trigger of this was - likely some specific number of turns - or whether or not this rule was supposed to be used in the physical version. I do not believe the rule exists in the Version 1 Rulebook. What is the trigger of this Sudden Death mode that increases the ante, and is it universal to all versions of the game?

We have 3 children so they outnumber us. Part of our bedtime routine involves book time. Once upon a time, this meant Mr. Dad reads to one kid and Mrs. Mom reads to the other. That's not really an option anymore, so now we try to read one book to both of them. The problem is that one kid is 4.5 years old and the other is 2.5 (and had a slight speech delay). So, while one kid wants to read all the words on the page (and has the books memorized, so he knows if I'm short-changing him), the other wants to excitedly point out different objects in the illustrations and then turn the page.

In short, does anyone have a strategy for reading one book to two children of different levels at the same time? We are willing to invest in specific books if they would be more conducive.

Changing the bedtime routine at this point in our lives would be too difficult, so we are stuck with what works for us.

Because the Infernal Staff of Herding plans are only accessible at the end of Act 4, are the item level drop rates in Whimsyshire the same as Act 1 Inferno or Act 4 Inferno as referenced here?

Will the HST rebates be paid each year after 2010 as well, or is this a one time thing?

A shot and two dances,
really don't know.

Seeing you double,
really in two.

That time already,
five o'clock, phew.

It's all a failure,
graded so low.

Number of letters:

3

Hint 1:

NATO involvement? You can't be serious. You must be joking.

Hint 2:

If you're not getting it you're probably thinking it.

About every source on string theory I've read which do mention S-duality state that: $$\begin{array}{l} \operatorname S:\operatorname{IIB} \leftrightarrow \operatorname{IIB}\\ \operatorname S:\operatorname{HO} \leftrightarrow \operatorname{I} \end{array}$$

However, how does one prove that the Type IIB string theory is self-S-dual and even more bizzarely, that the Type HO string theory is S-dual to the Type I string theory?