Using javascript variables in x-magento init tags

The below code errors out unexpected token :

<script>var myJSVariable = '';</script>  <script type="text/x-magento-init">         {             "*": {                 "js/async_templates": {                                 "template_code": "rv",                                 "selector" : "#rv-content",                                 "isAjax" : "true",                                 "product_id" : "<?php echo $  this->getCurrentProduct()->getId() ?>",                                 "rvp" : myJSVariable,                            }                 }         }         </script> 

I want to use myJSVariable value in the JSON. Is there a mechanism which tells magento to execute JS instead of treating this as a string ?

Starting from March 2019, is it necessary to build all existing apps using iOS 12 SDK and Xcode 10 for it to work on iOS 12 devices?

This is what the apple developer website says.

Starting March 2019, all new apps and app updates for iPhone, including universal apps, will need to be built with the iOS 12 SDK and support iPhone XS Max. All new apps and app updates for Apple Watch will need to be built with the watchOS 5 SDK and support Apple Watch Series 4

Does it mean that even the apps already available on Apple App Store needs to be resubmitted with iOS 12 SDK build for it to work on iOS 12 devices starting march 2019?

And what about enterprise apps that are distributed as .ipa files? Will this also need to be rebuilt with iOS 12 SDK for it to work on iOS 12 devices?

Issues for using Metasploit and Nexpose on same server

Environment: Red hat linux 7

Recently I received a message from Rapid7 support that by installing metasploit and nexpose on the same server creates compatibility issues as both of them use NMAP (pcap to be specific). I understand that because both the products are maintained separately, there might be an issue of version compatibility (for example, metasploit might be using pcap version 4.1 and nexpose might be using pcap version 4.3)


For us, it is difficult to keep both the products on different servers (financially) as both of them are only used for penetration test.

Question: Is there any other way I can manage to use these products on the same server without having these conflict issues?

Retrieve Items in Video Document Library using PowerShell

I’m wanting to retrieve all items within a Video Library on SharePoint and grab the owners/Created By list and all that I haven’t been able to target videos only.

I’m able to pull in all of the document libraries:
enter image description here

How do I pull items in only from the Video library?
enter image description here

Here is what I currently have:

# Add SharePoint Snapin to PowerShell if((Get-PSSnapin | Where {$  _.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $  null) {   Add-PSSnapin Microsoft.SharePoint.PowerShell } $  web = Get-SPWeb "" $  Data = foreach ($  list in $  web.Lists) {         if ($  list.BaseType -eq “DocumentLibrary”) {             foreach ($  item in $  list.Items) {                 foreach($  version in $  item.Versions){                 $  data = @{                         "Version" = $  version.VersionLabel                         "List Name" = $  list.Title                         "Created By" = $  item["Author"]                         "Created Date" = $  item["Created"]                         "Modified By" = $  item["Editor"]                         "Modified Date" = $  item["Modified"]                         "Item Name" = $  item.File.Name                         "URL"=$  web.Site.MakeFullUrl("$  ($  web.ServerRelativeUrl.TrimEnd('/'))/$  ($  item.Url)");                 }                 New-Object PSObject -Property $  data | Select "List Name", "Item Name", "Version", "Created By", "Created Date", "Modified By", "Modified Date", "URL"                 }             }             $  web.Dispose();         }     } $  Data  |  Export-Csv C:\Users\ptadmin\Desktop\process7.csv -NoTypeInformation 

How can I find what network manager my installation is using?

I’m running Ubuntu 18.04 (server) on a VirtualBox VM, and I’m trying to install Pihole on it in a container. One of the things you need to do is stop using the built-in DNS service systemd-resolved.service. I’m following this guide which mentions you can use network-manager to restart the service if you wish. However, network-manager doesn’t appear to be on my VM.

Why is this missing, and what can I do to find out what is running in its place?

What are the limitations to using the Shape Water cantrip for cheating and forgery?

The shape water cantrip has the following description:

Casting Time: 1 action
Range: 30 feet
Components: S
Duration: Instantaneous or 1 hour (see below)

You choose an area of water that you can see within range and that fits within a 5-foot cube. You manipulate it in one of the following ways:

  • You instantaneously move or otherwise change the flow of the water as you direct, up to 5 feet in any direction. This movement doesn’t have enough force to cause damage.
  • You cause the water to form into simple shapes and animate at your direction. This change lasts for 1 hour.
  • You change the water’s color or opacity. The water must be changed in the same way throughout. This change lasts for 1 hour.
  • You freeze the water, provided that there are no creatures in it. The water unfreezes in 1 hour.

If you cast this spell multiple times, you can have no more than two of its non-instantaneous effects active at a time, and you can dismiss such an effect as an action.

I have 3 scenarios I have cooked up as an Arcane Trickster rogue to use this cantrip for cheating and forgery (detailed below):

  1. Cheating at cards
  2. Cheating at dice
  3. Forgery

Cheating at cards

I have a deck of blank cards. Theoretically, I can paint the cards with water and “change the water’s color”. With this in place, given that the other players are holding there cards within the 5x5x5-foot box, I should be able to manipulate the state of the cards simply by recasting the spell (e.g. swap an ace and a two).

Would this setup be counted as one instance of “no more than two of its non-instantaneous effects active at a time”, or once per card in the deck?

Cheating at dice

I have a set of blank ivory dice: a cubic frame with six sides. Using holes in place of painted dots would allow ice to show through. By coloring each hole as black or white, I could affect the number of pips shown on each side while all the water stays in continuous contact.

ice dice

Assuming I’m playing with two dice, and each constitutes one instance of “no more than two of its non-instantaneous effects active at a time”, would this pass even the most stringent interpretations of the shape water spell?


I have a blank legal document – or better yet, one that has been filled out with information totally irrelevant to my use case (different name, different legal context).

Can I use shape water to paint it and overwrite some or all of the document with the intention that it reverts back to its original wording once the 1-hour duration of the spell ends?

Do I have to remain in the 30-foot range for the shaped water to remain?

I know I have asked multiple questions here, but the underlying theme is the same:
What are the limitations for using shape water for cheating and forgery?

Blurring A Given Image using Moving Average in Python 3

So, I’ve tried solving the following question, given to me through HackerRank:

Question on HackerRank

My Solution:

import ast A = input() A = ast.literal_eval(A)  def blur_image(a):     result = []     for i in range(len(a)):         row = []         for j in range(len(a[i])):             total, count = a[i][j], 1             if i + 1 < len(a): total, count = total + a[i+1][j], count + 1              if j + 1 < len(a[i]): total, count = total + a[i][j+1], count + 1             if i - 1 > -1: total, count = total + a[i-1][j], count + 1              if j - 1 > -1: total, count = total + a[i][j-1], count + 1             row.append(round(total/count, 2))         result.append(row)     return result  print(blur_image(A)) 

I would appreciate any suggestions and advice you can give me to improve this solution. Please note that my focus is to solve this without using any modules. Thank you!