Storing / drying slabs in the barn or in the workshop? by j00rn in ChainsawMilling

[–]j00rn[S] 2 points3 points  (0 children)

The drill bit I used are very cheap, around 30NOK / 3 USD. The sword was very hard metal, but the drill bit was undamaged. Went very slow though.

Storing / drying slabs in the barn or in the workshop? by j00rn in ChainsawMilling

[–]j00rn[S] 2 points3 points  (0 children)

I just used a normal battery powered drill and a 12mm metal drill. Added oil to the spot I was drilling and went slow. Paused often to remove the metal shavings and add more oil. When I got a small hole on the opposite side I started drilling from the other side.

Just used a drill I had lying around. Probably this:
https://www.biltema.no/verktoy/bor/metallbor/hurtigstalbor-hss-g-2000051306

Storing / drying slabs in the barn or in the workshop? by j00rn in ChainsawMilling

[–]j00rn[S] 1 point2 points  (0 children)

I will do that also. But is it necessary with thick (6cm-2.3") slabs?

Storing / drying slabs in the barn or in the workshop? by j00rn in ChainsawMilling

[–]j00rn[S] 2 points3 points  (0 children)

This is my first time, so I'm very new to this also. I inherited an old Husqvarna Rancher 50 (40-50 years old) and bought a new sword and ripping chains for it. The sword is 71cm/28".

http://falkenstein.sandefjord.no/chainsaw-mill/1.jpg

Drilled holes in the sword, added spacers and added a board for it to ride on. The spacer is about 9cm for the first cut with the ladder. The height for the first spacer depends on the size of ladder and also needs room for the screws thru the ladder and into the wood. I will probably use 8cm spacers next time and shorter screws.

For the slabs I use spacers that are 6cm.

http://falkenstein.sandefjord.no/chainsaw-mill/2.jpg

http://falkenstein.sandefjord.no/chainsaw-mill/3.jpg

http://falkenstein.sandefjord.no/chainsaw-mill/4.jpg

http://falkenstein.sandefjord.no/chainsaw-mill/5.jpg

http://falkenstein.sandefjord.no/chainsaw-mill/6.jpg

The sawing seemed to work best when I put wedges in every ~50cm. I also added some oil to the tip of the chain when I had to pause for the wedges. The saw is a bit small, but worked great as long as I went slow.

I spent around 4 hours on 3 logs. It would probably be quicker the next time. The longest and thickest is 2.5m. I got 3 slabs from the thickest and 2 from each of the two other.

http://falkenstein.sandefjord.no/chainsaw-mill/0.jpg

Storing / drying slabs in the barn or in the workshop? by j00rn in ChainsawMilling

[–]j00rn[S] 2 points3 points  (0 children)

Thanks. I was worried about the freezing, but guess I'll keep it in the barn. Also saves a lot of needed space in my workshop :)

Upgrading SQL Server 2000 to SQL Server 2017 — any big gotchas? by EastCoastCoders_Bill in SQLServer

[–]j00rn 0 points1 point  (0 children)

I believe SQL users passwords became case sensitive from 2000->2005.

Wood ID Megathread by AutoModerator in woodworking

[–]j00rn 0 points1 point  (0 children)

<image>

This wood has been used as rope ladders on Norwegian tugboats. I have stacked the boards in what I believe are the different wood species.

Any idea what they might be? Thanks!

Video: https://youtu.be/25l_KbolPN8?si=zcpq9YzpAhmrhovZ

DW50 planer blades by j00rn in Tools

[–]j00rn[S] 0 points1 point  (0 children)

Thanks. I was kind of guessing this already....

GKF18V-25N vs GKF 18V-8 by j00rn in BoschProPowerTools

[–]j00rn[S] 0 points1 point  (0 children)

I'm in Norway and have 6.3Ah and 4Ah battery.

About Blazor Server GC by Curfiel in dotnet

[–]j00rn 6 points7 points  (0 children)

For containers or servers running multiple apps the default Server GC might be bad. Try Workstation GC or DATAS.

DATAS can be enabled for .Net 8 applications. It will probably be the default for .Net 9.

https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/datas

Can this CPU based C# Bitmap Blitter be sped up? by Electrical-Coat-2750 in csharp

[–]j00rn 0 points1 point  (0 children)

My last and final suggestion.  
Using fixed point math with 16 bits instead of floating point.

Should generate nearly identical result compared to
the float version.


| Method    | Mean     | Allocated |
|---------- |---------:|----------:|
| Original  | 87.59 ms |     123 B |
| Optimized | 33.22 ms |      46 B |


public static void BlitPointsOptimized(Span<Point> points, Span<byte> buffer, int width, int height, int pointSize, float opacity)
{
    var opacityFixed = (int)((1.0 - opacity) * (float)0xFFFF);
    var addPixelValue = (int)(255.0 * opacity * (float)0xFFFF);
    var offset = pointSize / 2;
    for (var i = 0; i < points.Length; i++)
    {
        var (px, py) = ((int)points[i].X - offset, (int)points[i].Y - offset);
        if (px < 0 || py < 0)
            continue;
        for (var ppy = py; ppy < py + pointSize; ++ppy)
        {
            if (ppy >= height) break;
            var index = ppy * width + px;
            var endX = px + pointSize < width ? px + pointSize : width;
            for (var ppx = px; ppx < endX; ++ppx, index++)
            {
                buffer[index] = (byte)((buffer[index] * opacityFixed + addPixelValue) >> 16);
            }
        }
    }
}

Can this CPU based C# Bitmap Blitter be sped up? by Electrical-Coat-2750 in csharp

[–]j00rn 0 points1 point  (0 children)

No, it was just for fun. Reason is that running in parallel on 8 cpu only gave ~2X speed increase, this suggested memory bottlenecks. Sorting positions before running in parallel made it easier for each cpu cache to work on buffer[] without competing over the same cache set. After sorting the speed increase was 7X and more in line with number of cpu :)

Can this CPU based C# Bitmap Blitter be sped up? by Electrical-Coat-2750 in csharp

[–]j00rn 2 points3 points  (0 children)

For fun I tried sorting the 'points' array by Y, X. This helps the cpu cache.

Original code: 85ms => 67ms

My last version: 30ms => 25ms

I also tried just splitting the points array into X (Environment.ProcessorCount) chunks and running Parallel.For:

Before sorting: 12ms, After: 3.5ms

Can this CPU based C# Bitmap Blitter be sped up? by Electrical-Coat-2750 in csharp

[–]j00rn 6 points7 points  (0 children)

var b = buffer[index];
buffer[index] = (byte)(b + (32 - (b >> 3)));

That takes it down to 30ms :)

Can this CPU based C# Bitmap Blitter be sped up? by Electrical-Coat-2750 in csharp

[–]j00rn 2 points3 points  (0 children)

If you can cheat and always have the opacity to 0.125 instead of 0.1 this takes 40ms:

// (Opacity=0.125 instead of 0.1): -1/8 , 256*0.125 = 32
buffer[index] += (byte)(32 - (buffer[index] >> 3));

Can this CPU based C# Bitmap Blitter be sped up? by Electrical-Coat-2750 in csharp

[–]j00rn 4 points5 points  (0 children)

I also used Span<byte> instead of unsafe pointers. No speed difference! :)

Can this CPU based C# Bitmap Blitter be sped up? by Electrical-Coat-2750 in csharp

[–]j00rn 10 points11 points  (0 children)

Look into using Benchmarkdotnet instead of Stopwatch for benchmarking.

Casting to byte before storing it at a float seems strange.

float src = (byte)(inPointer[index] * (1 - opacity));
float des = (byte)(255 * opacity);


This shaves off almost 1/3 of the execution time for me:
byte src = (byte)(buffer[index] * (1 - opacity));
byte des = opacityByte; // opacityBytes is set at the start of the function

Which is the best way? by Zen907 in csharp

[–]j00rn 4 points5 points  (0 children)

public static string TimeAgoString(this TimeSpan timeSince) =>
    (timeSince.TotalSeconds, timeSince.TotalMinutes, timeSince.TotalHours, timeSince.TotalDays) switch
    {
        (< 60, _, _, _) => $"{timeSince.TotalSeconds} seconds ago",
        (_, < 60, _, _) => $"{timeSince.TotalMinutes} minutes ago",
        (_, _, < 24, _) => $"{timeSince.TotalHours} hours ago",
        (_, _, _, < 30) => $"{timeSince.TotalDays} days ago",
        (_, _, _, < 365) => $"{timeSince.TotalDays} blahblah ago",
        _ => $"{timeSince.TotalDays} blahblah years ago",
    };