Know Thy Complexities
Interesting summary of complexity on common algorithms in computer science: http://www.bigocheatsheet.com/
Interesting summary of complexity on common algorithms in computer science: http://www.bigocheatsheet.com/
Open a terminal and execute the following commands:
$ defaults write com.apple.Finder AppleShowAllFiles YES $ killall -HUP Finder
Reversing this process can be done by:
$ defaults write com.apple.Finder AppleShowAllFiles NO $ killall -HUP Finder
Spotted @ #019 Group Therapy Radio with Above & Beyond
Related to this blogpost, I wanted to log all queries executed on a Microsoft SQL Server database.
This can easily be done by the SQL Server Profiler, which gets shipped with the SQL Studio Express application of Microsoft.
However, after navigating through my webapplication (which uses JPA (Hibernate)), I could only see a bunch of the following SQL statements:
EXEC sp_execute 6, 8 EXEC sp_execute 7, 8 EXEC sp_execute 4, 8
Hibernate is running a prepared query. To get the actual SQL query, you can run the following query (you will still have to look for the query, but, it's getting you a lot closer then sp_execute :-)):
SELECT SQLTEXT.text, STATS.last_execution_time FROM sys.dm_exec_query_stats STATS CROSS APPLY sys.dm_exec_sql_text(STATS.sql_handle) AS SQLTEXT WHERE STATS.last_execution_time > GETDATE()-1 ORDER BY STATS.last_execution_time DESC
By tweaking the WHERE clause, you can easily retrieve the quer(y)(ies) you are looking for :-)!
Spotted @ #017 Group Therapy Radio with Above & Beyond
Latest weeks, I've been switching a lot between Eclipse and Visual Studio .NET. I'm always forgetting the shortcut to comment blocks of code:
Comment/uncomment: ⌘ + /
Comment: Ctrl + K, Ctrl + C
Uncomment: Ctrl + K, Ctrl + U
Yesterday, I came to the conclusion all my cron entries were removed (for the second time!) in my /etc/crontab file on my Synology DS213 NAS server.
I noticed the cron entries were removed after a system reboot. I figured out Synology has some problems with cron entries having columns separated with spaces (not tabs). All entries including spaces are removed on system startup.
Updating my crontab by putting tabs (\t) between the columns, fixed the problem.
SELECT STR_TO_DATE('20/03/2013', '%d/%m/%Y') FROM dual;
SELECT CONVERT(datetime, '20/03/2013', 103);
List of date & time style codes: http://msdn.microsoft.com/en-us/library/ms187928.aspx
On my Windows laptop, I'm using Outlook 2010 to fetch my Gmail account (IMAP). Gmail has its own spam folder + spam filter, and I configured Outlook to use the Gmail spam filter.
Nevertheless, Outlook always creates a second spam folder (in Dutch called: Ongewenste e-mail), which makes it complicated on other clients (or webclient) to know which one is the correct label.
I just learned you can hide labels in your webclient and/or IMAP clients by logging in into Gmail webaccount > Settings > Labels . I also marked some other labels to be hidden as well.
sqlcmd -S [server instance name] -d [database name] -i [filename you want to import]