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
#include <iostream> | |
#include <string> | |
using namespace std; | |
void Exercise_While_Break() | |
{ | |
string password; | |
while (true) |
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
# https://www.khanacademy.org/math/linear-algebra/vectors_and_spaces/vectors/e/adding-vectors-in-magnitude-and-direction-form | |
def findComponent(v,vR,w,wR): | |
l = v*math.cos(math.radians(vR))+w*math.cos(math.radians(wR)) | |
r = v*math.sin(math.radians(vR))+w*math.sin(math.radians(wR)) | |
return (l,r) |
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
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch(); | |
watch.Start(); | |
// something doing | |
watch.Stop(); | |
Response.Write(watch.Elapsed.ToString()); |
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
[DllImport("kernel32.dll")] | |
static extern int GetCurrentProcessorNumber(); | |
static void Main(string[] args) | |
{ | |
DataTable dt = new DataTable(); | |
dt.Columns.Add("n", typeof(int)); | |
var numbers = Enumerable.Range(0, 1000); | |
Stopwatch sw = new Stopwatch(); | |
sw.Start(); |
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
// 2개 이상의 요소를 List로 만들기 | |
(List(1,2,3),List(4,5,6),List(7,8,9)).zipped.toList // List((1,4,7), (2,5,8), (3,6,9)) | |
(List(1,2,3),List("a","b","c"),List("!","@","#")).zipped.toList // List((1,a,!), (2,b,@), (3,c,#)) | |
// http://stackoverflow.com/questions/1664439/can-i-zip-more-than-two-lists-together-in-scala |
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
Parallel.ForEach(strings, str=> | |
{ | |
DataRow row; | |
lock(table){ | |
row= table.NewRow(); | |
} | |
MyParser.Parse(str, out row); | |
lock(table){ | |
table.Rows.Add(row) |
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
#http://irisclasson.com/2013/10/16/how-do-i-query-a-sql-server-db-using-powershell-and-how-do-i-filter-format-and-output-to-a-file-stupid-question-251-255/ | |
$dataSource = ".\SQLEXPRESS" | |
$user = "user" | |
$pwd = "1234" | |
$database = "Test" | |
$connectionString = "Server=$dataSource;uid=$user; pwd=$pwd;Database=$database;Integrated Security=False;" | |
$query = "SELECT * FROM Person" | |
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
#http://stackoverflow.com/questions/12460950/how-to-pass-credentials-to-the-send-mailmessage-command-for-sending-emails | |
$EmailTo = "[email protected]" | |
$EmailFrom = "[email protected]" | |
$Subject = "Test" | |
$Body = "Test Body" | |
$SMTPServer = "smtp.gmail.com" | |
$filenameAndPath = "C:\CDF.pdf" | |
$SMTPMessage = New-Object System.Net.Mail.MailMessage($EmailFrom,$EmailTo,$Subject,$Body) | |
$attachment = New-Object System.Net.Mail.Attachment($filenameAndPath) |
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
use master; | |
-- database_connection_stats daily, hourly | |
select database_name, cast(end_time as varchar(13)) end_date, | |
SUM(success_count) success_count, SUM(total_failure_count) total_failure_count, SUM(connection_failure_count) connection_failure_count, | |
SUM(terminated_connection_count) terminated_connection_count, SUM(throttled_connection_count) throttled_connection_count | |
from sys.database_connection_stats | |
where database_name = 'DB Name' | |
group by database_name, cast(end_time as varchar(13)) | |
having SUM(total_failure_count) > 10 |
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
use master; | |
-- database_connection_stats | |
select database_name, cast(start_time as varchar(20)), cast(end_time as varchar(20)), | |
success_count, total_failure_count, connection_failure_count, terminated_connection_count, throttled_connection_count | |
from sys.database_connection_stats | |
where database_name = 'DB Name' | |
order by start_time desc | |
NewerOlder