In C#, using String.Equals() and "==" are interchangeable (C# "special cases" the "=="), whereas in Java, there IS a big difference.
In Java, "==" is for pointer references, that is, it compares whether the actual INSTANCES are the same, whereas, to simply compare two VALUES, you have to use String.equals().
Tuesday, November 29, 2016
Monday, November 7, 2016
Agile cheatsheet
One way to accomplish Agile goals is via the use of Scrum.... the Scrum PROCESS or method.
Scrum process has:
2-4 week SPRINTS
DAILY STAND-UPS
product BACKLOG, User Stories.
RETROSPECTIVES.
Another way to accomplish Agile goals is via XP (Extreme Programming).
Good user stories have VERTICAL SLICES through the product.
Kanban (Japanese for billboard)(taskboard in XP)
yellow stickes showing status of each backlog item (Currently working on, Currently in QA, Done)
Burndown Chart: shows how the sprint is progressing, actual vs. plan. Quantitative to Kanban's qualitative.
Pigs and Chickens.
Sprint Planning
Planning Poker (read user stories, give time estimates ....write down secretly, then share....)
XP:
Continuous integration
Coding standards,
Pair Programming,
Scrum process has:
2-4 week SPRINTS
DAILY STAND-UPS
product BACKLOG, User Stories.
RETROSPECTIVES.
Another way to accomplish Agile goals is via XP (Extreme Programming).
Good user stories have VERTICAL SLICES through the product.
Kanban (Japanese for billboard)(taskboard in XP)
yellow stickes showing status of each backlog item (Currently working on, Currently in QA, Done)
Burndown Chart: shows how the sprint is progressing, actual vs. plan. Quantitative to Kanban's qualitative.
Pigs and Chickens.
Sprint Planning
Planning Poker (read user stories, give time estimates ....write down secretly, then share....)
XP:
Continuous integration
Coding standards,
Pair Programming,
HTML5 tables and borders
Since a few years ago, if you put in a table without ANY css, you are going to get a borderless table. Worse, if you put borders="1" you will get the ugly, nasty way old-school HTML double borders. Worse STILL, even if you put the css for 1px solid black , you will STILL get the ugly double borders!!
The secret is to set the borders-collapse: to collapse. (the default value is SEPARATE).
<style>
table {
border-collapse: collapse;
}
table, td, th {
border: 1px solid black;
}
</style>
The secret is to set the borders-collapse: to collapse. (the default value is SEPARATE).
<style>
table {
border-collapse: collapse;
}
table, td, th {
border: 1px solid black;
}
</style>
Thursday, October 13, 2016
Monday, August 8, 2016
Clustered Index
a CLUSTERED index determines the PHYSICAL location (order) of data in a table. That's why you can only have ONE clustered index per table.
A Primary Key constraints will automatically create a CLUSTERED INDEX on that column.
-can have multiple columns (a COMPOSITE index)
Execute sp_helpindex tblEmployee
to view indexes.
You can change clustered index. First:
Drop Index tblEmployee.PK_tblEmplo_3FD45DG (or might have to use Object Explorer to Delete)
Create Clustered Index tblEmployee_Gender_Salary on tblEmployee (Gender DESC, Salary ASC)
CLUSTERED includes Data: think PHONEBOOK
NON-CLUSTERED is separate from data: think index to a BOOK
Since the index is stored separately, you CAN have MORE THAN ONE non-clustered indexes per table.
CLUSTERED INDEX is faster because it involves a single lookup, whereas NON-CLUSTERED has to do a second step to access the data location. Also, NON-CLUSTERED requires EXTRA STORAGE SPACE for itself.
----
set statistics io on
(then write your select query)
After running, view Messages.
----
For viewing execution plan,
TABLE SCAN is when there isn't an index.
An INDEX SEEK would be more efficient.
----
Downside of Indexing is when you have lots of writes/updates (transactions) to a table.
-----
Naming conventions:
IX prefix means Index.
UIX means UNIQUE index.
A Primary Key constraints will automatically create a CLUSTERED INDEX on that column.
-can have multiple columns (a COMPOSITE index)
Execute sp_helpindex tblEmployee
to view indexes.
You can change clustered index. First:
Drop Index tblEmployee.PK_tblEmplo_3FD45DG (or might have to use Object Explorer to Delete)
Create Clustered Index tblEmployee_Gender_Salary on tblEmployee (Gender DESC, Salary ASC)
CLUSTERED includes Data: think PHONEBOOK
NON-CLUSTERED is separate from data: think index to a BOOK
Since the index is stored separately, you CAN have MORE THAN ONE non-clustered indexes per table.
CLUSTERED INDEX is faster because it involves a single lookup, whereas NON-CLUSTERED has to do a second step to access the data location. Also, NON-CLUSTERED requires EXTRA STORAGE SPACE for itself.
----
set statistics io on
(then write your select query)
After running, view Messages.
----
For viewing execution plan,
TABLE SCAN is when there isn't an index.
An INDEX SEEK would be more efficient.
----
Downside of Indexing is when you have lots of writes/updates (transactions) to a table.
-----
Naming conventions:
IX prefix means Index.
UIX means UNIQUE index.
Wednesday, July 20, 2016
Tuesday, June 7, 2016
Encryption
SQL Server version 12 has lots of new encryption options.
(to tell version of SQL Server, use: Select @@version )
Transparent
Column-level
use .NET
use File System
BitLocker
Page that describes options: http://sqlmag.com/database-security/sql-server-encryption-options
UPDATE: Apparently that site fell victim to the Goths and Vandals. Reprinted below.
(to tell version of SQL Server, use: Select @@version )
Transparent
Column-level
use .NET
use File System
BitLocker
Page that describes options: http://sqlmag.com/database-security/sql-server-encryption-options
UPDATE: Apparently that site fell victim to the Goths and Vandals. Reprinted below.
SQL Server Encryption Options
May 17, 2013Michael Otey
One of the most difficult-to-understand options in SQL Server 2012 is the ability to encrypt data. This is mainly because of all of the different encryption capabilities offered.
Data encryption can be performed by the OS, by SQL Server, or by the application. I’ll help guide you through the different SQL Server encryption options.
Related: SQL Server Encryption
1. Transparent Data Encryption
Transparent Data Encryption (TDE) is the primary SQL Server encryption option. It was first available in SQL Server 2008, and as with the SQL Server 2012 release, it's available only in the SQL Server Enterprise edition, not in the Business Intelligence, Standard, or Express editions. TDE enables you to encrypt an entire database. Backups for databases that use TDE are also encrypted. TDE protects the data at rest, which means that the database’s data and log files are encrypted using the AES and 3DES encryption algorithms. TDE is completely transparent to the application and requires no coding changes to implement. For more information on TDE, check out "Transparent Data Encryption," on MSDN and my SQL Server Pro article "Using Transparent Data Encryption."
Related: Transparent Data Encryption FAQs
2. Column-level Encryption
Column-level encryption (aka cell-level encryption) was introduced in SQL Server 2005 and is available in all editions of SQL Server, including the free SQL Server Express edition. To use cell-level encryption, the schema must be changed to varbinary, then reconverted to the desired data type. This means the application must be changed to support the encryption-decryption operation; in addition, it can affect performance. Encryption of the database occurs at the page level, but when those pages are read to buffer pool, they're decrypted. Data can be encrypted using a passphrase, an asymmetric key, a symmetric key, or a certificate. The supported algorithms for column-level encryption are AES with 128,196,256 bit keys and 3DES. To learn more about column-level encryption, see the MSDN article "Encrypt a Column of Data."
3. Encrypting and Decrypting Data with the .NET Framework
Another option for encrypting data stored in SQL Server is to perform the encryption and decryption from within the application. All editions of SQL Server support this style of data encryption. However, unlike TDE, encrypting data within the application requires that you specifically code the application to perform the encryption by calling the encryption and decryption methods. The .NET Framework supports encryption using the System.Security.Cryptography namespace to perform symmetric or asymmetric encryption. You can learn more about .NET-based encryption at "Encrypting and Decrypting Data." Application-level encryption can also be performed by other development frameworks such as Java.
4. Encrypting File Systems
Encrypting File Systems (EFS) is a file-encryption feature introduced in Windows 2000. Windows Server supports EFS for encrypting data at the file and folder level. EFS uses industry-standard encryption algorithms including AES, SHA, ECC, and smart card–based encryption. Installing a SQL Server database in EFS isn't usually a recommended practice because of the added overhead. EFS isn't optimized for performance, and all I/O is synchronous. If you use EFS, the database files are encrypted under the identity of the account running SQL Server. If you change the account that runs the SQL Server service, you must first decrypt the files using the old account, then re-encrypt them using the new account. You can learn about the performance implications of running SQL Server and EFS at the Microsoft Support web page.
5. BitLocker
BitLocker Drive Encryption is a data protection feature available in Windows Server 2012, Windows 8, Windows 7, and Windows Server 2008 R2. BitLocker works at the volume level, and it protects data when it's at rest by using the AES algorithm. BitLocker doesn't have the same performance concerns associated with EFS. You can learn more about BitLocker at the Microsoft article, "BitLocker Driver Encryption Overview."
Subscribe to:
Posts (Atom)