What’s the default order used by WordPress to load CSS files?

I am working with a commercial theme on which I am making some style changes. Specifically, the parent theme shows a menu which I want to modify. The code for that menu is:

 <div class="mobile-navigation hidden-md hidden-lg">         <div id="close-menu-moblie">             <a href="#">                 <i class="icon-close icons"></i>             </a>         </div>    <div class="mobile-menu-container">         <ul id="menu-menu-movil" class="nav-menu mobile-menu">             <li id="menu-item-4723" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-4723 active">                 <a href="/" aria-current="page">La Familia</a>             </li>             <li id="menu-item-4724" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-4724">                 <a href="/tierras.html">La Tierra</a>             </li> 

So I created a child theme and added some CSS to it in its style.css file:

#menu-menu-movil li > a {     font-weight: 500;     font-family: Poppins, Arial, sans-serif;     } 

No way: the site ignores my changes. When I inspect the HTML I see that the browser is applying instead CSS instructions from the parent theme that target different classes:

.mobile-navigation .nav-menu > li > a {     font-size: 16px;     color: #1a1a1a;     font-weight: bold;     text-transform: capitalize; } 

So I think that it’s a problem with conflicting CSS instructions and their level of specificity or whatever… but then I try opening the CSS editor in WP Admin at "Appearance / Customise / Additional CSS" and pasting there my changes… and they work.

This led me to think: is there a default order in which WordPress loads CSS from all the possible places where they can be? ("Additional CSS", child themes, parent themes…). I seem to remember that there was, but after searching around on Google for a while I couldn’t find anything. Or is my problem in the end about CSS specificity?

How to get correct note timings when importing multi-track Midi files?

I have observed when importing midi files with more than one track, the times for every track except for the first one are sped up.

for example,

Import[file, "SoundNotes"][[4, -10]] Import[file, {"SoundNotes", 4}][[-10]] 

returns

SoundNote["F5", {404., 404.569}, "Oboe", SoundVolume -> 0.752941] SoundNote["F5", {408.062, 408.659}, "Oboe", SoundVolume -> 0.752941] 

As you can see, by the end of playing this file, the fourth track is over 4 seconds off!

On the other hand, the first track shows no time difference at all between the two import methods:

Import[file, "SoundNotes"][[1, -10]] Import[file, {"SoundNotes", 1}][[-10]] 

returns

SoundNote["F6", {408.062, 408.629}, "Flute", SoundVolume -> 0.752941] SoundNote["F6", {408.062, 408.629}, "Flute", SoundVolume -> 0.752941] 

You can definitely hear this offset by the end of the piece, especially if it is a two-track piano midi roll.

How can I properly import the midi without messing up the timestamps for the lower tracks? This bug is present in Mathematica 12.3.1 on Windows 10.

Missing .twig files in wordpress theme editor

I just started learning timber. Timber uses twig as its templating engine.

This is great but I have a problem with displaying all .twig files in the theme editor. I’m using VS code for my code development so I have no problem viewing and accessing .twig files there.

My problem is with the built in wordpress theme editor.

Do you know of a way to show all the file/folder structure when using the theme editor? starting with displaying .twig files but would also be nice to see all file/folder structure including, vendor, composer.json etc…

Block access to multiple files with .htaccess – RewriteRule and FilesMatch fail [closed]

I am trying to block access to specific files. Neither the RewriteRule or FilesMatch rules I have tried work on the live server, it serves the files as normal with status 200 OK (I’m expecting 404 Not Found).

The regex I am using for FilesMatch is (?:test|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?). I have tested it at https://regexr.com/ and it is successful for

  • /readme.html
  • /wp-content/test.txt
  • /_test/test.txt

I have also tested the RewriteRule at https://htaccess.madewithlove.be/. It is successful for URL https://www.example.com/readme.html and https://www.example.com/wp-content/test.txt with .htaccess rule RewriteRule (?:test|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?) - [R=404,NC,L].

I have seen the answer at https://stackoverflow.com/a/51132806/3204075 The following does not work for me, I still get 200 OK for readme.html and test.txt in the root directory.

<filesMatch "(readme\.html|test\.txt)">     Order Allow,Deny     Deny from all </filesMatch> 

Can anyone suggest why the following FilesMatch and RewriteRules appear to be ignored by Apache?

RewriteRule

RewriteRule (?:test|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?) - [R=404,NC,L] 

FilesMatch

<FilesMatch (?:test|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html?)>   # since apache 2.4: Require all denied   Order Allow,Deny   Deny from all </FilesMatch> 

Environment

  • Cloudways
  • Nginx 1.19.8-0
  • Apache/2.4.25 (Debian)

Thanks,

Chris

Reading Minecraft-like binary files

I decompiled the first Minecraft version (rd-132211) using jd-gui and recompiled it. After recompiling, running Minecraft had no problem except screen size problem and I can make sure the source code has no problem.

Now, I looked at com.mojang.rubydung.level Level.java file. But I can’t understand lot.

Here is the code I understood and used in my code:

package com.kg.jopenattack.level;  import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream;  public class Level {     private byte[] bytes = new byte[1];     public void load() throws FileNotFoundException, IOException {         DataInputStream dis = new DataInputStream(new GZIPInputStream(new FileInputStream(new File("level.lvl"))));         dis.readFully(bytes);         dis.close();     }     public void save() throws FileNotFoundException, IOException {         DataOutputStream dos = new DataOutputStream(new GZIPOutputStream(new FileOutputStream(new File("level.lvl"))));         dos.write(bytes);         dos.close();     } } 

But this code reads nothing.

To decompile Minecraft rd-132211, enable historical option in Minecraft launcher settings and create rd-132211 installation.

Loco translated language files in plugin folder don’t work

I created an own plugin wished to make it translatable. So I made a template with loco translate. pot file was put to plugins/my-plugin/lanuages/ folder as desired. Than I made a translation to my language (hungarian) to the same location. Nothing happend. Than I created one more translation on the same language but not to Author (plugins/my-plugin/languages) destination but System (languages/plugins/my-plugin). And it worked that way. I dont’t now why it does not work in plugin folder. Plugin header is set to /languages/ to store the translation files. POT file also got there by default so it has no sense. I want to provide some translation with my plugin but it would work if the translation were in plugin not in system folder. Any idea?

Question on links and files

Hello. I started testing the program and there were some difficulties. For earlier I apologize for the text, as the translation is from translate.google.com. I don’t know English.

1) Macro #file_links

https://docu.gsa-online.de/search_engine_ranker/macro_guide?s[]=file&s[]=links&s[]=names&s[]=dat&s[]=2#file_links_filename_or_url_number_of_lines_line_output

I want to display 1 line at each call in order. No matter how I prescribe it:

#file_links [C:\ankors.txt,1,NP]

#file_links [C:\ankors.txt,1,SP]

#file_links [C:\ankors.txt,1,LP]

#file_links [C:\ankors.txt,NP]

#file_links [C:\ankors.txt,SP]

#file_links [C:\ankors.txt,LP]

The same keys are output anyway. And if you put

#file_links [C:\ankors.txt,1,N]

#file_links [C:\ankors.txt,1,S]

#file_links [C:\ankors.txt,1,L]

Then random entries are displayed, which I do not need.

I need to output in order:

Anchor 1

Anchor 2

Anchor 3

Ancro N

Anchor 1

2) I also want to output a random piece of article from the file

#file_links[C:\ankors.txt,(10,50),SP]

#file_links[C:\ankors.txt,(10,50),NP]

#file_links[C:\ankors.txt,(10,50),LP]

Here also, either the output goes to the same parts of the article, or all the lines are random.

I want to display a random piece of article in different places in order.

3) I want to put my links and link pictures in the text fields.

No matter how I put it, part is still cut out, and the pictures have never been displayed.

Tried these options:

<a href=”https://site.com”><img src=”https://site.com/img.jpg”/></a>

[url=https://site.com][IMG]https://site.com/img.jpg[/IMG][/url]

<a href=”https://site.com”><b>#file_links[C:\ankors.txt,1,NP]</b></a>

[url=ttps://site.com][b]#file_links[C:\ankors.txt,1,NP][/b][/url]

But if I manually register on the site and insert my text with links and pictures, then it is displayed correctly without problems.

Please help me solve these problems. Thank you!

Best practice for organizing DDL SQL files

I am developing a postgres database with the following approximate number of entities:

  • 60 tables spread across 7 schemas
  • 20 views
  • 20 functions

What’s the best practice for organizing all the DDL SQL?

I currently have a single SQL for the table definitions, another for the views and yet another for the functions. But two of these files have grown to over 1,000 lines each and become unwieldy. That said, there are relationships between tables in different schemas and one file makes these easy to manage.

Would it be better to organize the DDL by schema? Or finer grain still, at the entity level?

I am using JetBrains DataGrip and would appreciate that the solution still enable Intellisense and error checking. The SQL is stored in git.