Can’t enter directory despite correct permissions

I have a directory (Owned by nobody due to it being a part of a Docker bind mount, combined with user namespace remapping.) that I need to enter. This is its relevant ls -la output:

drwxrwxr-x    2 nobody   nobody        4096 May 26 14:42 Directory 

Running as root, although I don’t belong in either the owner or group of the directory, the directory is world readable and executable, so I should be able to enter it. However, when running cd Directory, it fails:

bash: cd: Directory: Permission denied 

Correct HttpMethod to reset internal data

I am currently building a web api. The authentication is based on keys which are set in the database.

However, these keys could be changed someday, e.g. when a user should be banned from the system. Currently the data is read once on startup of the server/application.

My question is, how I can reset this data without the need to restart the application?

The data itself is a private backing-field which is only initialized when not set (as on startup). I now want to reset the data by just setting the data to null which will reload it from the database on the next call/access.

What would be the correct method in terms of REST?

As far as I have understood, none of the methods are “correct” as I don’t create, update or delete a resource.

For me DELETE would be the choice as I delete the internal data.

Any thoughts?

`drush uli` generates correct link but results in ‘Access Denied’

I have set up a Drush alias for my website (hosted on a shared hosting), the alias works correctly, because commands like drush status, drush cc all, etc. work. The problem comes with drush uli. It generates the one-time login link, the domain is correct, everything looks all right, but when entered into a browser, it results in standard Drupal

Access Denied

page.

Part of setting up the alias and some interesting issues around path-alias-es, relations to database settings, it’s usage and relevancy the aliases is originally discussed in Drush issues page on GitHub.

Technical information:

  • This is a clean Drupal 7 installation, without contrib modules.
  • I can log in using password (even using password set via drush upwd using the same alias).
  • I have checked all possible sources (like truncating sessions table, etc.) discussed in similar but yet different issue on StackExchange.
  • I have tried different browsers and cleared browser caches and cookies as suggested in various similar discussions on Drupal.org, all without luck.

Drush alias:

$  aliases['myalias'] = array(   'uri' => 'mysite.com',   'root' => '/home/mysite.com/web',   'path-aliases' => array(     '%drush' => '/home/.composer/vendor/drush/drush',    ),   '%files' => '/home/mysite.com/web/sites/mysite.com/files', );  

The alias works correctly for other commands like clearing caches and drush status confirms that Drupal is bootstrapped correctly.

Which use-case diagram is correct in my example? [on hold]

I’m trying to model a TIR carnet with UML use-case diagrams and come up with these 2 solutions regarding TIR carnet holder and customs office.

Solution 1 Solution with generalization Solution 2

Solution with include/extend

Which solution should I choose, knowing that TIR carnet holder can’t enter any data about customs seals or TIR operations and Customs office can’t change data about goods manifest in TIR carnet?

Is this the correct design?

I’m new to software design and I’m trying to write a JS application that some people might find simple but will be the most I’ve dealt with JS. I hope this forum is the right place where to ask my question.

In my current design, I’m having one class (hereinafter C1) managing a collection of Objects that I’ll call “Items”; Items can be added and changed at runtime. Then I have another Class that generates some data (hereinafter C2); the data can also be regenerated after the data has been generated. Finally, I have a third Class (hereinafter C3) that will do an operation on some data from each Item and the data from C2. If the data in C2 changes then the operation in C3 has to be redone for each Item, and if any Item gets added or changed then the operation should be run on only that Item.

The way I intend to implement that is by having C3 holding a reference to C1 and C2 and vice-versa (C1 and C2 holding a reference to C3). C3 will have distinct notify() methods for C1 and C2 (that feels messy). If C1 calls C3 (when an Item is added) then C3 will ask C2 if it has valid data; if it does then C3 asks C1 for the data on Items that the operation wasn’t performed on, performs the operation, returns true, and C1 will mark each Item as performed. If C2 doesn’t have valid data the C3 returns false the Items won’t be updated. If C2 calls C3 (when C2’s data is now valid or has been updated) C3 asks C1 for all the Item’s data, performs the operation, and then tells C1 to mark all Items as operation performed.

So is this a suitable design or not? Thanks

Basic UML diagram of the design

What is the correct event for collecting/updating order information after order success?

I’ve seen multiple people use save_order_place_after, as well as checkout_onepage_controller_success_action. My issue is that I want to do a quick scan of information collected on that order, and update tables depending on the information collected. I’ve tried both of these events and get the following results (using PayPal Onepage checkout):

save_order_place_after:

  • Blank page loaded (PayPal payment review page according to URL)
  • Order interrupted (no success page)
  • Payment is sent to PayPal successfully
  • No order information is saved anywhere in admin panel or database
  • Account then becomes glitched with “duplicate invoice” error and cannot place another order without receiving error
  • An email is triggered and sent successfully from the Observer.php

checkout_onepage_controller_success_action:

  • Order is successful
  • Success page loaded
  • Nothing is executed from Observer.php

There are no syntax errors in the Observer.php, as it works correctly with the first event but is apparently interrupting the order in some way.

Is there another event that’s triggered after an order is successfully completed and saved so that I can scan all information collected on the order?

Deserializing response to correct type

I use this method to get either Customer or Account. The server will determine which type it is.

The response will have a property "Type": "Customer" or "Type": "Account".

I first deserialize to Client (supertype) to check the Type property. Then deserialize to either Customer or Account.

public async Task<Models.Entities.Client> GetClient(int clientId) {     var getClientRequest = new RestRequest("client/details", Method.GET);     getClientRequest.AddQueryParameter("ClientId", clientId);      var jsonResponse = await _requestService.DoRequest(getClientRequest);      var client = JsonConvert.DeserializeObject<Models.Entities.Client>(jsonResponse);      switch (client.Type)     {         case ClientKind.Account:             var account = JsonConvert.DeserializeObject<Account>(jsonResponse)             return account;         default:             var customer = JsonConvert.DeserializeObject<Customer>(jsonResponse);             return customer;     } } 

Example responses:

{     "ClientId": 1,     "Type": "Account",     "Name": "Company Inc." } 
{     "ClientId": 2,     "Type": "Customer",     "Name":     {         "First": "John",         "Last": "Smith"     },     "DateOfBirth": "1960-12-01" } 

DTOs:

public class Client {     public int ClientId { get; set; }     public ClientType Type { get; set; } }  public class Account : Client {     public string Name { get; set; } }  public class Customer : Client {     public PersonalName Name { get; set; }     public DateTime DateOfBirth { get; set; } } 

Is it correct to sometimes capitalize words mid-sentence in computer user interfaces?

I’ve noticed that many sites and user interfaces tend to capitalize certain words or sentences like so:

Choose File  Select a File to Upload  Account Settings  How to Format 

but in some other cases, they don’t:

Please select a file to upload to our system  Browse the complete list of questions, or popular tags.   Help us answer unanswered questions. 

And sometimes, particularly in list items, all in lowercase. Are these good practices? What’s a reasonable rule to decide when to capitalize or not, or even when to write all in lowercase?

Is this attack type chart correct?

I am wondering if this chart showing the types of attacks in 5e-dnd and what things they can count towards is correct:

(source1)

The chart works by listing on the y-axis different ways of making an attack and then along the x-axis it lists different phrases features throughout the books use. If something on the y-axis satisfies that condition on the x-axis their box is green, if not, the box is red. Several have descriptions explaining their content as I felt it might be necessary/helpful. The two Yellow boxes are yellow because the answer is conditional (not simply yes or no).

I have chosen to avoid talking about spells in this chart mostly because they would take up quite a few columns/rows, and also because they do not seem to cause people nearly as much confusion as the other types of attacks.

For the purposes of this I would like three things to be assumed. This is so I can know if the main part of the chart is correct and not the sections that have been put up to debate previously on this Stack:

  1. That using a weapon to make an improvised attack removes all of its properties including melee/ranged. Thus throwing a bow at somebody would not be considered an attack with a ranged weapon, because the bow has lost that property, similarly throwing a mace at somebody would not be considered an attack with a melee weapon.

  2. From the same question as above, that improvised attacks transform whatever is being used to make them into weapons for the purpose of that attack. Thus using a table-leg or shield in an improvised attack would momentarily make each of them count as a weapon.

  3. That you cannot use a weapon for a shove or grapple so they do not qualify as attacks with weapons. (A question where the answer was iffy)

1 – Note that the source may change after this posting as it is a Google Doc. For the sake of this question, use the image I have embedded here.