Ramblings of a nerd: software development, music, linguistics, poetry, religion, and I'm not sure what else will pop up.
Wednesday, December 30, 2009
Resolved: "failed to build gem native extension" on Windows
Monday, November 30, 2009
Resolved: SQL Server Agent job notifications fail with "failed to notify '(operator name)'"
- Windows Server 2003 (5.2, build 3790)
- SQL Server 2005 (9.00.4053.00)
Symptoms:
- A job in SQL Server Agent is set to have an email notification sent to an operator when it fails, but the notifications don't send.
- Running Management > Database Mail > Send Test E-Mail does work, however.
- In the job history, each failed attempt is followed by "NOTE: Failed to notify '(operator name)' via email.".
- In the SQL Agent error log, there is a message saying, "Unable to start mail session... profile name is not valid..."
Solution:
- Go to SQL Server Agent > Properties > Alert System.
- If "Enable mail profile" is unchecked, check it and restart the SQL Server Agent.
- If is checked and still doesn't work, UNcheck it, restart the SQL Server Agent, then go back in and check it again, and then restart SSA again (this fixed my issue).
Commentary:
I found a lot of posts about this issue. Most revolved around the fact that by default the SQL Server Agent comes with the mail profile disabled. But it took me a few hours to resolve this, so it sounded like a good one to post here for others.
There is also a Microsoft HotFix for certain related problems, but if you've been keeping your system up-to-date, you probably already have installed it in a cumulative update.
You may also want to check out this: http://msdn.microsoft.com/en-us/library/ms175984.aspx
Thursday, November 5, 2009
SQL dyanmic queries run in separate connections
Here's a few examples in SQL Management Studio to demonstrate what's going on.
Query:
--in a dynamic query, create a local temp table and select from it
PRINT 'Example A:'
EXEC('CREATE TABLE #ConnectionTempTable ( [Foo] INT, [Bar] BIT, [Junk] NVARCHAR(100) ) SELECT * FROM #ConnectionTempTable')
PRINT '------'
--in a dynamic query, create a global temp table; then in the static query, drop it
PRINT 'Example B:'
EXEC('CREATE TABLE ##GlobalTempTable ( [Foo] INT, [Bar] BIT, [Junk] NVARCHAR(100) )')
DROP TABLE ##GlobalTempTable
PRINT '------'
--in a dynamic query, drop the local temp table from Example A (FAILS!)
PRINT 'Example C:'
EXEC('DROP TABLE #ConnectionTempTable')
PRINT '------'
--in a dynamic query, recreate the temp table from Example A (FAILS!)
PRINT 'Example D:'
EXEC('CREATE TABLE #ConnectionTempTable ( [Foo] INT, [Bar] BIT, [Junk] NVARCHAR(100) )')
SELECT * FROM #ConnectionTempTable
Results:
Example A:
(0 row(s) affected)
------
Example B:
------
Example C:
Msg 3701, Level 11, State 5, Line 1
Cannot drop the table '#ConnectionTempTable', because it does not exist or you do not have permission.
------
Example D:
Msg 208, Level 16, State 0, Line 20
Invalid object name '#ConnectionTempTable'.
Thursday, October 8, 2009
Resolved: iPhone OS 3.1 download error 3259: "network timed out"
I have:
- iPod Touch 16GB
- iTunes 9.0.1.8
- Windows XP SP3
- ESET Antivirus 3.0.672.0
Problem:
After paying the $5 to upgrade from iPhone OS 2.1.1 to 3.1.1, the software download in iTunes stopped after completing and eventually displayed an error message that the "network timed out". On the downloads page, it showed error code 3259.
Resolution:
My antivirus software (ESET) was stealing the file from iTunes after the download completed, scanning it, and not returning it in a timely manner, since the file was rather large. I temporarily disabled the antivirus software, restarted the download, and then everything worked fine. (Don't forget to reenable your antivirus when you're done!)
I hope this can help save you a headache!
Thursday, September 10, 2009
Beware of Courier font in Firefox
If you want a nice fixed-width font that does work well in Firefox, use Courier New instead.
Tuesday, September 8, 2009
NoMethodError, undefined method `call' for MyController:Class
NoMethodError in MyController#my_action
undefined method `call' for ClientScriptsController:Class
...then you might have forgotten to make your controller inherit (extend) the ApplicationController class, like I did. The big clue is that the undefined method is in the class, not the instance.
Controllers should be set up like this:
class MyController < ApplicationController
def my_action
#do something...
end
end
Friday, August 28, 2009
booleans in ruby
Here's an interesting tidbit about the Ruby language: it has no native boolean type. The true and false keywords are actually instantiations of the TrueClass and FalseClass types. In ruby, things evaluates as a boolean like so:
- false and nil are false
- everything else is true
Tests run using Ruby 1.8.6.
Check out this Wikipedia article for more details about booleans in Ruby.
Wednesday, July 8, 2009
Oracle Installation error: ORA-12560
OS: Windows XP, SP3
Installing: Oracle 10g Standard Edition
Steps:
- Download the zipped 10gR2 installer package from Oracle's website (~625MB).
- Extract the zip file somewhere on my hard drive.
- Run the setup file in the extracted folder.
- Follow the wizard, selecting not to create the sample database at the beginning. Use the defaults for everything else. Yay, now we've got an empty Oracle installation.
- Now to create a database. Click Start > All Programs > Oracle - OraDb10g_home1 > Configuration and Migration Tools > Database Configuration Assistant.
- Follow the wizard, keeping the defaults (except I changed the character encoding to Unicode).
CONFIG: ORA-12560: TNS:protocol adapter error
oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-12560: TNS:protocol adapter error
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1467)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.connect(SQLEngine.java:814)
at oracle.sysman.emcp.util.GeneralUtil.initSQLEngine(GeneralUtil.java:363)
at oracle.sysman.emcp.DatabaseChecks.validateUserCredentials(DatabaseChecks.java:986)
at oracle.sysman.emcp.ParamsManager.validatePassword(ParamsManager.java:2694)
at oracle.sysman.emcp.EMDBPreConfig.checkConfigParams(EMDBPreConfig.java:1268)
at oracle.sysman.emcp.EMDBPreConfig.checkParameters(EMDBPreConfig.java:1060)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:174)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:160)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:141)
at oracle.sysman.assistants.util.em.EMConfiguration.run(EMConfiguration.java:430)
at java.lang.Thread.run(Thread.java:534)
Jul 8, 2009 9:50:33 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Invalid username/password.
Refer to the log file at C:\oracle\product\10.2.0\db_1\cfgtoollogs\dbca\orcl\emConfig.log for more details.
Jul 8, 2009 9:50:33 AM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Invalid username/password.
at oracle.sysman.emcp.EMDBPreConfig.checkConfigParams(EMDBPreConfig.java:1272)
at oracle.sysman.emcp.EMDBPreConfig.checkParameters(EMDBPreConfig.java:1060)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:174)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:160)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:141)
at oracle.sysman.assistants.util.em.EMConfiguration.run(EMConfiguration.java:430)
at java.lang.Thread.run(Thread.java:534)
The solution:
Uninstall the half-created database I just made, restart my machine, and then recreate the database. Now it works. *smacks forehead*
Monday, July 6, 2009
Haikus on learnjapanesepod.com
A couple of haikus that I wrote in the their forums were read "on the air" on their podcast last Friday... I'm excited :) . Btw, the name I used was "jensengo".
Here's the link for that episode: http://learnjapanesepod.com/fun-friday-for-3rd-july-2009/.
Monday, March 23, 2009
asp.net crashes
1) Cause: Incorrect file-system-level permissions. Solution: set the Windows permissions of your web site source code top-level folder to at least allow "Read & Execute", "List Folder Contents", and "Read" access for the following user accounts, where "MyMachineName" is your local machine's name.
- MyMachineName\IUSR_MyMachineName
- MyMachineName\IWAM_MyMachineName
- MyMachineName\ASPNET
2) Cause: Infinite recursion (stack overflow). Solution: fix your code so a method can't call itself infinity times.
3) Cause: Infinite memory allocation (heap overflow). Solution: something in your code is infinitely requesting memory. Check for a spot in your code where a new command is used in an infinite loop or some other situation where it's repeatedly instantiating objects.
Monday, March 16, 2009
Noonday seashore: a Haiku
昼の海
うるさい鴎
そよ風と
A noon-day seashore
Annoying, noisy seagull
With a gentle breeze
I think it has the greatest effect when you read on line at a time, slowly. I had in mind the shore of Lake Michigan in Saint Joseph, MI, where I grew up. There are lots of happy memories on those beaches. The seagulls can be really annoying, too :) . But please feel free to imagine any shore you like. I think Japanese can probably relate to this, since they are surrounded by ocean.
I used incomplete sentences, both in Japanese and English. I'm not exactly sure how it sounds to a native Japanese (please inform me!). So anyways, that's that. Please let me know what you think of either version! I'd appreciate critiques!
Tuesday, February 10, 2009
application unavailable
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
The short answer is: probably stack overflow. Check your methods and properties for infinite recursion.
Long answer:
This error is not usually very helpful, and the Event Log doesn't show anything interesting except a note that basically says something really bad happened to aspnet_wp.exe, and it exited unexpectedly. Sometimes you can't seem to pause execution in debug mode, too.
So yeah, watch out for infinite recursion. I suppose a similar problem would happen if you overflowed the heap instead.
Friday, January 30, 2009
Moving files in TortoiseSVN
I was having a little trouble moving some files that were under SVN control, but I was able to quickly find some help on this website: http://vidmar.net/weblog/archive/2007/12/11/subversion-and-tortoisesvn-tips-and-tricks.aspx about doing it.
Don't move files within your repository with Windows Explorer. Instead use the TortoiseSVN > Rename option from the context menu when you right-click a file. Then just use backslashes to specify the directory you want your file (or folder) moved to.
...also, you can use Windows Explorer to move SVN files if you RIGHT-click and drag, not left click. When you release the mouse button, a context menu will show up, where you can choose to "SVN Move to here". That works.