How can I switch focus after buffer split in emacs?

[From]: http://stackoverflow.com/questions/6464738/how-can-i-switch-focus-after-buffer-split-in-emacs

Put the following in your .emacs file:

(defadvice split-window (after move-point-to-new-window activate)
  "Moves the point to the newly created window after splitting."
  (other-window 1))
Advertisements

Setting up Web.config to allow uploading of large files by ASP .NET applications

This article shows how to setup Web.config to allow uploading of files larger than 4 MB by ASP.NET applications.

INTRODUCTION

During the construction of an intranet application that allows users to upload documents and share information between users, I noticed that when a user tries to upload files that are larger than 4 MB, he is asked for the user/password and even if he enters the correct user/password, the file is not uploaded, and he gets a HTTP 401.1 error.

Of course, this should not be an article, but CodeProject doesn’t have a “quick tip section”-like, so here it goes.

THE PROBLEM

By default, Machine.config is configured to accept HTTP Requests upto 4096 KB (4 MB) and it is reflected in all your ASP.NET applications. You can change the Machine.config file directly, or you can change only theWeb.config file of the application(s) you want to.

THE SOLUTION

Open your Web.config file, and just below the <system.web> tag, add the following tag:

  <httpRuntime 
    executionTimeout="90" 
    maxRequestLength="4096" 
    useFullyQualifiedRedirectUrl="false" 
    minFreeThreads="8" 
    minLocalRequestFreeThreads="4" 
    appRequestQueueLimit="100" 
    enableVersionHeader="true"
  />

That’s it. I hope it is useful to you.

Call Python From Bat File And Get Return Code

[From]: http://stackoverflow.com/questions/1013246/call-python-from-bat-file-and-get-return-code

The windows shell saves the return code in the ERRORLEVEL variable:

python somescript.py
echo %ERRORLEVEL%

In the python script you can exit the script and set the return value by calling exit():

exit(15)

In older versions of python you might first have to import the exit() function from the sys module:

from sys import exit
exit(15)