Using Transloadit for file uploading & processing on your website

by Cliff 2. November 2013
Over the years I have used a variety of custom solutions to resize images, encode video, etc.  Transloadit provides a really nice cloud based solution that you can use with any technology stack.  From rails, to php, to JavaScript, you can interface with their API to upload images and videos.  They offer some easy to use plugins to help get you started https://transloadit.com/docs#jquery-plugin

SQL Server Always On cluster on multiple servers

by Cliff 16. August 2013
If you are trying to setup Microsoft SQL Server always on across multiple servers on a domain, here is a tip - both servers need to use a domain account as the service account for sql server and that account needed to be an admin on the servers.

Sublime Text2 unable to open file from context menu - open file with sublime text2

by Cliff 1. June 2013
If you are not able to open files from the context menu using open file with sublime text2 you can download the sublime text2 installation file and re-run it.  You will retain your packages and settings and the re-install will fix the issue of the context menu shortcut failing.  

Apache mod_proxy alternative using IIS

by Cliff 12. December 2012

Apache and mod_proxy are an excellen choice if you want to setup a proxy or reverse proxy server.  As an alternative, if you already are running IIS7 or higher, you can configure IIS to proxy requests without the need to install/maintain an Apache instance.

You can even proxy requests to other technology stacks, for example if you are runnign rails or Java, etc., you can proxy requests to webspere and other app servers and have all requests go through the same server/url/IIS instance.

The following link provides an excellent overview of how to configure IIS to proxy requests.

http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing 

Query to find foreign keys in an Oracle database

by Cliff 30. November 2012

The following query will return all of the columns for a table and will include an indicator if the column is a foreign key:

 

select utc.*,
case when exists(
select 1 
from all_cons_columns ucc
join all_constraints uc on ucc.constraint_name = uc.constraint_name
where uc.constraint_type = 'R'
and uc.table_name = utc.table_name
and ucc.column_name = utc.column_name)
then 1
else 0
end IsForeign
from all_tab_columns utc where utc.table_name = 'YOURTABLE' and utc.owner = 'THEOWNER'

 

Tags: oracle

Oracle

Oracle Data Provider for .NET and Disposing of DbCommand and Parameters

by Cliff 4. October 2012

There are quite a few examples of using Microsoft's Enterprise Library Data Access Block that does not illustrate calling Dispose on the DbCommand and Parameters collection.  When working with ODP.NET it is a recommended best practice to explicitly dispose of both. For the DBCommand, a "using" block is a good choice as once out of scope, Dispose will always be called.

In terms of parameters, the following example can be used to ensure they are cleaned up:

foreach (OracleParameter p in cmd.Parameters)
{
if (p.Value is IDisposable)
{
((IDisposable)(p.Value)).Dispose();
}
((IDisposable)p).Dispose();
}

 

Oracle Data Provider for .NET and Disposing of DbCommand and Parameters

by Cliff 4. October 2012

There are quite a few examples of using Microsoft's Enterprise Library Data Access Block that does not illustrate calling Dispose on the DbCommand and Parameters collection.  When working with ODP.NET it is a recommended best practice to explicitly dispose of both. For the DBCommand, a "using" block is a good choice as once out of scope, Dispose will always be called.

In terms of parameters, the following example can be used to ensure they are cleaned up:

foreach (OracleParameter p in cmd.Parameters)
{
if (p.Value is IDisposable)
{
((IDisposable)(p.Value)).Dispose();
}
((IDisposable)p).Dispose();
}

 

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

by Cliff 13. August 2012
If you run bundle and receive the message: 
 
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed
 
You might need to update your gem version - issue the following: 
$ gem -v

if less than 1.8.24, update using:

$ gem update --system
 

The 'json' native gem requires installed build tools

by Cliff 13. August 2012

If you are trying to run bundle install or rake version:write ib windows and receive the message The 'json' native gem requires installed build tools or 

Gem::InstallError: The 'json' native gem requires installed build tools.

Please update your PATH to include build tools 

you can resolve by doing the following:

Visit  

http://rubyinstaller.org/downloads

and download the development kit (make sure you download the link for the development kit, not ruby,etc) 

Once downloaded, follow the instructions on:

https://github.com/oneclick/rubyinstaller/wiki/Development-Kit 

Load dropdown with .ajax then set the selected value with jQuery

by Cliff 11. February 2012

Recently I encountered an issue when trying to set the selected value of a dropdown list.  I was using the jQuery .ajax method to populate the select list and this was working, but when I tried to set the selected value using jQuery, I was not able to.  I should have realized that .ajax makes a async call by defualt and there is no garuntee the list will be populated when you try to set the selected value.

There are a couple of solutions.  You can set the selected value in the success event handler or you can set async to falst in the .ajax method:

async: false,

Cliff Gray's Info

Cliff Gray
Developer/Founder GrayTechnology.com.

E-mail me Send mail

Authors

Calendar

<<  May 2017  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Blogroll

Download BlogEngine.NET

Download at CodePlex

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017

Subscribe