Audacity is one of the best free audio editors out there. Even though Audacity can manipulate MP3s, by default Audacity does not support exporting to MP3s. Using the Audacity – MP3 (DLL), however, you can even export your edits to MP3s. This is specially useful when you want to extract an MP3 into a separate file for other uses, such as ring tones. When you hit File | Export as MP3 the first time, Audacity will ask you to find lame_enc.dll simply download/extract the file, copy it to the default installation directory of Audacity (usually c:Program FilesAudacity) and point Audacity to the DLL file. And you are done!
ASP.NET 2.0 introduced a new way of modifying how ASP.NET renders a control. For example, when you say:
<asp:textbox id="FirstName" runat="server" />
You have very limited control over how the control actually renders. You can specify a cssclass to modify the look and feel, but the actual HTML rendering is limited to what’s available from the ASP.NET server attributes. For example you cannot add client-side onfocus or onblur statements. This is where Control Adapters comes in. Control adapters allows you to modify the rendering of any server control, with complete freedom.
Let’s look at an example!
First in order to use a control adapter you need to add a class to your App_Code. This class will programmatically describe the various rendering behaviors you want to modify for a given server control. I usually put all my control adapters under one folder called: adapters. And each file under that folder is named after the server control I am trying to modify. In this case it’s textbox.cs, because we are modifying the textbox control.
namespace UI.Adapters {
public class TextboxAdapter : System.Web.UI.WebControls.Adapters.WebControlAdapter {
protected override void Render(HtmlTextWriter writer) {
writer.AddAttribute("onfocus", "textFocus(this)");
writer.AddAttribute("onblur", "textBlur(this)");
base.Render(writer);
}
}
}
The code above, adds two arguments onfocus=textFocus(this); and obur=textBlur(this) too all server side text boxes automatically. You also need to add a browser file under your App_Browsers folder. If you don’t have one right click your project add a Browser file. A browser is a XML file that describes how ASP.NET behaves depending on browser versions.
<browsers>
<browser refID="Default">
<controlAdapters>
<adapter controlType="System.Web.UI.WebControls.TextBox" adapterType="UI.Adapters.TextboxAdapter" />
</controlAdapters>
</browser>
</browsers>
A refID of Default includes all modern browsers like Firefox and Internet Explorer > 5.5. Then the code specifies the type of control you want to modify in this case System.Web.UI.WebControls.TextBox and the Control adapter you want to use, again in this case it’s: UI.Adapters.TextboxAdapter.
Summary: Learn about automatic printing in a Windows platform using WScript.
Automatic printing is a subject you will find a lot of content about on the internet — but most of it is useless. It’s a massive collection of try-this-try-that. I was searching for some descent content on how to do scheduled automatic printing but spent far more time that I would like to. Finally I arrive at this code:
Option Explicit
Private Const OLECMDID_PRINT = 6
Private Const OLECMDEXECOPT_DONTPROMPTUSER = 2
Private Const READYSTATE_COMPLETE = 4
Private Const PRINT_DONTBOTHERUSER = 1
Private Const PRINT_WAITFORCOMPLETION = 2
Dim pValIn, pValOut
With CreateObject("InternetExplorer.Application")
'.visible=true
.Navigate "http://yourpage/"
Do Until .ReadyState = READYSTATE_COMPLETE AND NOT .Busy
loop
pvalIn = PRINT_WAITFORCOMPLETION XOR PRINT_DONTBOTHERUSER
pvalOut = ""
Call .ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER, pValIn, pValOut)
.Quit
End With
There something important to note here. The following lines are necessary for Windows 2003 Enterprise server:
pvalIn = PRINT_WAITFORCOMPLETION XOR PRINT_DONTBOTHERUSER pvalOut = "" Call .ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER, pValIn, pValOut)
On a regular Windows XP machine you could get by simply doing:
Call .ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER)
This code works by opening a Internet Explorer window and loading a page and printing that page. Note that if that file loads a PDF file or an excel document then this won’t work. This only works in plain HTML documents.
In SQL server if you want to reference a table using four-part naming convention and you receive the error message: Server ‘xxxx’ is not configured for DATA ACCESS. Then you need to execute this statement against the target server:
EXEC sp_serveroption 'xxxx','DATA ACCESS',TRUE
… that should fix the problem. An obvious point here is to replace xxxx with the target server.
In SQL server you can list all the triggers in a database using the following query:
SELECT * FROM sysobjects WHERE xType = 'TR';
You can run this code in query analyzer.
If you do a Google search on the word failure the first result comes up with Biography of President George W. Bush. According Marissa Mayer, Director of consumer web products at Google, explains:
Google’s search results are generated by computer programs that rank web pages in large part by examining the number and relative popularity of the sites that link to them. By using a practice called googlebombing, however, determined pranksters can occasionally produce odd results. In this case, a number of webmasters use the phrases [failure] and [miserable failure] to describe and link to President Bush’s website, thus pushing it to the top of searches for those phrases. We don’t condone the practice of googlebombing, or any other action that seeks to affect the integrity of our search results, but we’re also reluctant to alter our results by hand in order to prevent such items from showing up. Pranks like this may be distracting to some, but they don’t affect the overall quality of our search service, whose objectivity, as always, remains the core of our mission.
I found out about this from the Google Blog.
In Windows XP pressing CTRL+ALT+DEL twice in the login screen will take you to the classic login screen where you can manually type in the username and password to authenticate yourself. According to a Microsoft employee this feature maybe removed in future releases of Windows or worst yet it might be removed in future service packs. This would have caused serious problems for me because non-of the users I have on the intial list are administrators to the system. That means without that feature I wouldn’t have been able to login to the computer as an administrator (unless I did run-as on computer management MMC and made myself administrator and then loged as me again). But just a note that whoever is depending on this should be aware!
The company I work for reliies heavily on active-directory to organize, authenticate and integrate. In order to login to the intranet from our site, we currently request the integrated windows authentication box and ask the user to login. For some people this was a little flattering because it didn’t really say why the login was taking place — where are they loging into and so on. So to remedy this issue, I am working on a ASP.NET product that will authenticate against AD. This can be done using DirectoryServices provided within the .NET framework.
Create secure connection to Active Directory
public static DirectoryEntry GetDirectoryEntry() {
DirectoryEntry de = new DirectoryEntry();
de.Path = "LDAP://192.168.1.1/CN=Users;DC=Yourdomain";
de.AuthenticationType = AuthenticationTypes.Secure;
return de;
}
Set the culture and identity
public static void SetCultureAndIdentity() {
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal;
WindowsIdentity identity = (WindowsIdentity)principal.Identity;
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
}
Validate if user exists
public bool UserExists(string UserName) {
DirectoryEntry de = ADHelper.GetDirectoryEntry();
DirectorySearcher deSearch = new DirectorySearcher();
deSearch.SearchRoot =de;
deSearch.Filter = "(&(objectClass=user) (cn=" + UserName +"))";
SearchResultCollection results = deSearch.FindAll();
if(results.Count == 0) {
return false;
}
else {
return true;
}
}
Code provided from C-Sharp corner.
When you have multiple blogs setup in Movable Type and you perform a search from one of the blogs — results come from all the blogs. This is true when only the search is made from mt-search.cgi not from the Main Index file. The solution to this problem can be fixed by modifying search_templatesdefault.tmpl file. Search for the “Search this site:” then after that line add the following code:
The hidden field IncludeBlogs is in the Main Index file but it was orginally missing from the mt-search.cgi file.
If you want to search text files in your computer for a specific string you can do this easily using the following code:
for /f "tokens=*" %i IN ('dir /s /b *.asp') DO find /I "depthomepages" %i >> output.txt
You can replace dir /s /b *.asp to something more appropriate. You can alternatively search only specific folders also, by simply modifying the dir arguments.