pattern matching – How to replace all items in a list with an "element" -> "element_" rule

Here's a way:

Pattern(#, Blank()) & /@ {a, b, c, d, e, f, g, h, i, j}
(* {a_, b_, c_, d_, e_, f_, g_, h_, i_, j_} *)

An inspection of FullForm of a_ reveals why it works:

a_ // FullForm
(* Pattern(a, Blank()) *)

We can abbreviate slightly if we realize that the InputForm of Blank() is _:

Pattern(#, _) & /@ {a, b, c, d, e, f, g, h, i, j}
(* {a_, b_, c_, d_, e_, f_, g_, h_, i_, j_} *)

As an alternative approach, one might think of using filter replacement instead:

Replace({a, b, c, d, e, f, g, h, i, j}, s_Symbol :> s_, {1})
  RuleDelayed::rhs: Pattern s_ appears on the right-hand side of rule s_Symbol:>s_.
  {a_, b_, c_, d_, e_, f_, g_, h_, i_, j_}

… but Mathematica warns, because most of the time it's wrong to have a pattern to the right of a rule. In this particular case, it is do not an error, so we must use Quiet say Mathematica this:

Quiet({a, b, c, d, e, f, g, h, i, j} /. s_Symbol :> s_, RuleDelayed::rhs)
(* {a_, b_, c_, d_, e_, f_, g_, h_, i_, j_} *)

android – Can you replace a childFragment with the help of an activity button?

I want the child to be replaced by pressing the activity button

I have a form in a fragment in which I have a button that opens a camera activity, pressing the button to take the picture, I want the activity to close and replace the childfragment form

The function I want to call since the activity is: is in the fragment

fun setFoto(){
        childFragmentManager.beginTransaction().replace(, PhotoFragment()).addToBackStack("Capture").commit()

I use kotlin

Magento2: How to replace the client template file?

This is because Customer Factory in your construction is trying to find the file in your current template path instead of the original template path. In your "use" list at the top of the class, add this:

use Magento Customer Model CustomerFactory;

Or you can also change the construction in your class, changing this:

public function __construct(
        CustomerFactory $customerFactory,

for that

public function __construct(
        MagentoCustomerModelCustomerFactory $customerFactory,

Has been refused in the UK, should I replace my passport?

My entry was refused in London. I had just visited Italy for 20 days. They sent me back to Italy. Now I would like to know if it is better to get a new passport here before my next trip because this black X stamped on my passport is not good to see.

After that, I will go to Romania and will probably get a student visa for Italy.

magento2 – Magento 2: Is it safe to replace SubtractQuoteInventoryObserver?

I need to override this observer because in certain circumstances
(item with specific custom options) I do not want to diminish the stock of products. I know the steps to follow to do it. I would like to know if it is considered a bad practice to replace a primary observer such as this one or if that could cause me problems in future updates of Magento 2.

Any suggestion is appreciated.

Thanks in advance ..!

javascript – replace the fa icon with an image

I want to know if anyone can help me replace a label , a fa icon with an image, when you click on the fa icon, you have to open the dialog box to search for an image on my computer and place or replace it.



How to replace text in Excel with the help of powershell

Work on writing a script that will replace the contents of the excel file. I wrote the following script, but I do not manage to process it without user intervention. It is to automate a process, so the user input is not desired.

#launch excel   
$excel = new-object -comobject excel.application

#call file
$FilePath = "C:AESOPemp.xlsx"
$workbook = $excel.Workbooks.Open($FilePath)

$WorkSheet = $Workbook.Sheets.Item(1)
$range = $worksheet.range("D:D").entirecolumn 
$workbook.ActiveSheet.Cells.Item(1,4) = 'Active'

$WorkSheet = $Workbook.Sheets.Item(1)
$range = $worksheet.range("F:F").entirecolumn 

$range.Columns.Replace("ACCOUNT CLERK I","Secretarial Staff")
$range.Columns.Replace("ACCOUNT CLERK II","Secretarial Staff")
$range.Columns.Replace("ASSISTANT COACH - CLASSIFIED","Other")
$range.Columns.Replace("ASSISTANT COACH - PARA","Other")
$range.Columns.Replace("ASSISTANT COACH-XDUTY","Other")
$range.Columns.Replace("BUS AIDE - EXCEPTIONAL CHILD","Transportation Staff")
$range.Columns.Replace("BUS DRIVER","Transportation Staff")
$range.Columns.Replace("BUS DRIVER TRAINING ASSISTANT","Transportation Staff")
$range.Columns.Replace("BUS DRIVER TRNING COORDINATOR","Transportation Staff")
$range.Columns.Replace("BUS MONITOR","Transportation Staff")
$range.Columns.Replace("CERTIFIED SOCIAL WORKER","Teacher/Professional Staff")
$range.Columns.Replace("CERTIFIED STAFF","Teacher/Professional Staff")
$range.Columns.Replace("CHIEF INFORMATION OFFICER","Technology Staff")
$range.Columns.Replace("CHILD DEVELOP CENTER ASST SUPR","Other")
$range.Columns.Replace("CHILD DEVELOPMENT CENTER SUPRV","Other")
$range.Columns.Replace("COMPUTER ENGINEER","Technology Staff")
$range.Columns.Replace("COMPUTER LAB TECHNICIAN","Technology Staff")
$range.Columns.Replace("COOK/BAKER","Cafeteria Staff")
$range.Columns.Replace("COORDINATOR I","Other")
$range.Columns.Replace("CUSTODIAL SUPERVISOR","Facilities Staff")
$range.Columns.Replace("CUSTODIAN","Facilities Staff")
$range.Columns.Replace("DAYCARE ASST - HRLY","Secretarial Staff")
$range.Columns.Replace("DEAN OF STUDENTS","Teacher/Professional Staff")
$range.Columns.Replace("DELIVERY DRIVER","Transportation Staff")
$range.Columns.Replace("DIR OF DISTRIC PERSONNEL","Teacher/Professional Staff")
$range.Columns.Replace("DIRECTOR III","Other")

#save as csv
$SavePath = "C:AESOPemp2.xlsx" 

Write-Host "Closed Excel"
Get-Process excel | Stop-Process -Force

keyboard shortcuts – Replace the MacOS terminal menu with an embedded hyphen

I see a menu item in the MacOS terminal that looks like "New tab with profile – Homebrew". I would like to replace the Cmd-T shortcut that the terminal has usefully assigned to it, because the last tab I opened was a Homebrew tab.

For most keyboard shortcuts, I would usefully follow the process defined at–appen-profile-in- terminal

I can replace a shortcut to most terminal menus (for example, "Close tab" or "Close window"), but when I try to replace "New tab with profile – Homebrew", it does not work.

The obvious answer is that the "-" must not be an old hyphen. I've tried dash, em dash, a minus typographic sign and several other dash-like characters, but none worked.

  1. How to replace "New tab with Profile – Homebrew"?
  2. Is there a way to discover for myself the exact text in a dynamically generated menu (like this one)?

Magento 1: Replace a method in a model class of a community module

I create a custom module to replace a buildCustomer () method in the app / code / community / Ess / M2ePro / Model / Magento / Customer.php file of the Magento 1 Ess_M2ePro module but does not seem to work. Can you check it please. Here is what I have until now.










class myNamespace_M2eProFixPassword_Model_Magento_Customer extends Ess_M2ePro_Model_Magento_Customer
public function buildCustomer(){
     code here

This is the config.xml community module of Ess_M2ePro



input value array how to replace decoding value as output with JavaScript code help


I have a variable value of dynamic input array
Decode the values
1 -> Java
2 -> HTML
3 -> SQL
4 -> PHP
5 -> DOTNet
6 -> JavaScript
7 -> Oracle

input values
arrstrval = 1,2,5,4,7

but my output should be as below
arrstrval = Java, HTML, DOTNet, PHP, Oracle

Can any one help me? Please