Uncategorized Archives - Page 2 of 2 - Digital Tool Factory blog Uncategorized Archives - Page 2 of 2 - Digital Tool Factory blog

The Digital Tool Factory Blog

How to fix problems with Visual Studio 2013 Web Deploy

Recently I began having problems with the Visual Studio Web Deploy feature – I did some googling and found that restarting the “Web Deploy Agent Service” fixes everything – I’m not sure why the service would lock up after a boot but that did fix it.


15
Jul 14


Written By Steve French

 

How to fix problems with small fonts when using the rotativa nuget package

Does the actual html look fine but the text on the printed pdf look way, way too small when you actually print the thing?

  1. In the MVC Controller – add in

    CustomSwitches = “–disable-smart-shrinking”,

  2. Check for long strings of unbroken text, in my case it was a fake underline of underscores (______) which was causing problems.

Blogged about largely in case I ever need to remember it later.


07
Jul 14


Written By Steve French

 

ASP.net MVC remote validation does not check for empty strings

This is a lesson I learn too frequently – asp.net mvc remote validation does not validate when the textbox (or whatever) is empty – it will not check empty strings and the event simply won’t fire.  Why it does this I don’t know but it does not.  I spent an annoying amount of time relearning that recently.  I guess Microsoft wants you to use the required validation fields first, but I run into many situations where the object is not required per se, but is required if some other data is entered.

 

What is the solution?  I’ve had great luck using MVC FoolProof Validation – available here.


14
May 14


Written By Steve French

 

A non definitive list of 64 html escape characters for currency

'Currencies on White Background' photo (c) 2011, Images Money - license: http://creativecommons.org/licenses/by/2.0/I recently had to integrate html escape characters for currency symbols on a project, and much to my surprise I could not find any good definitive list html escape characters for currency codes. These are also known as escape characters, character entities or extended characters.  I had to find them all more or less one by one.  Here is what I came up with. For some reason WordPress is not letting me post the escape characters as escape characters, so I have attached a simple text file containing a list of 64 html escape characters for currency symbols. Hopefully this will save someone else 45 minutes.

Here is what is in the file – it is in the Name – Abbreviation – Symbol format.

Australian Dollar – AUD – ₳
Barbados Dollar – BBD – $
Bulgarian Lev – BGN – л в
Bermudian Dollar – BMD – $
Brazilian Real – BRL – R$
Belize Dollar – BZD – $
Canadian Dollar – CAD – $
Swiss Franc – CHF – ₣
Chilean Peso – CLP – ₱
Chinese Yuan Renminbi – CNY – ₩
Colombian Peso – COP – ₱
Costa Rican Colon – CRC – ₡
Czech Koruna – CZK – Kč
Danish Krone – DKK – kr
Dominican Peso – DOP – ₱
Egyptian Pound – EGP – £
Euro Dollar – EUR – €
Fiji Dollar – FJD – $
British Pound – GBP – £
Guatemalan Quetzal – GTQ – Q
Hong Kong Dollar – HKD – $
Honduran Lempira – HNL – L
Croatian Kuna – HRK – kn
Hungarian Forint – HUF – Ft
Indonesian Rupiah – IDR – Rp
Israeli New Shekel – ILS – ₪
Indian Rupee – INR – ₨
Iraqi Dinar – IQD – Ű
Iceland Krona – ISK – kr
Jamaican Dollar – JMD – $
Jordanian Dinar – JOD – Дин.
Japanese Yen – JPY – ¥
Kenyan Schilling – KES – KSh
Korean Won – KRW – ₩
Kuwaiti Dinar – KWD – Дин.
Cayman Islands Dollar – KYD – $
Lithuanian Litas – LTL – Lt
Latvian Lats – LVL – Ls
Moroccan Dirham – MAD – MAD
Mexican New Peso – MXN – ₱
Malaysian Ringgit – MYR – R&:#77;
Norwegian Kroner – NOK – kr
New Zealand Dollar – NZD – $
Omani Rial – OMR – ﷼
Peruvian Nuevo Sol – PEN – S/.
Philippine Peso – PHP – ₱
Pakistan Rupee – PKR – ₹
Poland Zloty – PLN – zł
Qatari Rial – QAR – ﷼
Romania New Leu – RON – lei
Russian Rouble – RUB – р&#1091б
Saudi Riyal – SAR – ﷼
Swedish Krona – SEK – kr
Singapore Dollar – SGD – $
Thai Baht – THB – ฿
Turkey Lira – TRY – ₤
Trinidad and Tobago Dollar – TTD – $
Taiwan Dollar – TWD – $
US Dollar – USD – $
Vietnamese Dong – VND – ₫
East Caribbean Dollar – XCD – $
South African Rand – ZAR – R
Bahamas Dollar – BSD – $
Bahrain Dollar – BHD – $


17
Oct 13


Written By Steve French

 

How to fix the “Could not determine storage version; a valid storage connection or a version hint is required”

The Cause:

You’re cruising right along updating everything properly when all of a sudden you get an inexplicable

Could not determine storage version; a valid storage connection or a version hint is required

error

The Cause:

You’ve been upgrading and downgrading Entity Framework Versions.  The actual error has nothing to do with the error message listed above.

The Solution:

There really is no good solution to this, as I have spent the past six hours proving – the best thing to do is just to upgrade to Entity Framework 6 and find some other workaround for any other problem.


03
Jun 13


Written By Steve French

 

How to fix The model backing the context has changed since the database was created error

The Problem

You are coding away, and you get the following error

The model backing the ‘ctx’ context has changed since the database was created. Consider using Code First Migrations to update the database

This is my most frequent error when programming with Entity Framework asp.net .net mvc.  I usually only happens when using databases I do not have control over.

The Cause

Read this very good page for more info.

The Solution

Just add in this bit of code to your Application_Start() in Global.asax

Database.SetInitializer<MyContext>(null);

And you’re all set.


22
Aug 12


Written By Steve French

 

When challenging Goliath, do not arm wrestle

'Goliath and his bird' photo (c) 2007, hattiew - license: http://creativecommons.org/licenses/by-nd/2.0/I attended another enjoyable meeting of the Atlanta Lean Startup Circle last night.  It was a bit of a rambler of a meeting, but it was centered around making Atlanta more like Silicon Valley in terms of technology startups.

We wound up defining startups for this purpose as a company that is

  1. high risk
  2. high growth
  3. consumer focused
  4. in vital need of investment money

I don’t really keep track, but apparently Atlanta ranks low on both investors and startups that meet the above criteria.  We rank highly for quality of life issues, and our entrepreneurs are happy, but there are not many of them.   Getting more of them was the gist of the meeting, with the assumption that the investors would follow.

As always, the good thoughts happen on the drive home.    In particular the thought that Silicon Valley is set up to take advantage of startups as defined above.  Great!  I’ms glad that someone is.

Then I had the thought; why compete against Goliath at a test of strength?  Silicon Valley already has all of the risk based startups, venture capitalists, angel investors and assorted hangers on.  To wit, they are well stocked with the necessary evils.  We can try to go head to head, and lose repeatedly and badly, or we can build something new.  Why not have the South be the hub of bootstrapped, and lifestyle businesses?

There’s plenty of opportunity to go around, instead of trying to be the next Facebook, why not build The Internet of Things or wearable computers?  There’s no gold in old mines, and you can’t win (to the degrees that cities compete) when your opponent knows the rules better than you do.  Why not be the center of something else?


19
Jul 12


Written By Steve French

 

How to programatically set the sql server database used by entity framework

The Problem:

'Entity Framework' photo (c) 2009, SondreB - license: http://creativecommons.org/licenses/by/2.0/For one reason or another you need to set the database used by entity framework programatically.  The more common way of doing such a thing is to set the database in your web.config class, but for whatever reason you need to set it in actual C# code.

The Cause:

There is no cause really, it is merely the way that entity framework and sql server work together.

The Solution:

The answer lies in setting the constructor properly.

Example Code Using Entity Framework and Data Context

using System.Data.Entity;

namespace MyDBServerExperiments.Models
{
public class DTFContext : DbContext
{
public DTFContext() : base(“Data Source=MyDBServer.DBServer.com;Initial Catalog=MyEntityFrameworkDB;Persist Security Info=True;user id=MyUsername; Password=MyPassword;”) { }

public DbSet<User> Users { get; set; }
public DbSet<BusinessObjects> BusinessObjects { get; set; }
public DbSet<Property> Properties { get; set; }

}

}

The above would be your data context file that uses the DBContext file  in your models folder, just fyi (that is the common place for Entity Framework models in the standard  Visual Studio 2010 web solution structure).

Note, everything happens in the constructor.  This give you many interesting opportunities to programatically swap out Sql Server database names and users, compared to the web.config option, which tends to be far more static.  It allows far more extensive use of business objects and


24
Apr 12


Written By Steve French

 

Want to know more about Zoho Time Tracking?

You should read my review of Zoho Time Tracking on the Time Tracking Review blog.


15
Oct 11


Written By Steve French

 

Free Derek Sivers video on App Sumo

I’ve been a huge fan of Derek Sivers for several years now, and I have seen, listened, or read over a dozen interviews and presentations with him, making me something of a groupie.  Today’s App Sumo deal is the longest presentation I’ve seen of his, and chock full of data and useful advice.

And it’s free!  Go get it now.

 

Editor’s Note

This blog post originally appeared on the Profit Awareness Blog – as that app is up for sale, it has been consolidated into the main Digital Tool Factory blog.


05
Aug 11


Written By Steve French

 




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