Digital Tool Factory blog - Page 19 of 34 - Backend web development in Atlanta GA Digital Tool Factory blog - Page 19 of 34 - Backend web development in Atlanta GA

The Digital Tool Factory Blog

The most time-saving sql code I have ever written

database schemaphoto © 2007 gnizr | more info (via: Wylio) I decided to update my JargonDatabase.com web property last month started to update define the user-submitted jargon terms.  Much to my surprise users had submitted over 15,000 unique undefined jargon terms.  Some of them were conceptual duplicates, like “whites of their eyes” and “the whites of their eyes”, but how to filter the terms to see if they were duplicates or not?

After much pondering I decided to try to match words in the term with words already in the database – there would be many false positives, but was that method was the best way of ensuring I did not delete anything by accident.

To do that I created a function and a stored procedure.  The function:

CREATE FUNCTION Split(@String varchar(8000), @Delimiter char(1))
returns @temptable TABLE (items varchar(8000))
as
begin
declare @idx int
declare @slice varchar(8000)
select @idx = 1
if len(@String)<1 or @String is null  return
while @idx!= 0
begin
set @idx = charindex(@Delimiter,@String)
if @idx!=0
set @slice = left(@String,@idx – 1)
else
set @slice = @String

if(len(@slice)>0)
insert into @temptable(Items) values(@slice)
set @String = right(@String,len(@String) – @idx)
if len(@String) = 0 break
end
return
end

The function takes a string, splits it at every occurrence of a space (” “), inserts those new records into a table, and then returns that table.  From there I created the following procedure.

CREATE PROCEDURE FindSimilarSearchTerms
@SearchTermID int
AS
BEGIN
declare @SearchTerm nvarchar(450)
SET @SearchTerm=(SELECT top 1 SearchTermTerm  FROM UserDefinedTerms WHERE SearchTermID=@SearchTermID)
CREATE TABLE #tmp (TermID int IDENTITY, TermWord nvarchar(450))
INSERT INTO #tmp(TermWord) select items from  dbo.split(@SearchTerm, ‘ ‘)
SELECT JargonID, JargonTerm FROM JargonApprovedTerm, #tmp WHERE JargonTerm LIKE ‘%’+TermWord+’%’
DELETE FROM #tmp
DROP TABLE #tmp
END
GO

The procedure takes the ID of a search term, grabs the text of the user-submitted name (the “SearchTermTerm” field) and from there creates a temporary table, and then matches any word in the user-submitted name to any word in the approved jargon table in the database, that provides a quick way of knowing whether or not I can safely delete a term. Definitely a time consuming task, but a lot better than it could be.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


04
Jan 11


Written By Steve French

 

An update on the mysterious PhotoShop color shift

The problem started happening to me again recently, the information I found at this link fixed it.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


29
Dec 10


Written By Steve French

 

How to prevent images and photos from being stolen your site

they're welcome 2itThe Problem: You need to prevent people from saving images and photos that are featured on your website

The Cause: There is no real solution to this – if you can see it online, you can copy it, but you can make it more difficult.

The Solution: Insert this bit of code in your BODY

tag ondragstart=”return false” onselectstart=”return false” oncontextmenu=”return false”

that’s it!

Thanks to HyperGurl for the initial start on this problem.

Creative Commons License photo credit: weegeebored

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


27
Dec 10


Written By Steve French

 

An inspiring comment from Keith Smith on Mixergy

A stoic philosopherphoto © 2009 David Bleasdale | more info (via: Wylio)I was listening to Keith Smith on an old interview on Mixergy and he caught my ear with his description of losing most of his fortune in a business downturn.  It went something like this:

Andrew Warner (the interviewer): So you lost everything?

Keith Smith: Well, I had a lot of great experiences I wouldn’t have had otherwise.

Such a great (and classic Stoic way) of looking at events.

On another note, his company, Big Door Media has an interesting glossary of Game Mechanics and directory of game mechanic resources.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


07
Dec 10


Written By Steve French

 

Zachary Burt writes one of the better blogs about positive psychology

As those of you who know me personally know I have a new obsession in the form of positive psychology.  My main gripe is that I cannot find trustworthy online guides on the topic (like one would for, say woodturning or baking).  Thus I was delighted to find the  blog of Zachary Burt.  He has not written a huge amount of content, but the posts are well written and well reasoned.  Check out his posts on entrepreneurship and positive psychology.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


07
Dec 10


Written By Steve French

 

How to fix the copy file problem in C#

Cavalry moving forwardphoto © 1918 National Library of Scotland | more info (via: Wylio)The Problem: You need to copy a file from one location on the server to another and cannot remember how.

The Cause: It is too short and simple, and easily forgotten

The Solution: Just use the following code:

public static void CopyAndRenameFile(string OldPath, string OldFileName, string NewPath, string NewFileName)
    {
        if (File.Exists(OldPath + OldFileName))
        {
            File.Copy(OldPath + OldFileName, NewPath + NewFileName, true);
        }
    }

That’s it!

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


06
Dec 10


Written By Steve French

 

How to fix the “Unable to cast object of type” problem

Drill Bitsphoto © 2008 Justin Gurbisz | more info (via: Wylio) The Problem – you have several asp.net web controls (.ascx files) in your website project and for no obvious reason you suddenly get the error “Unable to cast object of type ‘YourWebControlName_ascx’ to type ‘YourWebControlName_ascx’.”  You recompile and the program works, then stops working.  You recompile and it works again, then it stops working, ad infinitum, but the working times become less frequent, and eventually the site stops working at all.

The Cause – ASP.net will cache the wrong things.  In my case I converted the project from a full solution to a regular website and did not remove the compiled files (SolutionName.dll) in the bin and obj directories, which compounded the problem.

The Solution – Delete everything in in the “Temporary ASP.net Files” directory, which (on my machine) was located here C:WindowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files.  Then delete everything in obj directory, and the solution files from the bin directory.  That should fit it!

This was more of a stupid error on my part than a great mystery, but problematic nonetheless.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


03
Dec 10


Written By Steve French

 

Suggestions for Gates, Buffett and Turner – Home Insulation Edition

Charity School, Edmontonphoto © 2006 Fin Fahey | more info (via: Wylio)On Sunday I watched Christianne Amanpour’s interview with Bill & Melinda Gates, Warren Buffett and Ted Turner on This Week on Sunday.  All three espoused some form of SpiderMan conservatism.   The only interesting thing that emerged from the interview was that the Gates Foundation funds experimental work in American public schools.

Why?  The rest of the Gates Foundation work seems to be devoted (from what I have heard anyway) to creating one-time, permanent fixes to problems that they can “just do” with no permission from regulators, which is what I have always liked about that foundation.  To attempt to make any changes to public education would seem to involve a long fight with a deeply commited vested interest and a range of lobbyists for a limited reward at best.

That got me thinking of permanent, one-time improvements the foundation could make without coming into contact with vested interests and their lobbyists.  Here is one idea:

Home insulation – The Gates Foundation could sponsor their own research and improve spray foam insulation until it

  • has double to the R-Value per inch (up to R-14) of existing spray foam
  • has half the cost of the cheapest insulating competitor per cubic foot
  • is simple enough so that the average DIYer could resinsulate in a weekend
  • could be sold at  at Home Depot or Lowes, and WalMart.

Once those goals have been met they could open source the patents and let the commoditization begin!  America is horribly under-insulated, and making an R-100 easy to do would result in a permanent, one-time fix to America’s housing stock that would dramatically reduce residential energy consumption.  It would also disproportionally help the lower-income who tend to live in under-insulated houses.

Having said all this I do realize that insulating is not that difficult, nor that expensive, but it is perceived that way by the general public, and if you could reduce the payoff period to less than a year that would surely improve matters.

What do you think, what would you do if you had 50 million to spend and the improvement had to be:

  1. Permanent
  2. One-time (no recurring maintenance or anything)
  3. Mass-Market
  4. Physical, not virtual

Thoughts anyone?  Please leave them in the comments.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


30
Nov 10


Written By Steve French

 

Why bother with E-Checks?

monopoly-e-commerceI recently tried to buy The Entrepreneur´s Guide to Customer Development for Tech Startups and was alarmed to learn that the payment method I used (PayPal) uses an e-Check system by default.  My PayPal account is tied to a regular bank account and everything comes out of that.   Now apparantly I must wait for my check to clear, which won’t be until Friday.  I can’t believe I have to wait till Friday to get a PDF download! I did not see any notice of this on their site, and they did not take credit cards on the site where I bought the pdf.

I don’t begrudge them outsourcing their payment system, taking credit cards is a hard setup with many upfront costs.  However a notice that they will not send me the pdf for a few days would be quite nice, as would the option to cancel my order so I could just download the thing from Amazon.

How has the technology come to this?  Perhaps PayPal has changed their system around, but I have bought many, many things with my linked PayPal account and this has never happened before.

Creative Commons License photo credit: danielbroche

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


22
Nov 10


Written By Steve French

 

Free Biz Idea – profile people via their online content

Epic Profilephoto © 2009 Jac Culler | more info (via: Wylio)I recently thought of an online profiling service for sales people and business development people.  To use the service, a client enters the FaceBook Profile URL/Name/Email/Twitter/Blog Account/LinkedIn profile of a sales prospect into the service.  The service then spiders that person’s user-generated online content and draw psychological profiles based on word choice, photo to word density, passive vs active sentence use, number of adverbs per sentence, sentence length, and so on.

Once the service finished gathering the data the client would proceed with their sales and development duties as normal, while taking notes and measuring their success so the service could create and refine the algorithm.  Do people who write in the passive voice decide faster than those who write in the active voice?  If you post a lot of photos do you reject everything at first, but then comply with further requests?  Do people who have long LinkedIn profiles like new products, or an established products?

The service would aggregate the data to draw useful information, and I’m sure people would object on privacy grounds, but this service would improve the sales profiling and qualification process.  After all, user-generated content was generated by the user, so there must be some useful data to be gathered from it.

Thoughts anyone?  I might work this idea into Stronico at some point, but not in the next year or more.  I would use this service now if I could.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


15
Nov 10


Written By Steve French

 




Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.