When you just need a li'l automation, you can use this to iterate through known names, etc.
WebClient client = new WebClient();
string fileUrlTemp= "http://www.blogger.com/asdf/asdf.jpg";
client.DownloadFile(fileUrlTemp, "img.jpg");
Tuesday, July 7, 2015
Monday, July 6, 2015
Facebook for your Website: What you need to know
When a Facebook user links to your site, FB generates a preview that might not always be what you want users to see.
Here is how to control it.
IMPORTANT! Once anybody has linked to your site, FB will store a cache, and you'll have to wait 24-hours before FB will listen to any meta-tags you update the page with.
(a quick hack around this is to just create a new page, like "index2.html", or "indexFacebook.html", to use for sharing)
Put this in your page:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>Vaudeville Book</title>
<meta property="og:image" content="http://www.yourwebsite.com/vaudeville/img0.jpg" />
<meta property="og:url" content="http://www.yourwebsite.com/vaudeville/indexFacebook.html"/>
<meta property="og:title" content="How to Enter Vaudeville"/>
<meta property="og:site_name" content="How to Enter Vaudeville: The Website"/>
<meta property="og:description" content="The new economy is here, and the non-monied classes must learn how to amuse and entertain the monied classes."/>
</head>
<body>...
Probably most significant is the og:image value, because that is the picture that will be used for the the "preview" in the Facebook status post.
Then, to check out how it works, go to:
https://developers.facebook.com/tools/debug
and enter in the url to your page.
Incidentally, this is all called "Open Graph", and here is a link to the page with info about it:
http://ogp.me/
and trusty Wikipedia:
http://en.wikipedia.org/wiki/Facebook_Platform#Open_Graph_protocol
Here is how to control it.
IMPORTANT! Once anybody has linked to your site, FB will store a cache, and you'll have to wait 24-hours before FB will listen to any meta-tags you update the page with.
(a quick hack around this is to just create a new page, like "index2.html", or "indexFacebook.html", to use for sharing)
Put this in your page:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>Vaudeville Book</title>
<meta property="og:image" content="http://www.yourwebsite.com/vaudeville/img0.jpg" />
<meta property="og:url" content="http://www.yourwebsite.com/vaudeville/indexFacebook.html"/>
<meta property="og:title" content="How to Enter Vaudeville"/>
<meta property="og:site_name" content="How to Enter Vaudeville: The Website"/>
<meta property="og:description" content="The new economy is here, and the non-monied classes must learn how to amuse and entertain the monied classes."/>
</head>
<body>...
Probably most significant is the og:image value, because that is the picture that will be used for the the "preview" in the Facebook status post.
Then, to check out how it works, go to:
https://developers.facebook.com/tools/debug
and enter in the url to your page.
Incidentally, this is all called "Open Graph", and here is a link to the page with info about it:
http://ogp.me/
and trusty Wikipedia:
http://en.wikipedia.org/wiki/Facebook_Platform#Open_Graph_protocol
border-collapse: collapse
table {
border-collapse: collapse;
}
Would create trouble in IE8 and before.
While IE 8 was in the wild (mid-2009 - ?)... would not have been used ....
IE 8 was default browser for Win 7....
Even in October 2014, IE 8 was almost 20% of web traffic.
border-collapse: collapse;
}
Would create trouble in IE8 and before.
While IE 8 was in the wild (mid-2009 - ?)... would not have been used ....
IE 8 was default browser for Win 7....
Even in October 2014, IE 8 was almost 20% of web traffic.
Sunday, July 5, 2015
How to copy a table, with its data, in SQL Server (no, Mgt Studio doesn't do it for you)
You would really think that this would be a built-in feature available from the context menu. But as proof it most definitely is NOT, see:
https://technet.microsoft.com/en-us/magazine/dd401720.aspx
As Microsoft tells you, just do this:
SELECT * INTO BizDev.CurrCustomers FROM Sales.Customers
https://technet.microsoft.com/en-us/magazine/dd401720.aspx
As Microsoft tells you, just do this:
SELECT * INTO BizDev.CurrCustomers FROM Sales.Customers
Thursday, July 2, 2015
Exception Handling not working on Server
This is important stuff. Nothing sucks worse than when Exception Handling actually breaks your application. And nothing sucks worse than when something behaves one way locally and a different way once it gets deployed to your server.
As this article explains, you can have a global error handler in your Global.asax file that gets fired on your local machine, but if your web.config file is lacking a CustomErrors setting, it won't work on an IIS server.
So be sure your web.config has this section:
and for starters, set it to:
<customErrors mode="Off" />
As this article explains, you can have a global error handler in your Global.asax file that gets fired on your local machine, but if your web.config file is lacking a CustomErrors setting, it won't work on an IIS server.
So be sure your web.config has this section:
<customErrors mode="On|Off|RemoteOnly" />
and for starters, set it to:
<customErrors mode="Off" />
Labels:
ASP.NET,
Error Handling,
Errors,
Exception Handling,
Exceptions,
IIS
Monday, June 29, 2015
SQL Server Case SEnSitiviTy
Potentially fraught if someone changes the collation setting on you.
Collation can be set at various levels:
- Server
- Database
- Column
So you could have a Case Sensitive Column in a Case Insensitive database. I have not yet come across a situation where a business case could be made for case senstivity of a single column of data, but I suppose there could be.
Check Server Collation
SELECT SERVERPROPERTY('COLLATION')
Check Database Collation
SELECT DATABASEPROPERTYEX('AdventureWorks', 'Collation') SQLCollation;
Check Column Collation
select table_name, column_name, collation_name
from information_schema.columns
where table_name = @table_name
What the Result Means
Typically, you'll get SQL_Latin1_General_CP1_CI_AS.
The CI part means CASE INSENSITIVE. SQL_Latin1_General_CP1_CI_AS.
If it was case SENSITIVE, it would be 'CS' instead of 'CI':
SQL_Latin1_General_CP1_CS_AS
Monday, June 22, 2015
My First Computer Program: Wandering Monster Generator from 'The Dragon' magazine
Here it is, exactly as I had to type it into my TRS-80 and hope it saved to the cassette recorder:
From "The Dragon" issue #41, September 1980.
Only recognition of this column on the web I could find is:
https://en.wikipedia.org/wiki/User:BOZ/Dragon_video_game_reviews
From "The Dragon" issue #41, September 1980.
Only recognition of this column on the web I could find is:
https://en.wikipedia.org/wiki/User:BOZ/Dragon_video_game_reviews
Subscribe to:
Posts (Atom)
