Categories
CMS Development Drupal

Generate xml with headers from php

Im building a soap client that consumes from a soap web services in a drupal 8 module. I need to generate this final xml: $inpunt_data = ‘ <soapenv:Header/> <soapenv:Body> <qual:myMethod> <!–Optional:–> <qual:xmlMethod><![CDATA[ <Tag> </Tag> </qual:Method>’; How do i generate soapenv headers? Im using simplexml: $getXML = new SimpleXMLElement($input_data); $urlTarifa = ‘http://soapurl.com?wsdl’; $client = new SoapClient($urlTarifa);

Categories
CMS Development Drupal

Find the current node title from my custom module

I’m working on a simple custom module (drupal 8). How can I get the title of the current node and use it in module’s template twig file (or pass it to twig file through PHP)?

Categories
CMS Development Drupal

How do I get the details (file size etc) of file uploaded to field of type ‘file’ inside a veiw twig template for a view of a content type?

I have created a content type with a number of fields including file fields. In the node template for that CT (node–unit.html.twig) I am able to get the details with the following code: Now I’m trying to get those same details for the field inside a view that lists nodes of that CT but the […]

Categories
Development Linux Ubuntu

Ubuntu 18 just started to overscan on TV

I’m running Ubuntu 18 on a PC and have been using it as a media centre through an LG LCD TV. All good until suddenly the screen started flickering and then the desktop spilled over the edges (overscan?) I tried swapping out the video card but no good.

Categories
Development

Error converting NVARCHAR to Float using a CAST in T-SQL

I have a table which has values in the r_version_label column like: CURRENT, LATEST, 0.1, 0.2, 0.3, 0.8.5, 1.0, 1.1 The CURRENT, LATEST and legacy version numbers such as 0.8.5 I can ignore. I am writing SQL as below: WITH cte_version_label as ( select distinct r_version_label from pharma_document_rp where r_version_label like ‘%.%’ AND r_version_label not […]

Categories
Development

Filling buckets : “horizontally” or “vertically”?

Lets have N-buckets which can hold M-items. An array hold the current count of items in every bucket : status = np.zeros(N) : max-value M I need a function to return the next bucket candidate for two different type of sequence of adding items. I was also wondering if I could do it w/o looping […]

Categories
Development

Calling an anonymous function within another function without calling the parent function

I’m trying to call an anonymous function inside another function, but without calling the parent function. Because calling the parent function will produce errors. Parent function: function onloadCallback() { grecaptcha.render(“recaptchaHolder”, { “size”: “invisible”, “sitekey”: “1Lcsvh53yhsd5312hhsg554dfhs098bbeyi_Hv”, “callback”: function(resp) { $(“zendesk-ticketing-form”).attr(“grecaptcha”, resp) } }); } I want to call this: function(resp){$(“zendesk-ticketing-form”).attr(“grecaptcha”,resp)} I’m using Java Selenium to do […]

Categories
Development

how to check if quotient is an integer value? python

Write a Python function to check whether a number is divisible by another number. Accept two integers values form the user.

Categories
Development

GIT Merge: Merge files where different additions were made on the same lines in separate branches

We are in the early development phases of a massive update for a code base. The work currently involves adding a lot of functions to certain files. The problem we are currently running into is a Developer from our main Dev branch (Branch A) creates a branch (Branch B) and completes one user story that […]

Categories
Development

Find out Text data in CSV File Numeric Columns in Powershell

I am very new in powershell. I am trying to validate my CSV file by finding out if there is any text value in my numeric fields. I can define with columns are numeric. This is my source data like this ColA ColB ColC ColD 23 23 ff 100 2.30E+01 34 2.40E+01 23 df 33 […]