If you’re using Amazon Web Services RDS for SQL Server (btw, it works great) and want to use Memory-Optimized Objects, it’s easy to alter your DB to allow this. Below is a little T-SQL. The key to this is the directory “D:\rdsdbdata\“, the default where RDS is storing your data.
-- Add new file group
ALTER DATABASE [sampleDB] ADD FILEGROUP [MOD_FG] CONTAINS MEMORY_OPTIMIZED_DATA
-- Add the new file
ALTER DATABASE [sampleDB] ADD FILE ( NAME = N'Mem_Opt_Data', FILENAME = N'D:\rdsdbdata\DATA\Mem_Opt_Data.ndf') TO FILEGROUP [MOD_FG]
-- Set the MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT to On
ALTER DATABASE [sampleDB] SET MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT = ON
Things that you’ll need to swap out w/ your own info is “sampleDB” and “MOD_FG”.
Now your DB is all ready for some Memory-Optimized Objects.
Want to create a table that’s memory optimized, just use this:
-- Sample table create
CREATE TABLE testMOD (
SomeId INT IDENTITY(1,1)
,FirstName VARCHAR(30) NOT NULL
,LastName VARCHAR(30) NOT NULL
CONSTRAINT [PK_SomeID] PRIMARY KEY NONCLUSTERED HASH (SomeId) WITH (BUCKET_COUNT = 131072))
WITH(MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA)
These Memory-Optimized Objects do offer a significant speed improvement but don’t go crazy w/ them.
If you’re like me, you’ve probably stored latitude and longitude data in decimal columns for a long time. I know SQL Server has a geography type as of a few years ago, but I never really played with it much. Anyway, I finally tried it, and so far it’s great – and no individual decimal columns – and I can do calculations right in SQL.
To get started, use the geography type in a table like this?:
CREATE TABLE [dbo].[MattressStoreLocations](
Continue reading “Using SQL Server for Latitude & Longitude Calculations”
[Mattress Store Name] [nvarchar](50) NULL,
[Location] [geography] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
If you have a WordPress install that is giving you this error:
Fatal error: Maximum execution time of 30 seconds exceeded in ...\wp-db.php on line ####
…It’s because PHP is timing out. The default timeout in PHP is 30 seconds, see here for details.
The method I use for this is simple:
- Open your wp-config.php file in an editor (notepad, etc).
- Add this line to the top: set_time_limit(300);
The “300” can be any about of time (it’s seconds) you’d like.
The top of your file should like something like this:
PS: You should only need to change this if you’re working on some kind of import /export or a one time process. If your blog requires this to run normally, their might be bad code or a server issue.
Alright, so if you’re reading this, you’ve probably read some popular articles by some others (maybe major news sources) and didn’t get far. Getting Fortnite crossplay between PC & Xbox wasn’t that straightforward (at least for me), but in the end, works great. I’m trying not to do what the other articles did, and provide long, unhelpful paragraphs, so let’s get right to it. Below is what worked for me:
- I’m assuming you’re already playing Fortnite on the Xbox. You need to link your Xbox account to an Epic Games account. Do this by opening the browser (Edge) on the Xbox. Visit https://www.epicgames.com/fortnite. In the top-right, click the person icon, click Xbox.
- After clicking the Xbox button on the people menu, create a new account w/ an email address & password. (I couldn’t find an easy way to link an existing Epic account, so I just created a new one). Now you have an Epic games account linked to an Xbox live account.
- On a PC (or Mac) download the Epic Games Launcher. You can use the same PC that has a different account playing Fortnite already.
- On the PC in Epic games login to the account used to play on PC and send a friend request to the username of the Xbox user.
- Again on the PC, login into Epic games (you’ll need to logout of the PC user) and login as the Xbox account you created in step 2.
- Since you’re logged into the Xbox account (on PC) you can accept the friend request that was sent in step 4.
- You can now logout on the PC and login to a PC playing account (if you have one).
- On the Xbox, start a new party, on PC, your friends (that you accepted in step 6) can choose to play with you.
- And now win.
- Note: the first time you play w/ someone on PC via Xbox, you’ll be asked to confirm that crossplay is okay. Make sure you accept this.
Hope this helps someone out there.
Crossplay is pretty seamless, voice chat works – and now you’ve got more folks to help you win!
A few years ago I showed how to use Microsoft’s Log Parser tool to take IIS log files and import into a SQL database.
From Microsoft: Log parser is a powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory®. You tell Log Parser what information you need and how you want it processed. The results of your query can be custom-formatted in text based output, or they can be persisted to more specialty targets like SQL, SYSLOG, or a chart.
In short, using something like this to take IIS logs and dump into a new SQL table:
C:\Program Files (x86)\Log Parser 2.2>logparser “SELECT * INTO iisLogs FROM c:\temp\logs\*.log ” -i:iisw3c -o:SQL -server:localhost -database:webLogs -username:sa -password:yourpass -createTable: ON
But, if you’re importing tons of records, it might seem to take a while. BUT: you can use the option “transactionRowCount” to gain some performance. The transactionRowCount option determines how many rows are included in each transaction. By default, transactionRowCount is 1, so after every row, the transaction is committed. If you set it to “-1” it will include everything in 1 large transaction.
Below a did a few tests. My test included 36,000,000 rows. Continue reading “Increase IIS Logs to SQL Log Parser Import Performance w/ transactionRowCount”
Creating a simple, serverless app w/ AWS Lambda is fairly easy, but some documentation out there is outdated or using the preview toolkit. Below are some steps that show how to do this today, in a few steps. I’m using Visual Studio 2017. I’m also going to assume you already have your AWS credentials on your machine, if not, that’s a different topic.
- Install the AWS Toolkit for Visual Studio 2017 for Visual Studio. This is required to give you the project templates.
- Open Visual Studio and start a new project, choose “AWS Lambda Project” and give your project a name (I picked “awsLambdaTest”)
- At the Blueprint choice, choose “empty” then click “finish”.
- Your project will now create after a few seconds and should look like this:
- You can edit your code (in Function.cs)
- If you don’t edit anything and publish
- Now give your function a name and choose “next”:
- Now choose a role, the lambda_exec role is fine, then click “upload”.
- By default, the Lambda Function view will appear – this allows you to test your function. If you enter a string in the box under “sample input” and press “invoke”, you’ll see your function response.
If you use the html5 video element, you probably want to also include webm & ogv videos to help make your video more accessible on browsers. (I won’t get into using the element, but it’s fairly simple.) What I do want to share is an easy way to take our source video (maybe .mp4 or .mov) and convert it to .webm and .ogv. This solution uses the freely available FFMPEG – it’s been around forever, and many of the pay software “utilities” you could buy just use it in the background. Let’s get to it. Continue reading “Convert MP4 Video to WEBM & OGV (OGG) using FFMPEG”