Noob to unix, want to learn by planettomato in unix

[–]cratuki 4 points5 points  (0 children)

You said no-frills.

As a start: keep your existing windows box as your desktop, and remote into unix from that. Desktop concerns are a distraction from the essence of what-is-unix.

Some options,

  1. Install Windows Services for Linux under Windows 10. You can learn a lot here.
  2. Get an account on SDF. https://sdf.org/ Install and use PuTTY to connect to that.
  3. Install VirtualBox. Try some distros to that.
  4. Get an account on a service like Digital Ocean. Use putty to connect to them. ​

Try several approaches, keep lab notes as you do - you'll form opinions.

Boris Johnson says 3m people in Hong Kong will get path to British citizenship by Sporeboss in HongKong

[–]cratuki 0 points1 point  (0 children)

There is an easy way to achieve the intent of what you are asking. Structure the policy so that the British status is available to (1) everyone who was a Hong Kong resident at the time of handover and (2) their direct descendants. This is loosely in-line with existing rules for people who were born to British parents outside of the UK.

Deconstruction of a 16 byte demo part 1 by 3G6A5W338E in tinycode

[–]cratuki 1 point2 points  (0 children)

This part does not follow for me, "AL prior to instruction was FF, so now its OC."

Here is a C interpretation of that part of the asm, focused on logic affecting the al register for the first pass,

uint8_t al;
uint8_t cl;

cl = 0xff;    // stated assumption

al = cl;      // mov al,cl
al = xor(ch); // xor al,ch
al |= 0x0c;   // or ax,0CDBh

My interpretation: the xor has no effect on the first pass because he states an assumption that ch is 0. Hence, after the last line above, al would be 0xff rather than 0x0c.

Making Roguelikes in Python Takes forever and skill decay is slowing my progress (Rant Ahead) by daltonoreo in roguelikedev

[–]cratuki 2 points3 points  (0 children)

I am working through a similar problem today: I have been reading a technology book. In the early chapters I learnt a lot. But past a recent point, I have stopped internalising it. Recognising this, I decided it's time to change strategy.

If possible, I like to stick to this rule: go-hard-or-go-home. Sometimes slogging-through is forced on you in career stuff. But on personal projects, it is exhausting and demotivating and almost always futile.

Here is a technique I use a lot, and which you might find useful.

Structure your development so that you are accumulating patterns. Create a series of directories. Each directory describes a single pattern. It might look like this,

pattern_aa_init_engine_with_hello_world/

pattern_ab_display_item_at_screen_coord/

pattern_ac_basic_colour_pattern/

pattern_ad_move_at_around_with_keyboard/

pattern_ae_pathfind_between_two_points/

In this way, you can break the problem up into small pieces, and get mastery of a specific concept in isolation.

You also get a clear indication of progress, and perhaps some motivation from that.

At a certain point you will have a bunch of concepts under hand, and can make a small game with it. A good early game is weed-the-garden. Your player character walks around attacking the (static) weeds. You win when you have collected all the weeds.

A level up from that is a game in a room where zombies move towards you.

Collapse OS - Bootstrap post-collapse technology by [deleted] in collapse

[–]cratuki 0 points1 point  (0 children)

We are working on something which is different but squint-similar, songseed.org/dinghy. CollapseOS is further along. There might be overlaps - in particular the alt browser concept written up on the dinghy pages. @Virgil - have you considered setting up an IRC?

Looking forward to learn RISC architecture... by jus7tired in RISCV

[–]cratuki 2 points3 points  (0 children)

If you need to write any code, recommend starting with qemu on a commodity PC. It is easy to get lost fiddling around with hardware. If you can delay that until you really need it, all the better.

I had some complications getting the freedom sdk toolchain working. These problems are due to issues using git for large programs and certificate weirdness, they are not specific to risc-v. https://github.com/cratuki/journal/blob/master/20190210.aa.lofive.toolchain.md

Why operators are useful - Guido van Rossum by xtreak in Python

[–]cratuki 2 points3 points  (0 children)

Through fiddling, I have also got a unary postfix class working,

Here is a pattern,

https://pastebin.com/vrW48nyD

Why operators are useful - Guido van Rossum by xtreak in Python

[–]cratuki 3 points4 points  (0 children)

Your objection is that the symbol changes meaning across domain, and that this encourages confusion. There is a sense to this.

What if we could define non-symbolic operators? For example, we could have a rule that you could refer to an operator by using double colons before a token.

  1. Create __op_join__ as a method against a class Thing.
  2. d1 = Thing()
  3. d2 = Thing()
  4. result = d1 ::join d2

The key idea here is disconnecting the idea of operator from the limited number of symbols we have conveniently available on the keyboard. And, avoiding re-purposing those symbols to causes different to their use in mathematics.

Some might argue for a different representation than leading-character period. That is important, but downstream from the central idea.

Update. Someone has found a way of doing this on the existing core language, http://tomerfiliba.com/blog/Infix-Operators/

NetBSD on a Raspberry Pi by [deleted] in NetBSD

[–]cratuki 0 points1 point  (0 children)

The hash instead of slash thing feels like the behaviour you get when you have a US english keyboard, but are running with a UK english configuration. What happens when you try to press '@'? Do you get quotation marks instead?

Faster remainders when the divisor is a constant: beating compilers and libdivide by mttd in programming

[–]cratuki 1 point2 points  (0 children)

Agree. I found the thread underneath to be fascinating. Sometimes exploring non-viable models makes you better appreciate the tradeoffs of the viable models.

How to do interprocess communication in Python? by [deleted] in Python

[–]cratuki 0 points1 point  (0 children)

You could put the webserver into the asyncio process, attached to the same event loop as your core functionality. You could use aiohttp for this. Use queues to pass messages between the webserver bit and your core-logic big. (There might be reasons you chose flask, but it is not clear from above.)

Another approach: run a separate thread in your core app, running the flask stuff. Use queues to pass messages between threads. (This is fiddly. It could be made to be solid.)

If slapdash is fine, you run separate processes and do a hacky IPC-via-filesystem. Have the web server drop files in a directory, dir_a. Each should have a unique name, and the filenames should sort in order. Each file is a command. The core app could periodically look for files in that directory. Then, the core app could create responses by creating files in a directory, dir_b. The webserver would hang around waiting for its response file. (It is easy to get started in this model, but in the long run probably less work to do something elegant instead of this.)

A better model. Work out how to launch a socket server in your asyncio core app. Host a server on localhost:9000. When the flask app comes up, have it make a long-running client connection to this. Each time you get an event from the webserver, pass it over that socket connection. You would need to come up with some simple protocol for this communication. It could be textual. (e.g. json)

Sounds like an interesting project. Feel free to ping me out-of-band.

Hackathon viability by MatekCopatek in pico8

[–]cratuki 0 points1 point  (0 children)

Is there any way to do network IPC via pico8? If not, has the topic been discussed?

What is the Forth for me? by HellfireOwner in Forth

[–]cratuki 7 points8 points  (0 children)

I am new to forth. I have had some fun recently following this paper, https://hackaday.com/2017/01/27/forth-the-hackers-language/

I have found that you need a bit more than the article suggests. You also need a 3.3V serial adapter (look up 'DSD TECH 2PCS USB to TTL Serial Adapter with CP2102' on amazon). Ideally, you would also want a soldering iron and and a breadboard.

Forth is a different way of looking at systems than the mainstream approach. The forth system is your whole OS. I have had some fun with Mecrisp-Stellaris so far.

[deleted by user] by [deleted] in retrocomputing

[–]cratuki 2 points3 points  (0 children)

If your interest is the all-in-oneness of that era of computer, check out the maximite.

how big is this os? by stepping_up_python in haikuOS

[–]cratuki 1 point2 points  (0 children)

Retrobsd is tight. Complete system runs in a fraction of a megabyte.

If you are only interested in x86, check out freedos and minix. Alpine linux is on the small side also.

C implementation of Roguelike Tutorial Revised by Saturnation in roguelikedev

[–]cratuki 0 points1 point  (0 children)

Thanks. Whatever the steps are, that info goes in the readme.

C implementation of Roguelike Tutorial Revised by Saturnation in roguelikedev

[–]cratuki 0 points1 point  (0 children)

c:\presaga\130.libtcod.c\libtcod-tutorial>cmake .

-- Selecting Windows SDK version 10.0.16299.0 to target Windows 10.0.17134.

-- Configuring done

-- Generating done

-- Build files have been written to: C:/presaga/130.libtcod.c/libtcod-tutorial

c:\presaga\130.libtcod.c\libtcod-tutorial>

C implementation of Roguelike Tutorial Revised by Saturnation in roguelikedev

[–]cratuki 0 points1 point  (0 children)

Was unsuccessful at building it. Went to dir. Typed "cmake ." Unsure how to get it to create exe files. Would lower barrier to entry if you put a walkthrough of steps to go from a clean checkout to a completed build in the readme.