Showing posts with label Hacks. Show all posts
Showing posts with label Hacks. Show all posts

Thursday, October 9, 2008

Nice collection of VB.NET Programming Hacks

A nice collection of VB.NET Programming Hacks

Here is what is available

General
* Aliassing a namespace
* Memory usage for all processes
* Get the commandline parameters
* Get the computername
* Getting text from the clipboard
* Saving text on the clipboard
* Getting the freespace on a drive
* Getting memoryusage of one process
* Get the total space used by a drive
* Path to UNC
* Impersonating an administrator
* Programaticaly changing the Ignore addresses in the proxy settings


Strings
* Use StringBuilder to concatenate strings


Dates
* Add day, month, year to date
* Add time to a date (hours, minutes, seconds)
* Substract Time from a date (hours, minutes, seconds)
* Substract from a date (days, months, years)
* What day of the week is a certain date
* Is this year a leapyear?
* Difference in days between 2 dates


ADO.NET
* Use commandparameters instead of string concatenation


Forms
* Opening a form on a specified monitor
* Show a form in a form
* Open a form as modal
* Open a form
* MDI
* Hide a form on closing

Wednesday, July 2, 2008

Awesome Collection Of ASP.NET Hacks, Tips and Tricks

We added a bunch of ASP.NET Hacks, Tips and Tricks , below is the full list

Applications

* ASP.NET: Environment Details
* ASP.NET: Encrypt your applications settings
* ASP.NET: Launch an external application
* ASP.NET: Display Version Information

Caching

* ASP.NET: Clear all Cached objects
* ASP.NET: Data Caching

Controls

* ASP.NET: Access Master Page controls from the Content Page
* ASP.NET: Maintain an entered password in a TextBox
* ASP.NET: Apply a Please Wait message to a Button
* ASP.NET: Clear all TextBox values
* ASP.NET: Creating an accessible label
* ASP.NET: Add dynamic controls with events
* ASP.NET: Get a list of all selected items in a CheckBoxList
* ASP.NET: Find which control caused a postback
* ASP.NET: Limit selections for the Calendar
* ASP.NET: Add a confirmation popup to a Button
* ASP.NET: Insert a ListItem into a DropDownList
* ASP.NET: Add paging to a repeater
* ASP.NET: Append client side functions with Attributes.Add
* ASP.NET: Add a total row to a GridView
* ASP.NET: How to export a GridView to Excel
* ASP.NET: Render a control to a string

Database

* ASP.NET: Convert a DataSet to a DataView
* ASP.NET: Extract data from a SQLDataSource to a DataTable
* ASP.NET: Insert data into SQL Server
* ASP.NET: Loop through data in a DataTable
* ASP.NET: Loop through data using a DataReader
* ASP.NET: Storing connection strings in the web.config file

Dates

* ASP.NET: Calculate a person's age from their date of birth
* ASP.NET: Calculate the difference between two dates
* ASP.NET: Simple date and time methods

Debugging

* ASP.NET: Enabling page tracing
* ASP.NET: Simple debugging tips

Email

* ASP.NET: Send an email

Encryption

* ASP.NET: Encrypt a string using MD5

Files

* ASP.NET: Files and Path information
* ASP.NET: Rename a directory
* ASP.NET: Reference files with relative paths
* ASP.NET: Read and display a text file

Images

* ASP.NET: How to crop an Image
* ASP.NET: How to save a remote image
* ASP.NET: Drawing images and bar charts with System.Drawing

Javascript

* ASP.NET: Register a javascript function

Objects and Classes

* ASP.NET: Accessing the Response object in a Class
* ASP.NET: An introduction to classes and properties
* ASP.NET: Looping using an Enumerator
* ASP.NET: Use Response.Filter to intercept your HTML
* ASP.NET: Use C Sharp and VB.NET in the same project
* ASP.NET: Using Generics to create a property list

Pages

* ASP.NET: Change the current Master Page
* ASP.NET: Nested Master Pages

Sessions

* ASP.NET: Redirect the page when the session ends

Strings

* ASP.NET: Filter words
* ASP.NET: Remove the last character from a string
* ASP.NET: Reverse a string
* ASP.NET: String Concatenation
* ASP.NET: Strip HTML tags from a string
* ASP.NET: Truncate a string to a set number of whole words

Validation

* ASP.NET: Using Page.IsValid

Visual Studio

* ASP.NET: Changing the default browser
* ASP.NET: Keyboard Shortcuts
* ASP.NET: Using a task list

Web

* ASP.NET: Access the web via a proxy server
* ASP.NET: Convert HTML tables to a DataSet
* ASP.NET: Retrieve data from a web page
* ASP.NET: Create an RSS Feed
* ASP.NET: Custom Error Pages
* ASP.NET: Find out where a visitor came from
* ASP.NET: Using an AppOffline.htm file for updates
* ASP.NET: XHTML Strict Validation




The URL to these hacks is here: http://wiki.lessthandot.com/index.php/ASP.NET_Hacks

Bookmark that URL because we will be adding more hacks, tips and tricks

Sunday, June 1, 2008

Less Than Dot A New community Site Has Been Launched

Myself and a bunch of friends have been working on Less Than Dot for a while now. The site has a forum, blogs and a wiki. More info why we started Less Than Dot and who we are can be found here: http://www.lessthandot.com/aboutus.php

Since I am mostly a SQL guy, I wrote a collection of SQL Server hacks. This collection of SQL hacks is available on the Wiki, right now we have 8 sections and between 70 and 80 hacks. Ideally we will have more hacks and we will also have a SQL admin hacks page in the future.


SQL Server Hacks Sections
* 1 NULLS
* 2 Dates
* 3 Sorting, Limiting Ranking, Transposing and Pivoting
* 4 Handy tricks
* 5 Pitfalls
* 6 Query Optimization
* 7 Undocumented but handy
* 8 Usefull Admin stuff For The Developer


Below are direct links to all the hacks on the wiki, you can also get a list of all the hacks on the wiki itself here: SQL Server Programming Hacks


NULLS

Dates

Sorting, Limiting,Ranking, Transposing and Pivoting


Handy tricks

Pitfalls

Query Optimization

Undocumented but handy


Usefull Admin stuff For The Developer


Hopefully you will like the site and find some good content, if you have a question then don't hesitate to ask it in a forum.

Monday, January 22, 2007

SQL Hacks

Title:SQL Hacks
First Edition: November 2006
Series: Hacks
ISBN 10: 0-596-52799-3
ISBN 13: 9780596527990
Pages: 410

Description:
Whether you're running Access, MySQL, SQL Server, Oracle, or PostgreSQL, this book will help you push the limits of traditional SQL to squeeze data effectively from your database. The book offers 100 hacks -- unique tips and tools -- that bring you the knowledge of experts who apply what they know in the real world to help you take full advantage of the expressive power of SQL. You'll find practical techniques to address complex data manipulation problems. Learn how to:

--Wrangle data in the most efficient way possible
--Aggregate and organize your data for meaningful and accurate reporting
--Make the most of subqueries, joins, and unions
--Stay on top of the performance of your queries and the server that runs them
--Avoid common SQL security pitfalls, including the dreaded SQL injection attack

Let SQL Hacks serve as your toolbox for digging up and manipulating data. If you love to tinker and optimize, SQL is the perfect technology and SQL Hacks is the must-have book for you.


Sample Chapter
A sample chapter is available: Hack 4: Date Handling (PDF Format)

Table Of Contents:
Chapter 1. SQL Fundamentals
1. Run SQL from the Command Line
2. Connect to SQL from a Program
3. Perform Conditional INSERTs
4. UPDATE the Database
5. Solve a Crossword Puzzle Using SQL
6. Don't Perform the Same Calculation Over and Over

Chapter 2. Joins, Unions, and Views
7. Modify a Schema Without Breaking Existing Queries
8. Filter Rows and Columns
9. Filter on Indexed Columns
10. Convert Subqueries to JOINs
11. Convert Aggregate Subqueries to JOINs
12. Simplify Complicated Updates
13. Choose the Right Join Style for Your Relationships
14. Generate Combinations

Chapter 3. Text Handling
15. Search for Keywords Without LIKE
16. Search for a String Across Columns
17. Solve Anagrams
18. Sort Your Email

Chapter 4. Date Handling
19. Convert Strings to Dates
20. Uncover Trends in Your Data
21. Report on Any Date Criteria
22. Generate Quarterly Reports
23. Second Tuesday of the Month

Chapter 5. Number Crunching
24. Multiply Across a Result Set
25. Keep a Running Total
26. Include the Rows Your JOIN Forgot
27. Identify Overlapping Ranges
28. Avoid Dividing by Zero
29. Other Ways to COUNT
30. Calculate the Maximum of Two Fields
31. Disaggregate a COUNT
32. Cope with Rounding Errors
33. Get Values and Subtotals in One Shot
34. Calculate the Median
35. Tally Results into a Chart
36. Calculate the Distance Between GPS Locations
37. Reconcile Invoices and Remittances
38. Find Transposition Errors
39. Apply a Progressive Tax
40. Calculate Rank

Chapter 6. Online Applications
41. Copy Web Pages into a Table
42. Present Data Graphically Using SVG
43. Add Navigation Features to Web Applications
44. Tunnel into MySQL from Microsoft Access
45. Process Web Server Logs
46. Store Images in a Database
47. Exploit an SQL Injection Vulnerability
48. Prevent an SQL Injection Attack

Chapter 7. Organizing Data
49. Keep Track of Infrequently Changing Values
50. Combine Tables Containing Different Data
51. Display Rows As Columns
52. Display Columns As Rows
53. Clean Inconsistent Records
54. Denormalize Your Tables
55. Import Someone Else's Data
56. Play Matchmaker
57. Generate Unique Sequential Numbers

Chapter 8. Storing Small Amounts of Data
58. Store Parameters in the Database
59. Define Personalized Parameters
60. Create a List of Personalized Parameters
61. Set Security Based on Rows
62. Issue Queries Without Using a Table
63. Generate Rows Without Tables

Chapter 9. Locking and Performance
64. Determine Your Isolation Level
65. Use Pessimistic Locking
66. Use Optimistic Locking
67. Lock Implicitly Within Transactions
68. Cope with Unexpected Redo
69. Execute Functions in the Database
70. Combine Your Queries
71. Extract Lots of Rows
72. Extract a Subset of the Results
73. Mix File and Database Storage
74. Compare and Synchronize Tables
75. Minimize Bandwidth in One-to-Many Joins
76. Compress to Avoid LOBs

Chapter 10. Reporting
77. Fill in Missing Values in a Pivot Table
78. Break It Down by Range
79. Identify Updates Uniquely
80. Play Six Degrees of Kevin Bacon
81. Build Decision Tables
82. Generate Sequential or Missing Data
83. Find the Top n in Each Group
84. Store Comma-Delimited Lists in a Column
85. Traverse a Simple Tree
86. Set Up Queuing in the Database
87. Generate a Calendar
88. Test Two Values from a Subquery
89. Choose Any Three of Five

Chapter 11. Users and Administration
90. Implement Application-Level Accounts
91. Export and Import Table Definitions
92. Deploy Applications
93. Auto-Create Database Users
94. Create Users and Administrators
95. Issue Automatic Updates
96. Create an Audit Trail

Chapter 12. Wider Access
97. Allow an Anonymous Account
98. Find and Stop Long-Running Queries
99. Don't Run Out of Disk Space
100. Run SQL from a Web Page


And for $19.79 on Amazon this is a great gift