Traveling from Brussel to Spa-Francorchamps by train and/or bus

What is a cheap and easy way to travel by train and/or bus from central Brussel to circuit de Spa-Francorchamps?
It has to include a stop for an overnight stay along the way, within 60 min from Spa-Francorchamps!
Is there a map of the bus stops along the way, to make it easier to choose a place for the overnigth stay?
Right now I’m looking at Verviers or maybe Embourg, Chaudfontaine if it has a bus stop going to Spa-Francorchamps?

What Do I Add And/Or Change To This Java Code For A Vending Machine So That It Can Execute The Mentioned Operations

My question is WHAT code should I add and/or change in this Java code so that the vending machine program can execute these extra operations below:

  1. The user can buy more than one type of item at the same time. Prompt user whether he/she would like to add something else to his selection after selecting the item, if yes then he is asked to enter item index number of the next item, and it continues until user says no and then purchase of all items is made.

  2. A VAT of 10% is charged on every purchase and change given after purchasing an item, all shown on a receipt.

  3. An admin pin code should be entered and then transition to a sub-menu where all the admin operations are numerically listed. Customers can only use the landing page menu with these 4 options, OPTION 1. INSERT MONEY NOTE OPTION 2.DISPLAY PRODUCTS OPTION 3.PURCHASE PRODUCT/S OPTION 5.EXIT

  4. The user can choose to insert an amount of money between 10, 20, 50, 100, and 200 Namibian dollars.

The landing page menu would finally look like this:

**** Welcome To SuperC Vending Machine **** **** Office Building – NUST Main Campus ****

Please Select An Option From Below

Option 1: Insert Money Note

Option 2: Display Products

Option 3: Purchase Product

Option 4: Enter Admin Pin Code – Once correct pin is entered, the user is shown a Sub-menu with these options: 1. Add new product, Remove product, Restock product, Remove Money, Add Money, Display Products, Exit)

(Set Admin pin code to 8595)

Option 5: Exit

AND

The receipt AFTER purchasing a product/s should display this: ** X Vending Machine ** ** NUST Office Building ** (The following should be aligned in a kind of TABLE LAYOUT, that we can easily do just by spacing the words in the System.out.println() functions ) Name QTY Price Total Coke 330ml 3 12.45 37.35 S/Chips 750g 1 24.95 24.95 Bar one 1 8.70 8.70

VAT@15% – 10.65 Total – 81.65 Tendered – 200.00 Change – 118.35


CODE IMAGE

Are there any official roles and/or names for the days of a tenday?

Most places and communities in Faerûn seem to be using the Calendar of Harptos. A calendar that divides the year into 12 months of 3 tendays each, and a total of 5 holidays mushed between some of these months.

The SCAG has a neat sub-chapter on said calendar, detailling the above information: Welcome to the Realms – Time in the Realms

But, there seems to be no further information regarding single days. Being Central-European (and living in a Christian country), I am used to the idea of our Monday to Friday being days when most people work, Friday’s being days where piety is shown by consuming fish, Saturdays are somewhat divided and Sundays are for church and family.

What (if any) official WotC source(s) contain information on the meanings and uses of weekdays?

Haskell Stack having trouble installing htaglib and/or flac libraries, missing or bad C library

This summer I wanted to practice Haskell by making some programs, one of which being something that can pull and organize .mp3 and .flac metadata and organize it in a text file. I found two neat libraries that can do that, htaglib and flac, but trying to install both using my Stack platform leads to these errors:

Configuring htaglib-1.2.0… Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4: Missing dependency on a foreign library: * Missing (or bad) C library: tag_c

Configuring flac-0.1.2… Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4: Missing dependency on a foreign library: * Missing (or bad) C library: FLAC

I’m really not familiar with this kind of stuff, especially C libraries. I’m currently on a freshly installed Fedora 29, xfce spin. I tried installing this taglib library https://taglib.org/ and I believe I did so successfully, but I a still getting the same error. Any help would be appreciated.

What is possible with a non-administrative users Ticket Granting Ticket and/or NTLM hash?

During a penetration test, if a users NTLM hash or a valid Kerberos TGT is compromised, what attacks are possible if the user is not an administrator on any (in scope) workstations? For instance, it maybe possible to access (non administrative) SMB shares as that user, but is it possible to obtain a low level shell as that user? Or does getting a shell always necessitate admin rights in Windows? Assume Windows 10/2012 or later.

To be clear, I don’t mean getting a shell via multiple other hops (such as finding clear text credentials on some SMB share they have access to, then using RDP with those plaintext credentials), I mean directly getting a shell using their NTLM hash or Kerberos ticket directly, if they only have regular (low level) user permissions on a machine (vs being a local administrator).

Nested loop in lisp to process a 2d array – what’s good style (with and/or without loop macro)?

Code below is answer to an exercise in Paul Graham’s ANSI Common Lisp (ex. 4.1). The challenge is to rotate an array by 90 degrees. I found an example solution which I’ve commented below.

It seems ok’ish and I’m enjoying learning how to use do, but in this particular case it seems actually more verbose than the familir c-style nested for loops to process a 2d array. I’m wondering if the below is good style or if it can be improved upon?

Is the answer going to be the loop macro? I’m avoiding that at the moment while learning, waiting till I have better mastery of the basics. Yet would like to not pick up bad habits. Hence this question about style regarding the below.

(defun quarter-turn (arr)   (let* ((dim (array-dimensions arr))  ; let* sets sequentially, not in parallel.          (row (first dim))          (col (second dim))          (n row)  ; initialise n to row, just to organise          new-arr) ; shorthand for (new-arr nil)     (cond ((not (= row col))            (format t "The arg is not a square array.~%"))           (t (setf new-arr (make-array dim :initial-element nil))              (do ((i 0 (+ i 1)))  ; Q. surprisingly, lisp's 'do' here looks more                  ((= i n))        ; verbose than c-style 'for'. Is this good style?                  (do ((j 0 (+ j 1)))                      ((= j n))                      (setf (aref new-arr j i) (aref arr (- n i 1) j))))              new-arr)))) 

Source for the above code: http://www.cs.uml.edu/~lhao/ai/lisp/ansi-common-lisp/solution-ch04.htm

How overly-cute and/or heisenbug-laden is this method of adding commas to integers (12345 -> 12,345)?

Beginner/occasional C tinkerer here. (Reasonably comfortable with scripting languages, tend to avoid C due to its terseness, but trying to work past that.)

So, I happened to want to insert commas into some integers (a, uh… few hours ago). I got curious about various interesting (non-string-based) ways one might achieve that, found how to arithmetically reverse a string (cool), and, uh… ended up here.

I made this. I don’t know if I should keep it?

#include <stdio.h>  int fmtn(unsigned long long n, char *buf, int maxlen) {      int l = 0;     for (unsigned long long x = n; x; x /= 10, l++);      int l2 = l + (int)((l / 3.1));     if (l2 > maxlen) l2 = maxlen;     if (l > maxlen) l = maxlen;      int o = l2 - 1;     int c = l - 1;      for (; o > 0, n; c--, n /= 10) {         if (o >= 0) buf[o--] = (n % 10) + 48;         if (o >= 0 && (l - c) % 3 == 0) buf[o--] = ',';     }      buf[l2] = '';      return l2;  }  #define test(x) do { fmtn(x, b, 30); printf("\"%s\"\n", b); } while(0); #define testn(x, n) do { fmtn(x, b, n); printf("\"%s\"\n", b); } while(0);  int main(int argc, char **argv) {      char b[30];      testn(123, 1);     testn(123, 2);     testn(1234, 3);     testn(1234, 4);     testn(1234, 5);      puts("");      test(123);     test(12345);     test(123456);     test(1234567);     test(12345678);     test(123456789);     test(1234567890);     test(12345678901);     test(123456789012);     test(1234567890123);     test(12345678901234);     test(123456789012345);     test(1234567890123456);     test(12345678901234567);     test(123456789012345678);     test(1234567890123456789);     test(12345678901234567890ull);  }  

Compiling with -Wall produces this interesting message – I’m pretty sure that o will routinely <= 0:

In function 'fmtn': 15:14: warning: left-hand operand of comma expression has no effect [-Wunused-value]   for (; o > 0, n; c--, n /= 10) {               ^ 

Here’s what the supplied main outputs on my machine. The first part is a demonstration of what happens when maxlen (which doesn’t count the '') is too short (no buffer overflows! yay!):

"3" "23" "234" ",234" "1,234"  "123" "12,345" "123,456" "1,234,567" "12,345,678" "123,456,789" "1,234,567,890" "12,345,678,901" "123,456,789,012" "1,234,567,890,123" "12,345,678,901,234" "123,456,789,012,345" "1,234,567,890,123,456" "12,345,678,901,234,567" "123,456,789,012,345,678" "1,234,567,890,123,456,789" "12,345,678,901,234,567,890" 

The part I’m mostly… fascinated? with is the magic 3.1 near the top which is calculating what the length of the output string with commas added will be (the code of course works backwards). 3.1 Seems To Work™ for the values I’m supplying, but I’m 100.0% sure it’s probably secretly horribly broken on some large inputs (which I’ve not figured out how to test yet).

There are also probably a myriad of other issues I’ve not thought of in terms of coding semantics and style 🙂 (such as the fact that codegolf.SE is ← that way…)

Dependency graph with general (AND/OR) dependencies

This is similar to Is there such a thing as an "or" case in a dependency graph?

I am trying to represent a dependency graph where the dependencies for an individual node may be a general boolean function of other nodes.

For example, node A may be reachable from node B or node C.

I can’t see how to represent this with a DAG. Is there way to represent general boolean dependencies in a DAG? If there isn’t, what other sort of structure should I use?

Are objects structures and/or vice versa?

An interesting issue came up in a game we were playing recently: Our party was on an airship and attacked by flying young dragons. My sorcerer cast a spell that triggered a wild magic surge and rolled a self-centered fireball (at 20,000 feet, whee!).

Here’s the issue. Fireball says:

The fire spreads around corners. It ignites flammable Objects in the area that aren’t being worn or carried.

I’ve noticed that certain monsters have the “Siege Monster” feature which says:

Siege Monster. The [monster] deals double damage to objects and structures.

This suggests that objects and structures are legally different things and therefore Fireball would ignite an object but not a structure.

But then, perhaps a structure is a type of object? What is the nature/relationship of these two classifications of entities?

(For what it’s worth, we ruled that the rope rigging was flammable because rope appears on the gear item table).