This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -p get all images, etc. needed to display HTML page. | |
# --mirror turns on recursion and time-stamping, sets infinite | |
# recursion depth and keeps FTP directory listings | |
# --html-extension save HTML docs with .html extensions | |
# --convert-links make links in downloaded HTML point to local files. | |
wget --mirror -p --html-extension --convert-links www.example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Window_Loaded( object sender, RoutedEventArgs e ) { | |
container.Measure( new Size( Double.PositiveInfinity, Double.PositiveInfinity ) ); | |
this._containHeight = container.DesiredSize.Height; | |
container.Height = 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void SendEmail(string from, IEnumerable<string> to, string subj, string body, bool isHtml = false, SmtpClient client) { | |
MailMessage message = new MailMessage(); | |
message.From = new MailAddress( from ); | |
foreach( string copy in cc ) { | |
message.To.Add( new MailAddress( copy )); | |
} | |
message.Subject = subj; | |
message.Body = body; | |
message.IsBodyHtml = isHtml; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Cgum; // Common methods - EncryptMd5() [personal library] | |
// init: Gravatar = GetAvatar( email ) | |
public static readonly DependencyProperty GravatarProperty = | |
DependencyProperty.Register( "Gravatar", | |
typeof( BitmapImage ), | |
typeof( SingleCustomerVM ), | |
new PropertyMetadata( | |
new BitmapImage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<List<string>> lists = new List<List<string>>() { | |
new List<string> {"Hello", "World", "7"}, | |
new List<string> {"Hello", "7", "Person"}, | |
new List<string> {"7", "7", "Hello"} | |
}; | |
List<string> common = lists.Cast<IEnumerable<string>>( | |
.Aggregate( ( a, b ) => a.Intersect( b ) ) | |
.ToList(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = list.Select( s => s.Replace( toReplace, replace ) ).ToArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private DataTable GetData( string conString, string table ) { | |
DataTable dt = new DataTable(); | |
using( SqlConnection sqlConn = new SqlConnection( conString ) ) { | |
sqlConn.Open(); | |
using( SqlCommand sqlCmd = new SqlCommand( "SELECT * FROM " + table, sqlConn ) ) { | |
using( SqlDataAdapter sqlDa = new SqlDataAdapter( sqlCmd ) ) { | |
sqlDa.Fill( dt ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get a count of, lets say, people's names that start with each letter | |
-- from a specific city and state | |
SELECT LEFT(name, 1) AS letter, COUNT(id) AS total | |
FROM data_table | |
WHERE city = ? AND state = ? | |
GROUP BY letter | |
ORDER BY letter ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Get a count of people in each city from a specific state | |
SELECT DISTINCT(city) AS city, COUNT(city) AS total | |
FROM data | |
WHERE state = ? | |
GROUP BY city | |
ORDER BY city ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_schema AS 'Database name', | |
SUM(data_length + index_length) / 1024 / 1024 AS 'Size (MB)', | |
SUM(data_free) / 1024 / 1024 AS 'Free (MB)' | |
FROM information_schema.TABLES | |
GROUP BY table_schema |
OlderNewer