How to merge two descending singly linkedlist into one ascending linkedlist using Recursion without any helper method?

enter image description here

Here is my solution:
I want to know if my solution fits the requirement 100%? Or if there is any better solution?

Constraint of the question:

  1. must be singly linkedlist

  2. must use recursion, and no helper methods allowed.

  3. The method must return the head node of the merged list.

     class Solution{
     Node dummy=new Node(0,null);// the dummy node to store the merged result
    
     public   Node mergeAscend(Node a,Node b){
         if(a==null&&b==null){//base case
             return null;
         }
    
         else{
             if((a!=null&&b==null)||a.value>=b.value){// insert "b" after dummy
                 //store the next node of current a, before pointing a.next to dummy.next;
                 Node store_a_next_node=a.next;
                 //insert Node "a" between dummy and dummy.next
                 a.next=dummy.next;
                 dummy.next=a;
                 mergeAscend(store_a_next_node,b);
             }
             else if((a==null&&b!=null)||a.value<b.value){//insert "a" after dummy
                 Node store_b_next_node=b.next;
                 b.next=dummy.next;
                 dummy.next=b;
                 mergeAscend(a,store_b_next_node);
             }
         }
         return  dummy.next;
     }   
    

}

context sensitive help – What is the name for a pattern featuring helper text in a semi-transparent overlay?

I am seeing an emerging design pattern in web apps that is used for helping new users get oriented to a page or application.

It consists of showing a diagram with succinct helper-text over a semi-transparent overlay, sometimes with arrows pointing to specific controls on the page. One of the best example of this I have seen is in UX Pin, an online wireframing/design tool.

Has anyone ever utilized this pattern – and if so, what is it called? Or how did you refer to it?

I am also interested in learning how it is accomplished. Is there a tool or plug-in that might be useful for achieving this effect, and is it possible to do this in a reusable fashion without placing static text in a transparent png?

magento2 – How to Use Helper Function in checkout_cart_index.xml?

I’ve to override checkout_cart_index.xml file from vendor/Magento for removing estimate shipping and discount code block!
It’s working successfully but my requirement is…it only should run when an admin or user select Yes from config part.I’ve tried ifconfig part but it’s not working. Can anyone suggest any better idea to fulfil this requirement!? Here’s my code of checkout_cart_index.xml. In this code set true in checkout.cart.coupon part is for removing Discount code and the above part is for for removing estimated shipping block and also override shipping.phtml

        <action method="setTemplate">
            <argument name="template" xsi:type="string">vender_extensionname::shipping.phtml</argument>
        </action>
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="block-summary" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="componentDisabled" xsi:type="boolean">true</item>
                        </item>
                    </item>
                </item>
            </argument>

        </arguments>
    </referenceBlock>

    <referenceBlock name="checkout.cart.coupon" remove="true"/>

Here’s my config part

https://meetanshi.d.pr/7mlW34

in which if user set to yes in discount code then it should be displayed but if one select NO then it should not be displayed.I’ve created helper data.php for fetching that yes no value but I’m confused in how to use helper function in my XML part.

web development – PHP: What code should be removed to its own helper class and where should such classes be located in the filesystem?

The following is an example requesting an explanation for one specific file in one specific filesystem, not helper classes generally.

I have configured a LEPP stack on a CentOS server. The server hosts an API which is built using Slim PHP Framework. There is an official skeleton repo on Slim’s github.

The repo has a basic file structure which is clearly defined as follows:

app
├───dependencies.php
├───middleware.php
├───repositories.php
├───routes.php
└───settings.php
logs
└───app.log
public
└───index.php
src
├───Application
│   ├───Actions
│   │   ├───User
│   │   │   ├───ListUsersAction.php
│   │   │   ├───UserAction.php
│   │   │   └───ViewUserAction.php
│   │   ├───Action.php
│   │   ├───ActionError.php
│   │   └───ActionPayload.php
│   ├───Handlers
│   │   ├───HttpErrorHandler.php
│   │   └───ShutdownHandler.php
│   ├───Middleware
│   │   └───SessionMiddleware.php
│   └───ResponseEmitter
│       └───ResponseEmitter.php
├───Domain
│   ├───DomainException
│   │   ├───DomainException.php
│   │   └───DomainRecordNotFoundException.php
│   └───User
│       ├───User.php
│       ├───UserNotFoundException.php
│       └───UserRepository.php
└───Infrastructure
│   └───Persistence
│       └───User
│           └───InMemoryUserRepository.php
tests
var
└───cache

I have added my own endpoints to this, for example a ‘ViewWordAction’ class which utilises a ‘PostgresWordRepository’ class and returns dictionary definitions for a single word found within a database table when the /dict?word={word} endpoint.

This action is excluded from the file structure for clarity. There are various other endpoints which I will add, used to analyse word data.

I have a separate class called ‘RegExHelper’ which separates punctuation, recognises ends of sentences and other similar functions. In previous versions of my application, the file structure was a mess and did not follow proper conventions, so this and similar classes were stored in a ‘Helper’ folder within the src directory. This class will be shared amongst various other classes across multiple endpoints.

I would like to know where to store this helper class and which naming conventions to use. I presume that the class should be refactored as ‘RegExHander’ and stored in a src/Application/Handlers/RegEx directory, although I cannot find any guides or documentation which explain the proper file structure for this example.

magento2.3 – Set global variable in Helper Magento 2

In my helper / Data.php I have the following function:

 function getTemplate($isOrder, $apiKey)
    {
        $dataReturned = $this->apiCall('https://www.myApiServer.com/api/v0.3/GetTemplate', $apiKey);
        $listaNomi = array();
        $listaNomi('Predefinito') = 'Predefinito';
        $xml = simplexml_load_string(utf8_encode($dataReturned));
        if (is_object($xml))
        {
            $listaModelli = $isOrder ? $xml->modelloOrdine : $xml->modelloFattura;
            foreach($listaModelli as $modello)
                $listaNomi(intval($modello->id)) = strval($modello->descrizione) . " (ID: " . intval($modello->id) . ")";
        }
        else
            $this->trace('error list templates', $dataReturned);
        return $listaNomi;
    }

I want to put this line

   $dataReturned = $this->apiCall('https://www.myApiServer.com/api/v0.3/GetTemplate', $apiKey);

Outside of the function, I think I should set the result as global so that I don't have to call my APIs every time I call this function

I found this guide, but I'm new to Magento and I'm not sure how to set it up. Thanks a lot

You need to create a JSON string from Jbuilder in Rails Helper

I have to create a complex JSON from my Rails helper

I tried to use Jbuilder for this.
I tried a code from a xxxx.json.jbuilder and it works great.

json.array! @demandes.includes(....) do |demande| 
  json.id demande.id
  json.title demande.title
  .....
end

The object is generated well from my_app_url / xxxx.json.

However, I want to generate the object from a Rails helper and assign it to a variable.
It is possible?
If yes, how does it work?

Thanks a lot

Helper – I need to solve a question where information is shared with CSV and TXT

I have to solve this problem, but we had no basis for it. I did part of it, but I have a lot of doubts about how to go about it and how to do the ex-run.
name = int (enter (& # 39; enter your name & # 39;))
def order (M):
n = len (M)
for n in the range (len (M), 1, -1):
imax = 0
for i in the range (1, n):
if M (i) (0)> M (imax) (0):
imax = i
tmp = M (n-1)
M (n-1) = M (imax)
M (imax) = tmp
def main ():
# Read the input file
file = open ("grade.csv", & # 39; r & # 39;)
matrix = (& # 39; Enter your name and 3 notes from 10 students & # 39;)
for line in file:
l = linha.strip (& # 39; Enter your name and 3 grades from 10 students & # 39;)
if len (l)> = 0:
words = l.split (";")
array.append (words)
file.close ()

ordenacao(matriz)

1) Develop a Python program that asks the user for the name and 3 grades of the 10 second grade students. This information must then be recorded in the "notas.csv" file. Then read the grade.csv file and calculate the average of each student's 3 grades, recording this information.