Zett headed to the movies with the work girls tonight, so I’ve spent the whole night looking at a special effect for Ride the Fury.
This is just a proof of concept but I’m pretty stoked I got it working to this stage, basically I’ve taken the bump map effect they use in modern water rendering and applied it to the UV co-ordinates of my background texture, nothing too special there, the difference with my implementation is that I’m generating the ripple texture in real time.
The idea is to have to back ground ripple and react to the players power moves!
I’ve still got to generate some better source offset textures but it proves that it works.
I’d better go grab some dinner, I’ve been so carried away with this that I’ve forgotten to eat… more updates soon.
- First install Outlook 2000 on the server.
- Login as the user that you SQL service starts as (SQLService in our case).
- Run Outlook making sure you choose the Corporate or Workgroup option.
- Then Select the Pop3 account type.
- Setup the pop3 account with some valid credentials (in our case we’re only sending so in doesn’t matter if you use your own just make sure you tick the “leave messages on server†check box)
- Ok the account setup and you should see your unread emails flood in, test the sending with a test email to someone you like.
- Exit outlook and fire up enterprise manager and bring up your SQL Servers properties.
- On the “Server Settings†tab there in an “SQL Mail†section, hit the “Change†button and select the MAPI profile you just created in Outlook ( there should only be the one in there).
- Now open up the properties of your “SQL Server Agent†and check that the “Mail session†“Mail Profile†is set to the same MAPI profile you just set in the SQL Server properties and hit the test button to make sure it can send.
After the Agent service restarts itself you’re right to setup email notifications for Alerts and Agent Jobs.
This is a simple one that didn’t take all that long to find a solution for but I thought it was worth putting up here anyhow seeing it’s not all that obvious.
To convert most other data types (Strings, Ints, Chars etc) you use the Convert. system function eg.
char myChar = Convert.ToChar(myString);
char myInt = Convert.ToInt(myString);
But GUIDs are treated a little differently, you actually create a new instance seeded with the string value eg.
Guid myGuid = new Guid(myString);
This is one I’ve had to use a few times and keep forgetting so I’ll stick it here for next time. Stick this into the visibility property on a textbox in Reporting Services to show/hide in when there is a value in the vairable you are displaying.
=not Fields!SharePercent.Value is System.DBNull.Value
Here’s a handy little query I came up with to list your scheduled jobs, what time they’re going to run next and their average duration on your MSSQL box. I’ve been chasing performance on my sever for months, tweaking things here and there, I found that windows was having massive page fault spikes every 5 minutes. Further investigation indicated that multiple (up to 10) scheduled tasks within SQL Server were fireing at the same time.
I used the query below to randomise the schedules (adding a random number of seconds to the start time) spreading the load more evenly over time.
A small gain but a nice one to finally nut out.
SELECT
j.name,
endTime = CONVERT
(
DATETIME,
RTRIM(next_run_date)
)
+
(
next_run_time * 9
+ next_run_time % 10000 * 6
+ next_run_time % 100 * 10
) / 216e4,
(
select avg(run_duration)
from sysjobhistory jh
where j.job_id = jh.job_id and run_duration is not null
)
FROM
msdb..sysjobschedules j
WHERE
next_run_date <> 0
and (name <> 'Schedule_1' and name <> 'Schedule 1')
order by
CONVERT
(
DATETIME,
RTRIM(next_run_date)
)
+
(
next_run_time * 9
+ next_run_time % 10000 * 6
+ next_run_time % 100 * 10
) / 216e4
This is one that has come in hand a few times, if you’ve accidentaly filled up you data drive on your SQL server and don’t have the space left to clear out the log file and reclaim the space just run the following command then shrink the DB.
BACKUP LOG "MyDatabaseName" WITH TRUNCATE_ONLY
Came across this one today, I’m sure I’ve hit it before but of course I didn’t remember. The worst part of the problem is that the error message is not very descriptive (Unresolved external refrence) but the solution is nice and easy.
------------------
foo.h:
------------------
#ifdef __cplusplus
extern "C" {
#endif
int foo( int );
#ifdef __cplusplus
}
#endif
------------------
foo.cpp
------------------
#include "foo.h"
int foo( int i ) { ... }
------------------
main.c
------------------
#include "foo.h"
int main() { foo(1); }
Welcome all, I’ve setup this blog to separate the code and XNA articles from my regular blog.
The hope is to focus the two blogs more, freeing me up to go as silly as I want on my regular blog and as nerdy and techy as I want in the other.
Should be a win for everyone… first up I’m going to copy over the few good tips from the old BrownBot code lib, enjoy!