This file contains hidden or 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
| ## http://stackoverflow.com/questions/4583367/how-to-run-multiple-python-version-on-windows | |
| ## print installed version of python | |
| python -V | |
| import sys | |
| sys.version |
This file contains hidden or 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
| -- From http://stackoverflow.com/questions/121243/hidden-features-of-sql-server | |
| DELETE FROM (table) | |
| OUTPUT deleted.ID, deleted.Description | |
| WHERE (condition) | |
| INSERT INTO MyTable(Field1, Field2) | |
| OUTPUT inserted.ID | |
| VALUES (Value1, Value2) |
This file contains hidden or 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
| -- From http://stackoverflow.com/questions/175415/how-do-i-get-list-of-all-tables-in-a-database-using-tsql | |
| -- list all tables | |
| SELECT * FROM information_schema.tables | |
| SELECT * FROM sysobjects WHERE xtype='U' | |
| SELECT * FROM sys.tables; |
This file contains hidden or 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
| -- From http://stackoverflow.com/questions/155246/how-do-you-truncate-all-tables-in-a-database-using-tsql | |
| -- disable all constraints | |
| EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all" | |
| -- delete data in all tables | |
| EXEC sp_MSForEachTable "DELETE FROM ?" | |
| -- enable all constraints |
This file contains hidden or 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
| -- From http://stackoverflow.com/questions/5452760/truncate-foreign-key-constrained-table | |
| SET FOREIGN_KEY_CHECKS=0; | |
| TRUNCATE table1; | |
| TRUNCATE table2; | |
| SET FOREIGN_KEY_CHECKS=1; |
This file contains hidden or 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
| -- From http://dba.stackexchange.com/questions/6031/how-do-you-kick-users-out-of-a-sql-server-2008-database | |
| -- hit Ctrl+Shift+M in SSMS to fill in the template parameter | |
| USE master; | |
| GO | |
| ALTER DATABASE N'<Database Name, sysname,>' | |
| SET SINGLE_USER |
This file contains hidden or 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
| ## From http://askubuntu.com/questions/18372/how-can-i-find-out-what-ram-a-computer-system-has | |
| ## find hardware info | |
| sudo dmidecode -t memory ## RAM info | |
| ## http://askubuntu.com/questions/146621/what-is-the-equivalent-of-windows-system-properties-or-device-manager | |
| lshw |
This file contains hidden or 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
| ## create a local repo and commit it to github account | |
| ## http://stackoverflow.com/questions/2423777/is-it-possible-to-create-a-remote-repo-on-github-from-the-cli-without-ssh | |
| mkdir projectname | |
| cd projectname | |
| git init | |
| touch file1 |
This file contains hidden or 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
| import org.joda.time.* | |
| a = new DateTime() | |
| println(a.getMillis()) | |
| println(new Date()) | |
This file contains hidden or 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
| -- http://stackoverflow.com/questions/898688/how-to-get-database-structure-in-mysql-via-query | |
| DESCRIBE table; | |
| SHOW TABLES; | |
| SHOW TABLES LIKE '%filter%' | |
| -- print create table query |