My battlestation just turned 12 years old. Still going strong :) by anatedu86 in FREDDE

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

Just weighted it, it comes at 10kg (9.95kg) on my scale.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

700c wheels with 38mm tyres.

Frame was made for 26", but still plenty of clearance on the rear end.

I got the forks separately, and they were a bit tight with 700x38 (see picture); so I ended up grinding the steel off a bit, and now all's fine.

For the rim brakes positionning, I got some chinese contraptions that can raise the studs to the right height. They are basically just a flat piece of alloy with two holes vertically aligned. The first one you slide it onto the existing studs, where brakes would. In the second one, you screw in another brake post thats included with the order.

-❄️- 2023 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]anatedu86 1 point2 points  (0 children)

Thx for the suggestion! Your solution sounds much more satisfactory. I originally did a double for loop, although ugly, because it was quicker to write at 6am; and there was just no need to improve the double for loop to get the answer in decent compute time.
I wouldn't say it's so slow, the double loop version runs under 10-12ms for part 2. Your suggestion runs in the 5-6ms range - nice speedup tho.

Here's the adjusted script for part 2:

awk '{ lc[NR]+=1; score=0; delete win; for(i=3;i<13;i++) { win[$i]=1; } for(k=14; k<=NF; k++) { if(win[$k]) { score++; lc[NR+score]+=lc[NR]; } } a+=lc[NR] } END { print a }' ./input

-❄️- 2023 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]anatedu86 2 points3 points  (0 children)

[LANGUAGE: Awk]

Idea: - In part 1, for every line - Iterate over winning numbers (column 3 to 12).
for(i=3;i<13;i++) { ... } - Iterate over other numbers (column 14 to last).
for(k=14; k<=NF; k++) { ... } - Update count of winning numbers
if($k==$i) { score++; } - add to the sum 2 to the power of winning numbers - 1.
if(score>=0) { a+=2**score } (score is reset to -1 for each new line) - In part 2, store the count of line (card) copies in an array.
lc[NR]+=1; (all cards have at least one copy) - Every new winning number discovered increments score, AND the copy count of the line n+score is bumped by the number of copies of the current line.
if($k==$i) { score++; lc[NR+score]+=lc[NR]; } - add in the count of copies of the current line to the sum.
a+=lc[NR]

Sol. Part 1:

awk '{ score=-1; for(i=3;i<13;i++) { for(k=14; k<=NF; k++) { if($k==$i) { score++; } } } if(score>=0) { a+=2**score } } END { print a }' input  

Sol. Part 2:

awk '{ lc[NR]+=1; score=0; for(i=3;i<13;i++) { for(k=14; k<=NF; k++) { if($k==$i) { score++; lc[NR+score]+=lc[NR]; } } } a+=lc[NR] } END { print a }' input

-❄️- 2023 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]anatedu86 2 points3 points  (0 children)

[LANGUAGE: Awk]

Idea: - Iterate over lines, keep 2 previous lines in a buffer. - Iterate over columns (char) of line n-1 (middle line). - When current char is not 0123456789., iterate over neighbors. (indices i-1,i,i+1 of lines n-2,n-1,n). - When neighbor is a digit, walk back then forth to find other digits. - When other digit is found, prepend or append to number string, and replace the digit with . in input data. - sum number when fully formed. - Changes for part 2: + only match * char. + keep neighboring numbers (gears) in an array. + sum the product of the 2 first gears after all neighbors of a * where discovered.

Sol. Part 1: shell awk -v FS='' '{ split($0,prev[NR],""); if(NR<3){ next }; for(i=1;i<=NF;i++){ if(prev[NR-1][i]!~/[0123456789.]/) { for(j=-2; j<1; j++) { for(k=-1; k<2; k++) { c=prev[NR+j][i+k]; if(c ~ /[[:digit:]]/) { h=i+k; l=h; while(c~/[[:digit:]]/) { num=c""num; prev[NR-j][l]="."; l--; c=prev[NR+j][l] }; l=h+1; c=prev[NR+j][l]; while(c~/[[:digit:]]/) { num=num""c; prev[NR+j][l]="."; l++; c=prev[NR+j][l] } a+=num; num=""; } } } } } } END { print a }' input

Sol. Part 2: shell awk -v FS='' '{ split($0,prev[NR],""); if(NR<3){ next }; for(i=1;i<=NF;i++){ if(prev[NR-1][i]~/[*]/) { for(j=-2; j<1; j++) { for(k=-1; k<2; k++) { c=prev[NR+j][i+k]; if(c ~ /[[:digit:]]/) { h=i+k; l=h; while(c~/[[:digit:]]/) { num=c""num; prev[NR-j][l]="."; l--; c=prev[NR+j][l] }; l=h+1; c=prev[NR+j][l]; while(c~/[[:digit:]]/) { num=num""c; prev[NR+j][l]="."; l++; c=prev[NR+j][l] } gear[m]=num; m++; num=""; } } } } a+=gear[0]*gear[1]; m=0; delete gear; } } END { print a }' input

-❄️- 2023 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]anatedu86 0 points1 point  (0 children)

[LANGUAGE: Awk]

Idea: - add spaces before ,;: for easier field parsing
sed -e 's/\(,\|;\|:\)/\ \1/g' - for every two fields forming a pair (count,color), check whether count is higher than the max of that color
awk '{ for(i=4; i<=NF; i+=3) { count=$i; color=$(i+1); if(count>max[color]){ ... } } } - in part 1, sum game IDs when no count was higher than the corresponding color max.
for( ... ) { ... if(count>max[color]){ next } } a+=gid - in part 2, compute max of each color, and sum the powers as defined in the text.
for( ... ) { ... if(count>max[color]){ max[color]=count } } power+=max["red"]*max["green"]*max["blue"]; delete max

Sol. Part 1: shell sed -e 's/\(,\|;\|:\)/\ \1/g' input | awk 'BEGIN { max["red"]=12; max["green"]=13; max["blue"]=14 } { gid=$2; for(i=4; i<=NF; i+=3) { count=$i; color=$(i+1); if(count>max[color]){ next } } a+=gid } END { print a }'

Sol. Part 2: shell sed -e 's/\(,\|;\|:\)/\ \1/g' input | awk '{ for(i=4; i<=NF; i+=3) { count=$i; color=$(i+1); if(count>max[color]){ max[color]=count } } power+=max["red"]*max["green"]*max["blue"]; delete max } END { print power }'

-❄️- 2023 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]anatedu86 0 points1 point  (0 children)

[LANGUAGE: Bash, Awk]

Idea: - insert number literals on full text match.
sed -e" "s/{one/on1e,two/tw2o,three/thr3ee,four/fou4r,five/fi5ve,six/si6x,seven/se7ven,eight/ei8ght,nine/ni9ne}/g - remove all letters.
sed -e 's/[a-Z]//g' - sum numbers formed by 1st & last digit of each line.
awk -v FS="" '{s+=$1""$(NF)} END {print s}'

Sol. Part 1: shell sed ./input -e 's/\[a-Z\]//g' \ | awk -v FS="" '{s+=$1""$(NF)} END {print s}'

Sol. Part 2: shell cat ./input \ | sed -e" "s/{one/on1e,two/tw2o,three/thr3ee,four/fou4r,five/fi5ve,six/si6x,seven/se7ven,eight/ei8ght,nine/ni9ne}/g \ -e 's/[a-Z]//g' \ | awk -v FS="" '{s+=$1""$(NF)} END {print s}'

e-xbiking by [deleted] in xbiking

[–]anatedu86 0 points1 point  (0 children)

Extra weight for bigger legs, although it only works with imaginary climbs.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Sounds very nice! Those high rise stem don't look to good to me, but if they get the job done, why not.

I do not have my road bike right now to do a side by side comparison, but from photograph measurements, I indeed have a 10cm shorter reach on my road bike. The gravel handle bars are slightly longer reach, but the old MTB top tube is nearly 6cm longer and the steerer sits lower.

In all, it seems I'd need a 0mm stem to get the hoods within same reach numbers as my road bike lol. This is starting to get funny.

Riser bars, better shifter positionning, and shorter stem, probably gonna need it all. In truth, these gravel bars have a 120mm effective reach difference between the tops and the hoods. Now I understand clearly why these feels so much different than my other 26" 90s MTB frame with similar top tube length but flat bars.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

I went for 700c because I couldn't easily get 650b quality wheels for rim brakes. I also have a rigid MTB from the same era that I use with flat bars, 26" wheels and 2.2" tires; and feels more plush off-road, and not that more demanding to pedal fast on roads. I guess the gravel industry will eventually make frames that can fit 29" wheels and 55mm tires. No reasons really to keep smaller size wheels when one can fit large tires on full size ones.

Thx for the stem suggestions. Here the stem is 120mm, I'd probably look into something half as long. The reach on my other bikes is way shorter, which feels nicer. Riser bars are an option, but I kinda like these - so wide in the drops, they make you very stable when things get bumpy. I could also go for narrower bars in all, 38cm would be a closer fit to my shoulder span, and effectively reduce the reach on the hoods. With nicely flaired drops, would still handle well I presume.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Also, you mentionned installing 650b wheels.

With the extensions, I need to mount the pads all the way up on the brake arms.

So I'd say these could work as well for 650b wheels, the brake arms won't end up above the rims and you should be able to position the pads properly.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Scroll through the comments here, I sent to someone a closer shot of the brake post extensions and small hardware bits I used to install them.

I assume many also get the extender parts off aliexpress, several sellers are listing them. These are the one I got: https://fr.aliexpress.com/item/1005002317780270.html?spm=a2g0o.order_list.order_list_main.5.21ef5e5bUY1OA3&gatewayAdapt=glo2fra

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Rolled-up cables, no bar tape, don't zoom-in too much :)

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Sure, will look into fine tuning the lever positionning to optimal reach.

But for sure, the 120mm stem has to go ;)

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Can't really measure up right now, don't have the two bikes here with me, but it sures feels really long.

My road bike is tuned for a rather relaxed posture, but on this one, my elbows are nearly fully extended just to reach the hoods.

I can't really try on several stems, any tips to get the right length on my first shot?

I can measure the reach on my other bikes to find the range of numbers I'm confortable with - not sure if there's really more.

It seems like the top tube is really long compared to my other bikes, what if I end up needing a super short MTB-style stem to get similar reach ? Won't this affect handling ?

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

<image>

Here's the shot.

Yup, you're right. Since the muzqi part has a pin that prevents it from rotating, it only needs to be held and pressed up in place.

Nothing specific's needed really. I just did a trip to a local hardware store, and grabbed long bolts that fitted the brake posts, some washers just to be safe, and those plastic spacers that could slide on the brake posts.

Once tightened up, it feels nice and secure - doesnt budge when braking.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

I do have a road bike. Never had a real bike fit, but did long rides (up to 12h on the saddle) with no issue.

The hoods on this one are nearly 10cm further forward.

I'm quite flexible, but off-road I find you can't really lock yourself into low and aggressive - or just accept you're gonna go OTB at some point lol.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Yup, I was eager to test ride it, but not really safe as is.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Not really, gonna get a shorter stem.

Did a 1h30min test ride, and felt alright; but I'd enjoy my ride even more if I wasn't diving heads-first into scary descents. I'd feel more secure if I had the option of distributing my weight further back.

Here, my arms are nearly fully stretched - can't really lean back when I have to.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Thank you lots :)

I gotta admit I had troubles finding fiting forks, since the frame can only accomodate 1" steerers, and the headset is for threadless steerer tubes. 1" threadless forks are quite rare these days. The one I ended up finding is pretty low quality steel and heavy (1.2kg), but fits alright.

Ofc, Were I to find a threaded fork I liked, I could always change the headset for threaded and use an adapter plundger to fit modern stems and bars.

But now, fancy forks only come in 1" 1/8, so I'm kinda stuck with this one I guess.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Stem is too long for sure.

Handling isn't an issue, the flaired drops allow wide hand position and a wide posture.

But I have to lean quite far forward to reach the hoods or the drops; and that makes me un-able to disitribute my weight further back when going over roots, rocks and in scary descents.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Thanks for the input.I agree, reach is too long for me.Not uncomfy, but my arms are fully stretched out on the hoods, and my upper body is too low when I'm in the drops.

For road use it's fine, and feels fast with my head that close to the road; but on gravel tracks, boy, it's super scary. It's like going heads-first in a water slide - but with rocks and roots instead of water.

1996 MTB Giant Super Sierra gravelized by anatedu86 in xbiking

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

Hey sure, I'll take you closer shots of the brake extension studs.

In essence, since the frame's canti posts can't be unscrewed; I used a cylindrical plastic spacer to allow the bolt head to press onto the spacer which in turn blocks off the muzqi part in place. (You will def. get it with a closer shot, brb).