UselessOptions

u/UselessOptions


r/PHPhelp•

I started using PHP initially because of the amount of free hosting sites that are out there. Since it's shared hosting, the specs might not be too impressive, but the prices sure are. I was wondering if any other languages have similar hosting solutions.

115



r/bih•

I'd like to visit Neum by bus and stay in a seaside hotel/apartment. I have luggage so I'd like to avoid walking. Are there any taxis or other ways to get from the bus station to the sea?

33

r/openttd•

https://github.com/wooky/ottd-prayer

ottd-prayer is a user-configurable AFK bot for OpenTTD. Features of this bot include:

  • Connecting to servers with direct IPs or invite codes
  • Setting a custom player name to the bot
  • Joining a company by name or ID
  • Joining a password-protected game or company
  • Toggleable automatic spectator mode when nobody is playing
  • Auto-reconnecting
  • ...and much more!

Come try it out!

52


r/Zig•

Consider this (not great) code:

const std = @import("std");

const Foo = struct {
    myself: *Foo = undefined,
    bar: []const u8,

    fn init(bar: []const u8) Foo {
        var foo = Foo { .bar = bar };
        foo.myself = &foo; // (1)
        return foo;
    }

    fn hello(self: *const Foo) void {
        std.debug.warn("Hello {}\n", .{self.myself.bar});
    }
};

fn clobber() void {
    var i: u64 = 0x70000000;
}

pub fn main() !void {
    var foo = Foo.init("World"); // (2)
    // foo.myself = &foo; // (3)
    clobber();
    foo.hello();
}

When run, it just prints He

610

r/Zig•

I would like to use Zig to write a program for some microcontrollers that are not supported by llvm, but instead have their own gcc compilers (e.g. 8-bit PICs, esp32). It should be possible if the Zig compiler could somehow interact with gcc, or perhaps just emit C code that can be compiled with gcc. I'm wondering if anyone had any luck getting that to work.

209


r/Kotlin•

Consider this piece of code:

class Node(children: List<Node>) {
    val sum = children.sumBy { it.sum }
}

Because it can't tell what type sum is supposed to be, rather than produce a meaningful error, it breaks IDEs and compilers:

  • IntelliJ complains with org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException: Kotlin resolution encountered a problem while analyzing KtCallExpression
  • Try Kotlin throws error 500s at you
  • If you manage to compile it, you'll get a org.jetbrains.kotlin.util.ReenteringLazyValueComputationException

However, if you slightly change the code and make it

class Node(children: List<Node>) {
    val sum: Int = 
167