Thoughts From My Life

Advice from someone who does not know everything.

Diamond Multimedia Dock DS3900

I have been running a Microsoft Surface Pro for a few years now. I had recently purchased a large monitor for my desk workspace and wanted to get more peripherals connected to just make my life easier when I was at my desk. Anyhow, I purchased the Diamond Multimedia DS3900 and it has been a really nice experience.

Essentially it provides a variety of ports and connectivity options and the compatibility with my Surface Pro 4 has worked flawlessly.

Continue reading

Scotiabank Passport Visa Infinite Card

I recently switched credit cards. I had been running the BMO AIR MILES World Elite Mastercard for almost 15 years. It worked well for the family and we used the Air Miles for short haul flights in our part of the country. However, we found we wanted some more flexibility with our rewards, similar travel perks, and I had the opportunity to have the fee covered by switching to the Scotiabank Passport Visa Infinite Card.

Essentially it is a very similar card in terms of travel features, but the rewards can be used a variety of ways. In particular I can apply the points like cash towards any purchase on my Visa that is travel related. So essentially I could always find the cheapest flight online though a travel booking site or airline itself, book with my VISA, and then I just transfer over the points to pay for it.

Continue reading

AWS Glue Crawler – Multiple tables are found under location

I have been building and maintaining a data lake in AWS for the past year or so and it has been a learning experience to say the least. Recently I had an issue where a AWS Glue crawler stopped updating a table in the catalog that represented raw syslog data that was being imported in.

The error being shown was:

INFO : Multiple tables are found under location [S3 bucket and path]. Table [table name] is skipped.
Continue reading

Trade Your Way to Financial Freedom – Book Review

I’m reading Trade Your Way to Financial Freedom right now. Excellent book, in my opinion. I had stopped doing any type of trading personally a couple years ago, but I have always found it interesting so decided to get active in it again.

I’m only going to “paper” trade for right now. This is “fake” trading to see how your performance is before ever risking any real money. A way to prove out a system somewhat to see how it would have done if you traded real money (though if you traded real money it would then have some “effect” on the market and may change the outcome).

“Trade Your Way to Financial Freedom” is a great book that isn’t about teaching you any specific system on how to trade, but it is more about how you evaluate the system you are using and yourself. It does briefly cover a variety of strategies and their basis. Not recommending one or the other, but discussing what is commonly used out there and why it may appeal to different individuals.

Personality

Chapter 3 has a great list of questions that you need to answer about yourself and try to gauge your capabilities. Items like:

  • How much time do you have to trade? Do you already have a full time job?
  • What is your risk tolerance? Will you lose sleep at night if you have money tied up in the markets?
  • What skills do you have? Good at math? Good with computers? Analytical?

Analyzing the System

A lot of terminology is used here but explained very clearly. Reward to Risk ratio is commonly used to guage how good your returns are compared to the risk you are taking. Position sizing is touched on. I’m only 3/4’s of the way through the book, but it has been excellent. I recommend the read to anyone thinking of getting into it.

Ford Pass Experience

I recently purchased a used 2017 F-150 XLT 302A SuperCrew truck. I jumped ahead quite a few years from my 2006 truck I was previously driving. One thing I was pleasantly surprised about was the technology Ford has in its vehicles. In particular the Ford Pass application.

Continue reading

2017 F-150 XLT XTR 302A Supercrew Truck

I recently switched trucks. Went from a 2006 Dodge Quad Cab to the 2017 Ford F-150 XLT XTR 302A Supercrew Shortbox. It felt like the right time to make a change as the family was growing and having a proper crew cab for some more space in the interior seemed like the right choice. In this article I will talk about what I was looking for and why I picked this truck and some of the useful tips and tricks there are with the F-150.

Why This Truck?

I was looking for several things specific to what I wanted and I have listed them in an order that is generally more important to less important.

  • Large seating room in the back. The Supercrew F-150 has loads of room a the back and I have 3 children who are into the school age now, so piling into the back with backpacks and child seats takes up a lot of room.
  • Aluminum body. Less opportunity for rust to set in. I had this issue with my last truck. For a few reasons really. I’m not that diligent in washing my vehicle, I live in a climate where road salt is used, and I park in a heated garage where that salt can just eat away with the moisture from melting snow and ice.
  • XLT trim. This is only the 2nd lowest trim package they offer, but it is the highest trim package that still offers 6 seats (see below). It is also a lot more reasonable in price.
  • 6 seats. This is related to the XLT trim, but we occasionally use that additional seat in the front middle. When you don’t need the seat, the back rest folds down for an arm console that has a storage area with flip up lid and there are also 2 cup holders. There are an additional 2 cup holders that can be made available on the floor if you need.
  • 302A package. This is the top luxury package available on the XLT. Lots of little things such as:
    • Heated seats
    • Large console screen
    • Sync3 infotainment screen that supports Apple CarPlay
    • Remote start
    • LED lighting in the truck bed
    • 400W 110V plugin in the front
  • Shortbox. Only a 5.5′ box, but I don’t need that much room (stores occasional work supplies, load of dirt or bark mulch, and hockey gear). This kept the truck around the same length as my Dodge Quad Cab so it fits in the garage the same way.
  • Has the tailgate step as well.
  • White – I find it easier to keep clean and not show scratches compared to black.
  • Better gas mileage than before. I was driving the Dodge Hemi so gas mileage was worse, but I don’t put enough mileage on for it to really matter. I always could have found a 3.6L pentastar in a Dodge too for better mileage.
Continue reading

Creating Data-Driven SSRS Reports in SQL Server Standard Edition

I recently had to resolve this issue. I was running SQL Server Standard Edition and needed to have an SSRS subscription that behaved like a data-driven subscription. Data driven subscriptions are available in Enterprise Edition SQL Server, but not Standard.

What is a Data-Driven Subscription

This is a very useful tool in the Enterprise Edition. A regular subscription is simply a scheduled time when a report will run and can be sent to email addresses or saved to a network share. The individual subscription will only run once and utilizes the same report parameters and recipient information.

A data-driven subscription lets you run a database query that returns no results or a set of results. The report is then run as many times as there are row results in the original database query. This allows you to 2 important things:

  • Not run the report if it does not have any meaningful results. e.g. Don’t send anything out.
  • Run multiple reports at once with customized parameters (who it is sent to, the subject of the email, the parameters used to generate the report, etc). This allows you to scale subscriptions really easily without having to go in and create a subscription for each recipient manually every time.

But I Do Not Have SQL Server Enterprise Edition

This means you do not have the data-driven feature when creating subscriptions. If you are doing a lot of data-driven report subscriptions, it may be worth your while to pay for that license as it will be less development time and more intuitive for users to understand what is happening than what I will describe below.

So we will have to come up with an alternative method to achieve something similar.

The Design

  • Publish an SSRS report if it is not published already.
  • Create a regular subscription using the SSRS interface.
    • Set any parameter values that are constant.
    • You may set the other parameters, but they will be overwritten anyways.
    • Set the schedule to have a stop date in the past, this makes sure it is active, but will not run on its own.
  • Create a stored procedure to run our report.
    • Code example in detail below.
    • Needs to run a query that provides how many times you want the report to run and what the override parameters should be.
    • Will loop over the results to:
      • Override the parameters stored in the table.
      • Execute the report.
      • Wait until the report is finished.
      • Continue.
  • Create a SQL Agent job to run the stored procedure on a schedule.

A Note Waiting For Each Report To Finish

Calling EXEC ReportServer.dbo.AddEvent does not block the script until the report is finished. It merely adds the report to the queue to be processed. If the report takes a while to run, this script may overwrite the parameters and settings being used. So it is important to have a loop monitoring the Events table to make sure the report has completed before continuing.

Stored Procedure Example

This example will determine how many reports need to be created and run each report consecutively by waiting for the report to finish before triggering another one.

--Steps to create data-driven like subscription in SQL Server 2016 Standard Edition:
--1. generate a subscription for a single user and note the subscription_id
--2. create stored procedure to update settings and generate reports
--3. schedule a job to run this procedure

-- Notes to Remember
-- Need to use a Job to run this and schedule.  
-- The subscription_id will be generated at the time the report subscription is created
-- The subscription should be set to active with a stop date in the past so it doesn't run on its own if not desired, but is an active report subscription.

IF EXISTS ( SELECT 1 FROM sysobjects WHERE id = object_id('DataDrivenSSRSSubscription_MyExampleReport) AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
BEGIN
DROP PROCEDURE dbo.DataDrivenSSRSSubscription_MyExampleReport
END
GO

CREATE PROCEDURE [dbo].[DataDrivenSSRSSubscription_MyExampleReport]
@subscription_id varchar(50),
@parameter_id int

AS
BEGIN
    DECLARE @v_email varchar(256), @v_parameter1 varchar(256)
@settings varchar(4096), @params varchar(4096), @qry varchar(1024), @wait smallint
           
    DECLARE db_cursor CURSOR FORWARD_ONLY READ_ONLY FOR  
SELECT
*
FROM Some_Table
WHERE Some_Table.parameter_id=@parameter_id

    OPEN db_cursor  
    FETCH NEXT FROM db_cursor INTO @v_email, @v_parameter1
   
    -- looping through the list
    WHILE @@FETCH_STATUS = 0  
    BEGIN  
        -- wait until report has been cleared from the reporting queue
SELECT @wait = COUNT(*) FROM ReportServer.dbo.Event WHERE EventData=@subscription_id
WHILE @wait > 0
BEGIN
WAITFOR DELAY '00:00:01'
SELECT @wait = COUNT(*) FROM ReportServer.dbo.Event WHERE EventData=@subscription_id
END

        -- update parameters before generating report
SET @settings = '<ParameterValues>
  <ParameterValue><Name>TO</Name><Value>'+@v_email+'</Value></ParameterValue>
</ParameterValues>'

SET @params = '<ParameterValues>
  <ParameterValue><Name>Parameter1</Name><Value>'+@v_parameter1+'</Value></ParameterValue>
</ParameterValues>'
UPDATE ReportServer.dbo.Subscriptions
SET extensionsettings = @settings,
parameters = @params
WHERE subscriptionid = @subscription_id

        IF @@error = 0
        BEGIN
            -- run report and send email
EXEC ReportServer.dbo.AddEvent @EventType='TimedSubscription',
@EventData=@subscription_id
        END                
        FETCH NEXT FROM db_cursor INTO  @v_email, @v_parameter1
    END  
   
    CLOSE db_cursor  
    DEALLOCATE db_cursor

END    

References

These are some really good references that may be easier to understand. One note though, they do not cover “waiting for each report to finish before moving on to the next report.”

Replacing Hood Struts on 2006 Dodge RAM 1500

I had to replace my hood struts the other day.  Essentially I would open the hood on my 2006 Dodge RAM 1500 and there wasn’t enough strength left in the hydraulic hood struts to keep the hood lifted.  I ended up having to take a scrap piece of 2×4 wood and jam it to keep the hood up.

So I looked around the local part places and it seemed to be more money that some I could find on Amazon.  I ended up purchasing the hood shocks/struts at this paid link:

ARANA Qty(2) 4364 Front Hood Shocks/Strut/Front Lift Supports/Gas Springs Compatible with 2002-2010 Dodge Ram 1500/2500/3500/4500/5500 (paid link)

Once they arrive, you can probably figure it out yourself, but if not there are many hood strut videos available on YouTube, but I found this one useful.

Creating a Sun Shield for Garage Door Sensor

I have had issues with my garage door not wanting to close depending on the time of day. I have a a north facing garage door and depending on the time of year and time of day, the sun can shine on the door sensors and interfere with them.

The door sensors are the little sensors that are attached near the bottom of the door rails. They are a pair and point at each other. If anything is between the sensors, then it will block the garage door from closing. On my opener, the door won’t even try to close or if it was closing and something got between the sensors, it would go back up. The light on the garage door unit flashes three time until the issue is resolved.

One of my sensors.
Continue reading
« Older posts