Skip to main content

Posts

Internet shortcuts on Windows systems

Windows systems have the ability to create files that "open" in a browser.  Create a text file with a ".url" suffix and the following content. [InternetShortcut] URL=http://subdomain.domain.tld The system will even go out and grab the favicon.ico file from the site to use as the file's icon.  Naturally, longer URLs can also be used.  For example: [InternetShortcut] URL=http://subdomain.domain.tld/some/path A special note It's important to note that Windows systems will likely be particular about how this file is accessed.  Specifically, concerning making changes to the URL it points to and accessing it through "Save as…" dialogs.  For example, if trying to attach this shortcut to an email message the dialog will appear to do nothing and the system will be sluggish for a short while. A workaround is to use an additional filename suffix to prevent the system from "recognizing" the file as an Internet shortcut.  So, perhaps...

Retrieve the definition for a stored procedure in SQL Server

Generally, once a stored procedure is created, the details of how it works can be forgotten.  Sometimes however, what a procedure does may need to be researched.  The following query makes an attempt to look-up the definition for a stored procedure in SQL Server . NOTE:   Set the value in the DECLARE line at the top to the procedure name to look for (partial strings are fine). NOTE:   SQL Server has the ability to encrypt the definition for a procedure.  A definition value of NULL likely means such is the case for this procedure. DECLARE @procedureName VARCHAR(MAX) = 'PROCEDURENAME' SELECT      sys.all_objects.name AS storedProcedureName     ,sys.all_sql_modules.definition AS storedProcedureDefinition FROM     sys.all_sql_modules     INNER JOIN sys.all_objects         ON sys.all_sql_modules.object_id = sys.all_objects.object_id WHERE sys.all_objects.name LIKE '%...

Identify an object type in SQL Server

SQL Server assigns the term "object" to a number of items.  These could be tables, views, columns, parameters, stored procedures, et cetera.  The following query can be used to identify the type of a SQL Server database object. NOTE:   The type is identified in the "type_desc" column. NOTE:   Set the value in the DECLARE line at the top to the object name to look for (partial strings are fine). DECLARE @search VARCHAR(MAX) = 'OBJECTNAME' SELECT * FROM sys.all_objects WHERE name LIKE '%' + @search + '%'

Identify the stored procedures a parameter belongs to in SQL Server

There may be times when it would be nice to know what stored procedures have parameters with a certain name.  For example, what procedures have a parameter named "username?"  Using SQL Server it's just a matter of querying some of the system tables to find out. NOTE:   Set the value in the DECLARE line at the top to the parameter name to look for (partial strings are fine). DECLARE @parameter VARCHAR(MAX) = 'PARAMETERNAME' SELECT      sys.all_parameters.name AS parameterName     ,sys.all_objects.name AS storedProcedureName FROM     sys.all_objects     INNER JOIN sys.all_parameters         ON sys.all_objects.object_id = sys.all_parameters.object_id WHERE sys.all_parameters.name LIKE '%' + @parameter + '%'

Boldness of social media foreseen since the 90s

By now everyone recognizes the " netiquette " phenomenon in today's social media-crazed world.  This being where people are brazen enough to say things about others that they would never have the bravura to say to the same people in person. In what might just be a case of being easily impressed, it's fascinating to see that author Daniel Kohanski was able to recognize this all the way back in 1998 when he wrote his book, The Philosophical Programmer:  Reflections on the Moth in the Machine . Sadly, in spite of having such an advanced notice of the issue, it's still a problem today.  Given modes such as Twitter , Facebook , instant messaging, and texting, combined with how many of us communicate using these channels, there's plenty of opportunity to quell the matter simply by not participating in the behavior.  But perhaps all these channels and the widespread use is what's perpetuating the problem.

Online tools for creating color schemes

By now it's pretty clear the importance color can play in design. As developers, syntax coloring has also become a mainstay of IDEs and mildly powerful text editors. The following resources may prove useful in identifying color themes both for designing applications as well as establishing pleasing syntax color schemes. Color Scheme Designer http://www.colorschemedesigner.com/ This one provides a great tool for choosing a scheme based on some of the common scheme classifications. It also provides a preview of what the scheme will look like on both a light and dark version of a web page. ColorCombos http://www.colorcombos.com/ This site has a collection of swatches for choosing a color combination, but it also has a tool that will yank the colors out of any web page. Colorspire http://www.colorspire.com/ Besides the familiar Photoshop-style color picker and the pool of 5 color chips to build the scheme from, the real nifty feature of this tool is its collection of bri...

Ubuntu Unity reports the battery level for Bluetooth devices

Users may notice that Unity under Ubuntu 13.04 reports two battery levels under the battery icon in the top bar.  At first, this seems like a bug with the battery reporting, but clicking one of the battery icons will open the Power Statistics application. The two batteries are listed here as well and the secret is realized when selecting between the two.  Notice that one probably indicates details that can be associated with the laptop's battery itself.  The other will probably be associated with a Bluetooth device. NOTE:  This behavior was not noticed prior to 13.04 but may well have been there.