问:
Google Apps Script successfully triggers On Form Submit, but function will not execute
I'm trying to copy a row from the linked form responses sheet "main" to another sheet "sub" if a value in the form response matches a particular criteria, Column 4 = "Subset"

I have onFormSubmit set up as a trigger with Deployment - Head, Source - Spreadsheet, Event - On form submit. When I submit the form, the trigger for onFormSubmit logs the execution as Completed but the row does not copy to the "sub" sheet.

The getLast function allows me to move the row to the next available position in the "sub" sheet starting in the second column because I have checkboxes in the first column all the way down the sheet.

The code works as is when using the onEdit function and manually entering "Subset" into column 4. I can't seem to figure out why nothing happens with onFormSubmit even though the trigger is successfully executed. Please help!

```<code>function onFormSubmit(e) {
 var ss = SpreadsheetApp.getActiveSpreadsheet();
 var s = e.source.getActiveSheet();
 var r = e.source.getActiveRange();

 if(s.getName() == "main" && r.getColumn() == 4 && r.getValue() == "Subset") {
  var row = r.getRow();
  var numColumns = s.getLastColumn();
  var targetSheet = ss.getSheetByName("sub");
  var column = targetSheet.getRange("B:B").getValues();
  var lastRow = getLast(column);
  var target = targetSheet.getRange(lastRow + 1, 2);
  s.getRange(row, 1, 1, numColumns).copyTo(target);
 }
}

function getLast(range){
 var rowNum = 0;
 var blank = false;
 for(var row = 0; row < range.length; row++){

  if(range[row][0] === "" && !blank){
   rowNum = row;
   blank = true;
  }else if(range[row][0] !== ""){
   blank = false;
  }
 }
 return rowNum;
}
</code>```

答:
Thanks Tanaike, I was just figuring this out as you posted. The event object passed by the On Form Submit trigger does not values for .getActiveSheet() and .getActiveRange() because there is not an active user.

My solution isn't as elegant as yours but it did the trick. I appreciate how you bypass SpreadsheetApp altogether by getting the sheet directly from the event object.

```<code>function onFormSubmit(e) {
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheetByName("main");
   var response = e.values;

   if(response[3] == "Subset") {
     var row = sheet.getLastRow();
     var numColumns = sheet.getLastColumn();
     var targetSheet = ss.getSheetByName("sub");
     var column = targetSheet.getRange("B:B").getValues();
     var lastRow = getLast(column);
     var target = targetSheet.getRange(lastRow + 1, 2);
     sheet.getRange(row, 1, 1, numColumns).copyTo(target);
   }
}
</code>```

On further inspection and inspired by your solution, I combined your approach with my use of e.values in the if statement to land on a lean and functional approach. Thanks a lot, Tanaike!

```<code>function onFormSubmit(e) {
  var response = e.range;

  if(response.getValues()[0][3] == "Subset") {
    var targetSheet = e.source.getSheetByName("sub");
    var col = targetSheet.getRange("B:B").getValues();
    var lastRow = getLast(col);
    var target = targetSheet.getRange(lastRow + 1, 2);
    response.copyTo(target);
  }
}
</code>```

Body:
I'm trying to copy a row from the linked form responses sheet "main" to another sheet "sub" if a value in the form response matches a particular criteria, Column 4 = "Subset"

I have onFormSubmit set up as a trigger with Deployment - Head, Source - Spreadsheet, Event - On form submit. When I submit the form, the trigger for onFormSubmit logs the execution as Completed but the row does not copy to the "sub" sheet.

The getLast function allows me to move the row to the next available position in the "sub" sheet starting in the second column because I have checkboxes in the first column all the way down the sheet.

The code works as is when using the onEdit function and manually entering "Subset" into column 4. I can't seem to figure out why nothing happens with onFormSubmit even though the trigger is successfully executed. Please help!

function onFormSubmit(e) {
 var ss = SpreadsheetApp.getActiveSpreadsheet();
 var s = e.source.getActiveSheet();
 var r = e.source.getActiveRange();

 if(s.getName() == "main" && r.getColumn() == 4 && r.getValue() == "Subset") {
  var row = r.getRow();
  var numColumns = s.getLastColumn();
  var targetSheet = ss.getSheetByName("sub");
  var column = targetSheet.getRange("B:B").getValues();
  var lastRow = getLast(column);
  var target = targetSheet.getRange(lastRow + 1, 2);
  s.getRange(row, 1, 1, numColumns).copyTo(target);
 }
}

function getLast(range){
 var rowNum = 0;
 var blank = false;
 for(var row = 0; row < range.length; row++){

  if(range[row][0] === "" && !blank){
   rowNum = row;
   blank = true;
  }else if(range[row][0] !== ""){
   blank = false;
  }
 }
 return rowNum;
}

Body:
Thanks Tanaike, I was just figuring this out as you posted. The event object passed by the On Form Submit trigger does not values for .getActiveSheet() and .getActiveRange() because there is not an active user.

My solution isn't as elegant as yours but it did the trick. I appreciate how you bypass SpreadsheetApp altogether by getting the sheet directly from the event object.

function onFormSubmit(e) {
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheetByName("main");
   var response = e.values;

   if(response[3] == "Subset") {
     var row = sheet.getLastRow();
     var numColumns = sheet.getLastColumn();
     var targetSheet = ss.getSheetByName("sub");
     var column = targetSheet.getRange("B:B").getValues();
     var lastRow = getLast(column);
     var target = targetSheet.getRange(lastRow + 1, 2);
     sheet.getRange(row, 1, 1, numColumns).copyTo(target);
   }
}

On further inspection and inspired by your solution, I combined your approach with my use of e.values in the if statement to land on a lean and functional approach. Thanks a lot, Tanaike!

function onFormSubmit(e) {
  var response = e.range;

  if(response.getValues()[0][3] == "Subset") {
    var targetSheet = e.source.getSheetByName("sub");
    var col = targetSheet.getRange("B:B").getValues();
    var lastRow = getLast(col);
    var target = targetSheet.getRange(lastRow + 1, 2);
    response.copyTo(target);
  }
}


来源: stackexchange

问:
Trouble building IDL library using makefile and gfortran on a Windows 10 running WSL Ubuntu
my knowledge is very shallow so I hope I am explaining the problem clearly.

I am trying to build a library for IDL which uses makefiles https://sourceforge.net/projects/irbem/files/irbem/4.4.0/

Judging by the contents inside the makefile, it should have support for Windows. Following the instructions on the updated github page (note here that I am trying to install the older version that is not on github) https://github.com/PRBEM/IRBEM

After entering make OS=win32 ENV=mingw all I recieve a plethora of warning messages such as:

```<code>Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE...
f951: Warning: Nonexistent include directory '%IDLINC%' [-Wmissing-include-dirs]
Warning: Fortran 2018 deleted feature: Shared DO termination..
</code>```

And in the end when I use
make OS=win32 ENV=mingw install I do not obtain the results I want which is some sort of .dll file... I suspect maybe I am using a newer version of gfortran however, I can't seem to figure out how to downgrade or resolve these issues. If anyone can help me, that would be greatly appreicated.

I am using Windows 10, with Ubuntu on Windows Subsystem Linux.

答:
I am going to speculate that you shouldn't be working in WSL, in the first place; maybe those sources/makefiles are supposed to be executed on the Windows side, withing an msys2/mingw64 shell...then, they would produce a *.dll or still an *.so kind of file.

The msys2/mingw64 environment is a linux-like environment with building tool-chaing and many commands as in Linux, but it is not Linux, they are actually Windows executables. And, so, when you compile a program with that environment, you also get a Windows executable.

My 2 cents.

ContentLicense: CC BY-SA 4.0

Body:
my knowledge is very shallow so I hope I am explaining the problem clearly.

I am trying to build a library for IDL which uses makefiles https://sourceforge.net/projects/irbem/files/irbem/4.4.0/

Judging by the contents inside the makefile, it should have support for Windows. Following the instructions on the updated github page (note here that I am trying to install the older version that is not on github) https://github.com/PRBEM/IRBEM

After entering make OS=win32 ENV=mingw all I recieve a plethora of warning messages such as:

Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE...
f951: Warning: Nonexistent include directory '%IDLINC%' [-Wmissing-include-dirs]
Warning: Fortran 2018 deleted feature: Shared DO termination..

And in the end when I use
make OS=win32 ENV=mingw install I do not obtain the results I want which is some sort of .dll file... I suspect maybe I am using a newer version of gfortran however, I can't seem to figure out how to downgrade or resolve these issues. If anyone can help me, that would be greatly appreicated.

I am using Windows 10, with Ubuntu on Windows Subsystem Linux.


问:
How to remove last slash "/" from base url in Retrofit 2
When I Type Base Url="https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/" with last slash(/) then give me message like this:

Response{protocol=http/1.1, code=500, message=Internal Server Error, url=https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/?user=XX&pass=r@12&msisdn=0160000000&trxid=6BM3KRWHLB}

After "sendmsg" slash(/) does not need

And When I Type Base Url="https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg" with out last slash(/) then apps unfortunately stop;

For this I Want to remove last "/" any way from Base Url.

```<code>private void requestDataForBkashTransaction() {
    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl("https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/")
            .addConverterFactory(GsonConverterFactory.create())
            .build();

    InstituteService api = retrofit.create(InstituteService.class);

    String urlString=String.format("?user=Exampll&pass=12345&msisdn=0160000000&trxid=6BM3KRWHLB");

    Call<List<Transaction>> call=api.getBkashTrasactionCode(urlString);

    call.enqueue(new retrofit2.Callback<List<Transaction>>() {
        @Override
        public void onResponse(Call<List<Transaction>> call, retrofit2.Response<List<Transaction>> response) {
            if(!response.isSuccessful()){
                Toast.makeText(PaymentActivity.this, response.code(), Toast.LENGTH_LONG).show();
                return;
            }
            List<Transaction> transactions=response.body();
            for(Transaction transaction:transactions){
                String content="";
                content+=transaction.getTrxId();
                textView.append(content);
            }
        }

        @Override
        public void onFailure(Call<List<Transaction>> call, Throwable t) {

        }
    });

}

@GET
Call<List<Transaction>> getBkashTrasactionCode(@Url String url);
</code>```

答:
To remove last slash,
you have to remove last path from the baseUrl with ../ first, then append it at your urlStirng instead.

```<code>String urlString=String.format("../sendmsg?user=Exampll&pass=12345&msisdn=0160000000&trxid=6BM3KRWHLB");
</code>```

Body:
When I Type Base Url="https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/" with last slash(/) then give me message like this:

Response{protocol=http/1.1, code=500, message=Internal Server Error, url=https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/?user=XX&pass=r@12&msisdn=0160000000&trxid=6BM3KRWHLB}

After "sendmsg" slash(/) does not need

And When I Type Base Url="https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg" with out last slash(/) then apps unfortunately stop;

For this I Want to remove last "/" any way from Base Url.

private void requestDataForBkashTransaction() {
    Retrofit retrofit = new Retrofit.Builder()
            .baseUrl("https://www.bkashcluster.com:9081/dreamwave/merchant/trxcheck/sendmsg/")
            .addConverterFactory(GsonConverterFactory.create())
            .build();

    InstituteService api = retrofit.create(InstituteService.class);

    String urlString=String.format("?user=Exampll&pass=12345&msisdn=0160000000&trxid=6BM3KRWHLB");

    Call<List<Transaction>> call=api.getBkashTrasactionCode(urlString);

    call.enqueue(new retrofit2.Callback<List<Transaction>>() {
        @Override
        public void onResponse(Call<List<Transaction>> call, retrofit2.Response<List<Transaction>> response) {
            if(!response.isSuccessful()){
                Toast.makeText(PaymentActivity.this, response.code(), Toast.LENGTH_LONG).show();
                return;
            }
            List<Transaction> transactions=response.body();
            for(Transaction transaction:transactions){
                String content="";
                content+=transaction.getTrxId();
                textView.append(content);
            }
        }

        @Override
        public void onFailure(Call<List<Transaction>> call, Throwable t) {

        }
    });

}

@GET
Call<List<Transaction>> getBkashTrasactionCode(@Url String url);

Body:
To remove last slash,
you have to remove last path from the baseUrl with ../ first, then append it at your urlStirng instead.

String urlString=String.format("../sendmsg?user=Exampll&pass=12345&msisdn=0160000000&trxid=6BM3KRWHLB");


问:
Trying to create Dataframe from lists of zip using Pandas. wanted data table result
I'm scraping website and come to the part where to put it in Dataframe.
I tried to follow this answer but no expected output.

Here's my whole code

```<code>#driver chrome def
website = 'https://www.bitkub.com/fee/cryptocurrency'
path = r"C:\\Users\\USER\\Downloads\\chromedriver.exe"
options = Options()
options.add_argument("start-maximized")
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
driver.get(website)

#giving variable
coin_name = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, "//tbody//tr//td[2]//span")))]
chain_name = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, "//tbody//tr//td[3]//div")))]
withdrawal_fees = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, "//tbody//tr//td[4]//div")))]
#print(coin_name)
#print(chain_name)
#print(withdrawal_fees)

#for loop make list
for coin, chains, wdf in zip(coin_name, chain_name, withdrawal_fees):
    print("Coin name: {} Chain: {} Fee: {}".format(coin, chains, wdf))
#driver.quit
</code>```

The output would be like this without being column yet. So I want it separate column by  'Coin name', 'Chain' and 'Fee'

```<code>Coin name: Civic(CVC) Chain: ETH (ERC20) Fee: 97.00000000 (CVC)
Coin name: (CVC) Chain: BSV Fee: 0.0004 (BSV)
Coin name: Bitcoin SV(BSV) Chain: ETH (ERC20) Fee: 0.00625000 (ETH)
Coin name: (BSV) Chain: BKC (KAP20) Fee: 0.01 (KUB)
Coin name: Ethereum(ETH) Chain: ETH (ERC20) Fee: 0.22000000 (COMP)
.
.
.
</code>```

This is the input of variable I've scraped

```<code>print(coin_name)
['Civic(CVC)', '(CVC)', 'Bitcoin SV(BSV)', '(BSV)', 'Ethereum(ETH)', '(ETH)', 'Bitkub Coin(KUB)', '(KUB)', 'Compound(COMP)', '(COMP)', 'Curve DAO Token(CRV)', '(CRV)', 'Axie Infinity(AXS)', '(AXS)', 'The Sandbox(SAND)', '(SAND)', 'XRP(XRP)', '(XRP)', 'ChainLink Token(LINK)', '(LINK)', 'KyberNetwork(KNC)', '(KNC)', 'Stellar(XLM)', '(XLM)', 'Six(SIX)', '(SIX)', 'Everex(EVX)', '(EVX)', 'Alpha Finance Lab(ALPHA)', '(ALPHA)', 'Balancer(BAL)', '(BAL)', 'Litecoin(LTC)', '(LTC)', 'IOSToken(IOST)', '(IOST)', 'Cortex Coin(CTXC)', '(CTXC)', 'NEAR(NEAR)', '(NEAR)', 'Aave(AAVE)', '(AAVE)', 'Raiden Network Token(RDN)', '(RDN)', 'JFIN Coin(JFIN)', '(JFIN)', 'Basic Attention Token(BAT)', '(BAT)', 'Zilliqa(ZIL)', '(ZIL)', 'Polkadot(DOT)', '(DOT)', 'SushiSwap(SUSHI)', '(SUSHI)', 'Bitcoin Cash(BCH)', '(BCH)', 'Cardano(ADA)', '(ADA)', 'BNB Coin(BNB)', '(BNB)', 'Power Ledger(POW)', '(POW)', 'Secret Network(SCRT)', '(SCRT)', 'yearn.finance(YFI)', '(YFI)', 'Bitcoin(BTC)', '(BTC)', 'OmiseGO(OMG)', '(OMG)', 'Tether(USDT)', '(USDT)', 'Dogecoin(DOGE)', '(DOGE)', 'USD Coin(USDC)', '(USDC)', 'Maker(MKR)', '(MKR)', 'Enjin Coin(ENJ)', '(ENJ)', 'Kusama(KSM)', '(KSM)', 'Donnie Finance(DON)', '(DON)', 'Wancoin(WAN)', '(WAN)', 'StatusNetwork(SNT)', '(SNT)', '0x(ZRX)', '(ZRX)', 'Arcblock(ABT)', '(ABT)', 'Decentraland(MANA)', '(MANA)', 'Dai Stablecoin(DAI)', '(DAI)', 'Band Protocol(BAND)', '(BAND)', 'Golem Network Token(GLM)', '(GLM)', 'Uniswap(UNI)', '(UNI)', 'FTX Token(FTT)', '(FTT)', 'Ocean Protocol(OCEAN)', '(OCEAN)', 'Synthetix(SNX)', '(SNX)', 'Boba Token(BOBA)', '(BOBA)', 'Gala(GALA)', '(GALA)', 'GateToken(GT)', '(GT)', 'Songbird(SGB)', '(SGB)', 'GuildFi(GF)', '(GF)', 'Immutable X(IMX)', '(IMX)', 'Ethereum Name Service(ENS)', '(ENS)', 'dYdX(DYDX)', '(DYDX)', 'Illuvium(ILV)', '(ILV)', 'Aavegotchi(GHST)', '(GHST)', 'Chiliz(CHZ)', '(CHZ)', 'The Graph(GRT)', '(GRT)', 'Gods Unchained(GODS)', '(GODS)', 'Convex Finance(CVX)', '(CVX)', 'LUKSO(LYXE)', '(LYXE)', 'Crypto.com Coin(CRO)', '(CRO)', 'Yield Guild Game(YGG)', '(YGG)', 'Smooth Love Potion(SLP)', '(SLP)', 'Coin98(C98)', '(C98)', 'ShuttleOne(SZO)', '(SZO)', 'Popcoin(POP)', '(POP)', 'Experimental Finance(EXFI)', '(EXFI)', 'Solana(SOL)', '(SOL)', 'Avalanche(AVAX)', '(AVAX)', 'Polygon(MATIC)', '(MATIC)', 'Fantom(FTM)', '(FTM)', 'Terra(LUNA)', '(LUNA)']

print(chain_name)
['ETH (ERC20)', 'BSV', 'ETH (ERC20)', 'BKC (KAP20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'XRP', 'ETH (ERC20)', 'ETH (ERC20)', 'XLM', 'XLM', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'LTC', 'IOST', 'ETH (ERC20)', 'NEAR', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ZIL', 'DOT', 'ETH (ERC20)', 'BCH', 'ADA', 'BNB (BEP2)', 'ETH (ERC20)', 'SCRT', 'ETH (ERC20)', 'BTC', 'ETH (ERC20)', 'ETH (ERC20)', 'DOGE', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'KSM', 'IOST', 'WAN', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'BAND', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'SGB', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'BKC (KAP20)', 'SGB', 'SOL', 'AVAX_C (AVAX)', 'MATIC (Polygon)', 'FTM (Fantom)', 'LUNA (Terra)']

print(withdrawal_fees)
['97.00000000 (CVC)', '0.0004 (BSV)', '0.00625000 (ETH)', '0.01 (KUB)', '0.22000000 (COMP)', '9.32000000 (CRV)', '0.49000000 (AXS)', '6.95000000 (SAND)', '0.25 (XRP)', '1.75000000 (LINK)', '4 (KNC)', '0.02 (XLM)', '1 (SIX)', '114.00000000 (EVX)', '72.00000000 (ALPHA)', '2.14000000 (BAL)', '0.001 (LTC)', '1 (IOST)', '0.1 (CTXC)', '0.01 (NEAR)', '0.28000000 (AAVE)', '55.00000000 (RDN)', '5.75000000 (JFIN)', '34.00000000 (BAT)', '0.2 (ZIL)', '0.1 (DOT)', '6.80000000 (SUSHI)', '0.001 (BCH)', '1 (ADA)', '0.00100000 (BNB)', '54.00000000 (POW)', '0.1 (SCRT)', '0.00120000 (YFI)', '0.0005 (BTC)', '5.99000000 (OMG)', '35.00000000 (USDT)', '5 (DOGE)', '35.00000000 (USDC)', '0.01400000 (MKR)', '15.00000000 (ENJ)', '0.01 (KSM)', '0.00840000 (DON)', '0.1 (WAN)', '514.00000000 (SNT)', '45.00000000 (ZRX)', '35 (ABT)', '9.82000000 (MANA)', '15 (DAI)', '0.01 (BAND)', '79.00000000 (GLM)', '2.64000000 (UNI)', '0.68000000 (FTT)', '39 (OCEAN)', '7.05 (SNX)', '10.00000000 (BOBA)', '90.00000000 (GALA)', '9.5 (GT)', '1 (SGB)', '10 (GF)', '11.00000000 (IMX)', '1.54000000 (ENS)', '11.00000000 (DYDX)', '0.04400000 (ILV)', '13 (GHST)', '105 (CHZ)', '48 (GRT)', '12 (GODS)', '1.8 (CVX)', '1.5 (LYXE)', '31 (CRO)', '5.42 (YGG)', '519 (SLP)', '11 (C98)', '170 (SZO)', '40 (POP)', '0.1 (EXFI)', '0.01 (SOL)', '0.01 (AVAX)', '0.1 (MATIC)', '0.01 (FTM)', '0.02 (LUNA)']
</code>```

答:
Some how coin_name is twice as long as your other lists. Once you fix that you can do this:</p>
```<code>pd.DataFrame({'coin_name': coin_name[0:81], 'chain_name': chain_name, 'withdrawal_fees':withdrawal_fees})

          coin_name       chain_name    withdrawal_fees
0        Civic(CVC)      ETH (ERC20)  97.00000000 (CVC)
1             (CVC)              BSV       0.0004 (BSV)
2   Bitcoin SV(BSV)      ETH (ERC20)   0.00625000 (ETH)
3             (BSV)      BKC (KAP20)         0.01 (KUB)
4     Ethereum(ETH)      ETH (ERC20)  0.22000000 (COMP)
..              ...              ...                ...
76       Maker(MKR)              SOL         0.01 (SOL)
77            (MKR)    AVAX_C (AVAX)        0.01 (AVAX)
78  Enjin Coin(ENJ)  MATIC (Polygon)        0.1 (MATIC)
79            (ENJ)     FTM (Fantom)         0.01 (FTM)
80      Kusama(KSM)     LUNA (Terra)        0.02 (LUNA)

[81 rows x 3 columns]
</code>```

Body:
I'm scraping website and come to the part where to put it in Dataframe.
I tried to follow this answer but no expected output.

Here's my whole code

#driver chrome def
website = 'https://www.bitkub.com/fee/cryptocurrency'
path = r"C:\\Users\\USER\\Downloads\\chromedriver.exe"
options = Options()
options.add_argument("start-maximized")
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
driver.get(website)

#giving variable
coin_name = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, "//tbody//tr//td[2]//span")))]
chain_name = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, "//tbody//tr//td[3]//div")))]
withdrawal_fees = [my_elem.text for my_elem in WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, "//tbody//tr//td[4]//div")))]
#print(coin_name)
#print(chain_name)
#print(withdrawal_fees)

#for loop make list
for coin, chains, wdf in zip(coin_name, chain_name, withdrawal_fees):
    print("Coin name: {} Chain: {} Fee: {}".format(coin, chains, wdf))
#driver.quit

The output would be like this without being column yet. So I want it separate column by  'Coin name', 'Chain' and 'Fee'

Coin name: Civic(CVC) Chain: ETH (ERC20) Fee: 97.00000000 (CVC)
Coin name: (CVC) Chain: BSV Fee: 0.0004 (BSV)
Coin name: Bitcoin SV(BSV) Chain: ETH (ERC20) Fee: 0.00625000 (ETH)
Coin name: (BSV) Chain: BKC (KAP20) Fee: 0.01 (KUB)
Coin name: Ethereum(ETH) Chain: ETH (ERC20) Fee: 0.22000000 (COMP)
.
.
.

This is the input of variable I've scraped

print(coin_name)
['Civic(CVC)', '(CVC)', 'Bitcoin SV(BSV)', '(BSV)', 'Ethereum(ETH)', '(ETH)', 'Bitkub Coin(KUB)', '(KUB)', 'Compound(COMP)', '(COMP)', 'Curve DAO Token(CRV)', '(CRV)', 'Axie Infinity(AXS)', '(AXS)', 'The Sandbox(SAND)', '(SAND)', 'XRP(XRP)', '(XRP)', 'ChainLink Token(LINK)', '(LINK)', 'KyberNetwork(KNC)', '(KNC)', 'Stellar(XLM)', '(XLM)', 'Six(SIX)', '(SIX)', 'Everex(EVX)', '(EVX)', 'Alpha Finance Lab(ALPHA)', '(ALPHA)', 'Balancer(BAL)', '(BAL)', 'Litecoin(LTC)', '(LTC)', 'IOSToken(IOST)', '(IOST)', 'Cortex Coin(CTXC)', '(CTXC)', 'NEAR(NEAR)', '(NEAR)', 'Aave(AAVE)', '(AAVE)', 'Raiden Network Token(RDN)', '(RDN)', 'JFIN Coin(JFIN)', '(JFIN)', 'Basic Attention Token(BAT)', '(BAT)', 'Zilliqa(ZIL)', '(ZIL)', 'Polkadot(DOT)', '(DOT)', 'SushiSwap(SUSHI)', '(SUSHI)', 'Bitcoin Cash(BCH)', '(BCH)', 'Cardano(ADA)', '(ADA)', 'BNB Coin(BNB)', '(BNB)', 'Power Ledger(POW)', '(POW)', 'Secret Network(SCRT)', '(SCRT)', 'yearn.finance(YFI)', '(YFI)', 'Bitcoin(BTC)', '(BTC)', 'OmiseGO(OMG)', '(OMG)', 'Tether(USDT)', '(USDT)', 'Dogecoin(DOGE)', '(DOGE)', 'USD Coin(USDC)', '(USDC)', 'Maker(MKR)', '(MKR)', 'Enjin Coin(ENJ)', '(ENJ)', 'Kusama(KSM)', '(KSM)', 'Donnie Finance(DON)', '(DON)', 'Wancoin(WAN)', '(WAN)', 'StatusNetwork(SNT)', '(SNT)', '0x(ZRX)', '(ZRX)', 'Arcblock(ABT)', '(ABT)', 'Decentraland(MANA)', '(MANA)', 'Dai Stablecoin(DAI)', '(DAI)', 'Band Protocol(BAND)', '(BAND)', 'Golem Network Token(GLM)', '(GLM)', 'Uniswap(UNI)', '(UNI)', 'FTX Token(FTT)', '(FTT)', 'Ocean Protocol(OCEAN)', '(OCEAN)', 'Synthetix(SNX)', '(SNX)', 'Boba Token(BOBA)', '(BOBA)', 'Gala(GALA)', '(GALA)', 'GateToken(GT)', '(GT)', 'Songbird(SGB)', '(SGB)', 'GuildFi(GF)', '(GF)', 'Immutable X(IMX)', '(IMX)', 'Ethereum Name Service(ENS)', '(ENS)', 'dYdX(DYDX)', '(DYDX)', 'Illuvium(ILV)', '(ILV)', 'Aavegotchi(GHST)', '(GHST)', 'Chiliz(CHZ)', '(CHZ)', 'The Graph(GRT)', '(GRT)', 'Gods Unchained(GODS)', '(GODS)', 'Convex Finance(CVX)', '(CVX)', 'LUKSO(LYXE)', '(LYXE)', 'Crypto.com Coin(CRO)', '(CRO)', 'Yield Guild Game(YGG)', '(YGG)', 'Smooth Love Potion(SLP)', '(SLP)', 'Coin98(C98)', '(C98)', 'ShuttleOne(SZO)', '(SZO)', 'Popcoin(POP)', '(POP)', 'Experimental Finance(EXFI)', '(EXFI)', 'Solana(SOL)', '(SOL)', 'Avalanche(AVAX)', '(AVAX)', 'Polygon(MATIC)', '(MATIC)', 'Fantom(FTM)', '(FTM)', 'Terra(LUNA)', '(LUNA)']

print(chain_name)
['ETH (ERC20)', 'BSV', 'ETH (ERC20)', 'BKC (KAP20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'XRP', 'ETH (ERC20)', 'ETH (ERC20)', 'XLM', 'XLM', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'LTC', 'IOST', 'ETH (ERC20)', 'NEAR', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ZIL', 'DOT', 'ETH (ERC20)', 'BCH', 'ADA', 'BNB (BEP2)', 'ETH (ERC20)', 'SCRT', 'ETH (ERC20)', 'BTC', 'ETH (ERC20)', 'ETH (ERC20)', 'DOGE', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'KSM', 'IOST', 'WAN', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'BAND', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'SGB', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'ETH (ERC20)', 'BKC (KAP20)', 'SGB', 'SOL', 'AVAX_C (AVAX)', 'MATIC (Polygon)', 'FTM (Fantom)', 'LUNA (Terra)']

print(withdrawal_fees)
['97.00000000 (CVC)', '0.0004 (BSV)', '0.00625000 (ETH)', '0.01 (KUB)', '0.22000000 (COMP)', '9.32000000 (CRV)', '0.49000000 (AXS)', '6.95000000 (SAND)', '0.25 (XRP)', '1.75000000 (LINK)', '4 (KNC)', '0.02 (XLM)', '1 (SIX)', '114.00000000 (EVX)', '72.00000000 (ALPHA)', '2.14000000 (BAL)', '0.001 (LTC)', '1 (IOST)', '0.1 (CTXC)', '0.01 (NEAR)', '0.28000000 (AAVE)', '55.00000000 (RDN)', '5.75000000 (JFIN)', '34.00000000 (BAT)', '0.2 (ZIL)', '0.1 (DOT)', '6.80000000 (SUSHI)', '0.001 (BCH)', '1 (ADA)', '0.00100000 (BNB)', '54.00000000 (POW)', '0.1 (SCRT)', '0.00120000 (YFI)', '0.0005 (BTC)', '5.99000000 (OMG)', '35.00000000 (USDT)', '5 (DOGE)', '35.00000000 (USDC)', '0.01400000 (MKR)', '15.00000000 (ENJ)', '0.01 (KSM)', '0.00840000 (DON)', '0.1 (WAN)', '514.00000000 (SNT)', '45.00000000 (ZRX)', '35 (ABT)', '9.82000000 (MANA)', '15 (DAI)', '0.01 (BAND)', '79.00000000 (GLM)', '2.64000000 (UNI)', '0.68000000 (FTT)', '39 (OCEAN)', '7.05 (SNX)', '10.00000000 (BOBA)', '90.00000000 (GALA)', '9.5 (GT)', '1 (SGB)', '10 (GF)', '11.00000000 (IMX)', '1.54000000 (ENS)', '11.00000000 (DYDX)', '0.04400000 (ILV)', '13 (GHST)', '105 (CHZ)', '48 (GRT)', '12 (GODS)', '1.8 (CVX)', '1.5 (LYXE)', '31 (CRO)', '5.42 (YGG)', '519 (SLP)', '11 (C98)', '170 (SZO)', '40 (POP)', '0.1 (EXFI)', '0.01 (SOL)', '0.01 (AVAX)', '0.1 (MATIC)', '0.01 (FTM)', '0.02 (LUNA)']

Body:
Some how coin_name is twice as long as your other lists. Once you fix that you can do this:

pd.DataFrame({'coin_name': coin_name[0:81], 'chain_name': chain_name, 'withdrawal_fees':withdrawal_fees})

          coin_name       chain_name    withdrawal_fees
0        Civic(CVC)      ETH (ERC20)  97.00000000 (CVC)
1             (CVC)              BSV       0.0004 (BSV)
2   Bitcoin SV(BSV)      ETH (ERC20)   0.00625000 (ETH)
3             (BSV)      BKC (KAP20)         0.01 (KUB)
4     Ethereum(ETH)      ETH (ERC20)  0.22000000 (COMP)
..              ...              ...                ...
76       Maker(MKR)              SOL         0.01 (SOL)
77            (MKR)    AVAX_C (AVAX)        0.01 (AVAX)
78  Enjin Coin(ENJ)  MATIC (Polygon)        0.1 (MATIC)
79            (ENJ)     FTM (Fantom)         0.01 (FTM)
80      Kusama(KSM)     LUNA (Terra)        0.02 (LUNA)

[81 rows x 3 columns]


问:
How to handle a price change in DB just when a customer is placing an order online?
I have a Product database table with columns such as product_id, price, and inventory_count.

A user clicks to buy a certain product at a certain price. My program generates a confirmation page listing the product and the price. Everything is fine and the user clicks "Confirm". My program updates the inventory_count of that product and charges the user's credit card the amount listed in the product's price.

But during the time after the confirmation page is generated but before the user clicks "Confirm", the price of that product has been changed. So the user might have seen a price of $10 in the confirmation page but after he clicks "Confirm" the price in the Product table has already been changed to $11 and that's what he will be charged.

What's the best way to handle a situation like this? I'm using  MySQL and Python if that's relevant.

答:
Create a new table for pending purchases with the price you intend to actually charge, and add items to it when you generate the confirmation page.

Deduct from the Product table's inventory_count when you add an item to the Pending table, then you can re-increment the inventory_count if the purchase doesn't go through.

ContentLicense: CC BY-SA 3.0


问:
Docker Website using Node and Yarn wont let we access website
I just started writing docker files and am trying to start a website using docker but every time I run the file I cant access the website.
dockerfile
dockerlog</p>

答: This is just a warning that the method is deprecated and does not affect the running of the application, it is not the cause of the problem.</p>


问:
Creating a csv File Header Row with XSL
I am new to XSL and am trying to create a text csv header row with the code below. All I get is the content of each StartTime tag. What am I missing?

```<code><xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" indent="no" />

    <xsl:variable name="headers">
        <xsl:call-template name="do_header">
            <xsl:with-param name="headers" select="//Event//@channel[not(.=../../preceding-sibling::Event//@channel)]" />
        </xsl:call-template>
    </xsl:variable>
<!-- Write the Header -->

    <xsl:template name="do_header">
        <xsl:param name="headers" />
        <xsl:text>Time,</xsl:text>
        <xsl:for-each select="$headers">
            <xsl:value-of select="."/>
            <xsl:text>,</xsl:text>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
</code>```

Example XML:

```<code><?xml version="1.0" encoding="UTF-8"?>
<Program>
   <Event>
      <StartTime units="us">5</StartTime>
      <LaserOn channel="HeNe Laser" />
   </Event>
   <Event>
      <StartTime units="us">15</StartTime>
      <LaserOff channel="HeNe Laser" />
   </Event>
   <Event>
      <StartTime units="us">55</StartTime>
      <LaserOn channel="HeNe Laser" />
      <LaserOn channel="TiSaph" />
   </Event>
   <Event>
      <StartTime units="us">125</StartTime>
      <LaserOff channel="TiSaph" />
   </Event>
   <Event>
      <StartTime units="us">905</StartTime>
      <LaserOn channel="HeNe Laser" />
      <LaserOn channel="TiSaph" />
   </Event>
   <Event>
      <StartTime units="us">1500</StartTime>
      <LaserOff channel="HeNe Laser" />
   </Event>
</Program>
</code>```

Output of the xslt. It only output the content of the StartTime tags ie. 5 15 55 125 905 1500

答:
You have created a variable $header and a named template that is used to generate headers, but you haven't created any other templates that would match any content and use the $header.

Therefore, the default processing occurs, which is the equivalent of matching on elements and applying templates to children nodes, and a template matching text() that returns it. So, if you apply an XSLT without matching any templates that would do something different, you just generate output with all of the text().

You would generate the same output if your stylesheet were just:

```<code><xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" indent="no" />
</xsl:stylesheet>
</code>```

So, in order to generate your header, you could create a template that matches on the root node / and then return the value of the $header variable, which has the headers produced by calling that do_header named template:

```<code><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" indent="no" />

    <xsl:variable name="headers">
        <xsl:call-template name="do_header">
            <xsl:with-param name="headers" select="//Event//@channel[not(.=../../preceding-sibling::Event//@channel)]" />
        </xsl:call-template>
    </xsl:variable>

    <!-- Write the Header -->
    <xsl:template match="/">
        <xsl:value-of select="$headers"/>
    </xsl:template>

    <xsl:template name="do_header">
        <xsl:param name="headers" />
        <xsl:text>Time,</xsl:text>
        <xsl:for-each select="$headers">
            <xsl:value-of select="."/>
            <xsl:text>,</xsl:text>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>
</code>```

You could also just call that do_header template and avoid creating the variable:

```<code><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" indent="no" />

    <!-- Write the Header -->
    <xsl:template match="/">
        <xsl:call-template name="do_header">
            <xsl:with-param name="headers" select="//Event//@channel[not(.=../../preceding-sibling::Event//@channel)]" />
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="do_header">
        <xsl:param name="headers" />
        <xsl:text>Time,</xsl:text>
        <xsl:for-each select="$headers">
            <xsl:value-of select="."/>
            <xsl:text>,</xsl:text>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>
</code>```

Title: Creating a csv File Header Row with XSL

Body:
I am new to XSL and am trying to create a text csv header row with the code below. All I get is the content of each StartTime tag. What am I missing?

<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" indent="no" />

    <xsl:variable name="headers">
        <xsl:call-template name="do_header">
            <xsl:with-param name="headers" select="//Event//@channel[not(.=../../preceding-sibling::Event//@channel)]" />
        </xsl:call-template>
    </xsl:variable>

    <xsl:template name="do_header">
        <xsl:param name="headers" />
        <xsl:text>Time,</xsl:text>
        <xsl:for-each select="$headers">
            <xsl:value-of select="."/>
            <xsl:text>,</xsl:text>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

Example XML:

<?xml version="1.0" encoding="UTF-8"?>
<Program>
   <Event>
      <StartTime units="us">5</StartTime>
      <LaserOn channel="HeNe Laser" />
   </Event>
   <Event>
      <StartTime units="us">15</StartTime>
      <LaserOff channel="HeNe Laser" />
   </Event>
   <Event>
      <StartTime units="us">55</StartTime>
      <LaserOn channel="HeNe Laser" />
      <LaserOn channel="TiSaph" />
   </Event>
   <Event>
      <StartTime units="us">125</StartTime>
      <LaserOff channel="TiSaph" />
   </Event>
   <Event>
      <StartTime units="us">905</StartTime>
      <LaserOn channel="HeNe Laser" />
      <LaserOn channel="TiSaph" />
   </Event>
   <Event>
      <StartTime units="us">1500</StartTime>
      <LaserOff channel="HeNe Laser" />
   </Event>
</Program>

Output of the xslt. It only output the content of the StartTime tags ie. 5 15 55 125 905 1500

Body:
You have created a variable $header and a named template that is used to generate headers, but you haven't created any other templates that would match any content and use the $header.

Therefore, the default processing occurs, which is the equivalent of matching on elements and applying templates to children nodes, and a template matching text() that returns it. So, if you apply an XSLT without matching any templates that would do something different, you just generate output with all of the text().

You would generate the same output if your stylesheet were just:

<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" indent="no" />
</xsl:stylesheet>

So, in order to generate your header, you could create a template that matches on the root node / and then return the value of the $header variable, which has the headers produced by calling that do_header named template:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" indent="no" />

    <xsl:variable name="headers">
        <xsl:call-template name="do_header">
            <xsl:with-param name="headers" select="//Event//@channel[not(.=../../preceding-sibling::Event//@channel)]" />
        </xsl:call-template>
    </xsl:variable>

    <!-- Write the Header -->
    <xsl:template match="/">
        <xsl:value-of select="$headers"/>
    </xsl:template>

    <xsl:template name="do_header">
        <xsl:param name="headers" />
        <xsl:text>Time,</xsl:text>
        <xsl:for-each select="$headers">
            <xsl:value-of select="."/>
            <xsl:text>,</xsl:text>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>

You could also just call that do_header template and avoid creating the variable:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" indent="no" />

    <!-- Write the Header -->
    <xsl:template match="/">
        <xsl:call-template name="do_header">
            <xsl:with-param name="headers" select="//Event//@channel[not(.=../../preceding-sibling::Event//@channel)]" />
        </xsl:call-template>
    </xsl:template>

    <xsl:template name="do_header">
        <xsl:param name="headers" />
        <xsl:text>Time,</xsl:text>
        <xsl:for-each select="$headers">
            <xsl:value-of select="."/>
            <xsl:text>,</xsl:text>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>


问:
The exe doesn't run
I used the following Java code for move the file form one directory to another, then execute the file in the destination directory. My code is

```<code>import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;

import org.apache.commons.io.FileUtils;
public class JFileChooserTest {
  public static void main(String[] args) {
        String filelocation="C:\\Users\\FSSD\\Desktop\\OutPut\\Target";
        File trgDir = new File(filelocation);
        System.err
                .println("file location>>>>>>>>>>>>>>>>>>>"
                        + filelocation);
        File desDir = new File(
                "C:\\Users\\FSSD\\IndigoWorkSpace\\Swing\\test");

        try {
            FileUtils.copyDirectory(trgDir, desDir);
            // FileUtils.copyDirectory(srcDir, trgDir);
        } catch (IOException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

        Runtime rt=Runtime.getRuntime();
        try {
            Process p=rt.exec("test\\setup.exe");
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
  }
}
</code>```

While i executing this code, the file was successfully moved by i execute this code i got the following error.

```<code>java.io.IOException: Cannot run program "test\setup.exe": CreateProcess error=740, The requested operation requires elevation
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at java.lang.Runtime.exec(Runtime.java:593)
    at java.lang.Runtime.exec(Runtime.java:431)
    at java.lang.Runtime.exec(Runtime.java:328)
    at JFileChooserTest.main(JFileChooserTest.java:34)
Caused by: java.io.IOException: CreateProcess error=740, The requested operation requires elevation
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    ... 4 more
</code>```

Here i used "setup.exe". It is an executable file. while i execute at run time i got the above error. Why it will happens, is any possible to resolve it. Thanks in advance..

答:
The requested operation requires elevation

You do not have the rights to execute this setup. Probably UAC blocks it.

Use the runas command with Runtime#exec in Java.

Title: The exe doesn't run

Body:
I used the following Java code for move the file form one directory to another, then execute the file in the destination directory. My code is

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;

import org.apache.commons.io.FileUtils;
public class JFileChooserTest {
  public static void main(String[] args) {
        String filelocation="C:\\Users\\FSSD\\Desktop\\OutPut\\Target";
        File trgDir = new File(filelocation);
        System.err
                .println("file location>>>>>>>>>>>>>>>>>>>"
                        + filelocation);
        File desDir = new File(
                "C:\\Users\\FSSD\\IndigoWorkSpace\\Swing\\test");

        try {
            FileUtils.copyDirectory(trgDir, desDir);
            // FileUtils.copyDirectory(srcDir, trgDir);
        } catch (IOException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

        Runtime rt=Runtime.getRuntime();
        try {
            Process p=rt.exec("test\\setup.exe");
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
  }
}

While i executing this code, the file was successfully moved by i execute this code i got the following error.

java.io.IOException: Cannot run program "test\setup.exe": CreateProcess error=740, The requested operation requires elevation
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at java.lang.Runtime.exec(Runtime.java:593)
    at java.lang.Runtime.exec(Runtime.java:431)
    at java.lang.Runtime.exec(Runtime.java:328)
    at JFileChooserTest.main(JFileChooserTest.java:34)
Caused by: java.io.IOException: CreateProcess error=740, The requested operation requires elevation
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    ... 4 more

Here i used "setup.exe". It is an executable file. while i execute at run time i got the above error. Why it will happens, is any possible to resolve it. Thanks in advance..


问:
Error when installing leidenbase and monocle3 packages in RStudio on macOS Catalina Version 10.15.6 using r4.0.2
I'm trying to install the leidenbase and monocle3 packages in R using the code below:

```<code>devtools::install_github('cole-trapnell-lab/leidenbase')
devtools::install_github('cole-trapnell-lab/monocle3')
</code>```

Everything I have tried in terms of troubleshooting isn't working. I have been able to install these packages on Windows after a decent amount of troubleshooting previously, but the issue with Mac is unresolved. I have also used the terminal to run the code below, but this resulted in errors as well.

```<code>% R CMD INSTALL /Users/name/Downloads/leidenbase-0.1.0.tar
</code>```

I am also new to posting on stack overflow, so if there is any additional information that would be helpful, I can share that as well! Thanks in advance!

However, the error messages I receive are:

```<code>devtools::install_github('cole-trapnell-lab/leidenbase')
</code>```
```<code>In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:63:
In file included from cigraph/src/igraph_blas_internal.h:33:
cigraph/src/config.h:131:9: warning: 'PACKAGE_VERSION' macro redefined [-Wmacro-redefined]
#define PACKAGE_VERSION "1.1.0"
        ^
<command line>:7:9: note: previous definition is here
#define PACKAGE_VERSION "0.8.2"
        ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:510:17: error: implicit declaration of function 'dsyrk_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                BLAS_dsyrk ("L", "N",
                ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:331:2: note: expanded from macro 'BLAS_dsyrk'
        BLAS_DSYRK (uplo, trans, &N, &K, alpha, A, &LDA, beta, C, &LDC) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:132:20: note: expanded from macro 'BLAS_DSYRK'
#define BLAS_DSYRK igraphdsyrk_
                   ^
cigraph/src/igraph_lapack_internal.h:86:29: note: expanded from macro 'igraphdsyrk_'
    #define igraphdsyrk_    dsyrk_
                            ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:713:13: error: implicit declaration of function 'dpotrf_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            LAPACK_dpotrf ("L",
            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:365:2: note: expanded from macro 'LAPACK_dpotrf'
        LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:135:23: note: expanded from macro 'LAPACK_DPOTRF'
#define LAPACK_DPOTRF igraphdpotrf_
                      ^
cigraph/src/igraph_lapack_internal.h:120:29: note: expanded from macro 'igraphdpotrf_'
    #define igraphdpotrf_   dpotrf_
                            ^
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:713:13: note: did you mean 'zpotrf_'?
cigraph/src/CHOLMOD/Include/cholmod_blas.h:365:2: note: expanded from macro 'LAPACK_dpotrf'
        LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:135:23: note: expanded from macro 'LAPACK_DPOTRF'
#define LAPACK_DPOTRF igraphdpotrf_
                      ^
cigraph/src/igraph_lapack_internal.h:120:29: note: expanded from macro 'igraphdpotrf_'
    #define igraphdpotrf_   dpotrf_
                            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:370:6: note: 'zpotrf_' declared here
void LAPACK_ZPOTRF (char *uplo, BLAS_INT *n, double *A, BLAS_INT *lda,
     ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:144:23: note: expanded from macro 'LAPACK_ZPOTRF'
#define LAPACK_ZPOTRF zpotrf_
                      ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:842:17: error: implicit declaration of function 'dtrsm_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                BLAS_dtrsm ("R", "L", "C", "N",
                ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:257:2: note: expanded from macro 'BLAS_dtrsm'
        BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:130:20: note: expanded from macro 'BLAS_DTRSM'
#define BLAS_DTRSM igraphdtrsm_
                   ^
cigraph/src/igraph_blas_internal.h:50:29: note: expanded from macro 'igraphdtrsm_'
    #define igraphdtrsm_    dtrsm_
                            ^
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:842:17: note: did you mean 'ztrsm_'?
cigraph/src/CHOLMOD/Include/cholmod_blas.h:257:2: note: expanded from macro 'BLAS_dtrsm'
        BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:130:20: note: expanded from macro 'BLAS_DTRSM'
#define BLAS_DTRSM igraphdtrsm_
                   ^
cigraph/src/igraph_blas_internal.h:50:29: note: expanded from macro 'igraphdtrsm_'
    #define igraphdtrsm_    dtrsm_
                            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:261:6: note: 'ztrsm_' declared here
void BLAS_ZTRSM (char *side, char *uplo, char *transa, char *diag, BLAS_INT *m,
     ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:139:20: note: expanded from macro 'BLAS_ZTRSM'
#define BLAS_ZTRSM ztrsm_
                   ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:141:40: warning: unused variable 'tstart' [-Wunused-variable]
    double one [2], zero [2], fjk [2], tstart ;
                                       ^

2 warnings and 3 errors generated.
make: *** [cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.o] Error 1
ERROR: compilation failed for package ‘leidenbase’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/leidenbase’
Error: Failed to install 'monocle3' from GitHub:
  Failed to install 'leidenbase' from GitHub:
  (converted from warning) installation of package ‘/var/folders/v3/tdmhdpxd65n0j81wk859jdsw0000gq/T//Rtmph6G87V/file13db735dec4c5/leidenbase_0.1.1.tar.gz’ had non-zero exit status

```
devtools::install_github('cole-trapnell-lab/monocle3')
```
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:63:
In file included from cigraph/src/igraph_blas_internal.h:33:
cigraph/src/config.h:131:9: warning: 'PACKAGE_VERSION' macro redefined [-Wmacro-redefined]
#define PACKAGE_VERSION "1.1.0"
        ^
<command line>:7:9: note: previous definition is here
#define PACKAGE_VERSION "0.8.2"
        ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:510:17: error: implicit declaration of function 'dsyrk_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                BLAS_dsyrk ("L", "N",
                ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:331:2: note: expanded from macro 'BLAS_dsyrk'
        BLAS_DSYRK (uplo, trans, &N, &K, alpha, A, &LDA, beta, C, &LDC) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:132:20: note: expanded from macro 'BLAS_DSYRK'
#define BLAS_DSYRK igraphdsyrk_
                   ^
cigraph/src/igraph_lapack_internal.h:86:29: note: expanded from macro 'igraphdsyrk_'
    #define igraphdsyrk_    dsyrk_
                            ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:713:13: error: implicit declaration of function 'dpotrf_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            LAPACK_dpotrf ("L",
            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:365:2: note: expanded from macro 'LAPACK_dpotrf'
        LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:135:23: note: expanded from macro 'LAPACK_DPOTRF'
#define LAPACK_DPOTRF igraphdpotrf_
                      ^
cigraph/src/igraph_lapack_internal.h:120:29: note: expanded from macro 'igraphdpotrf_'
    #define igraphdpotrf_   dpotrf_
                            ^
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:713:13: note: did you mean 'zpotrf_'?
cigraph/src/CHOLMOD/Include/cholmod_blas.h:365:2: note: expanded from macro 'LAPACK_dpotrf'
        LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:135:23: note: expanded from macro 'LAPACK_DPOTRF'
#define LAPACK_DPOTRF igraphdpotrf_
                      ^
cigraph/src/igraph_lapack_internal.h:120:29: note: expanded from macro 'igraphdpotrf_'
    #define igraphdpotrf_   dpotrf_
                            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:370:6: note: 'zpotrf_' declared here
void LAPACK_ZPOTRF (char *uplo, BLAS_INT *n, double *A, BLAS_INT *lda,
     ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:144:23: note: expanded from macro 'LAPACK_ZPOTRF'
#define LAPACK_ZPOTRF zpotrf_
                      ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:842:17: error: implicit declaration of function 'dtrsm_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                BLAS_dtrsm ("R", "L", "C", "N",
                ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:257:2: note: expanded from macro 'BLAS_dtrsm'
        BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:130:20: note: expanded from macro 'BLAS_DTRSM'
#define BLAS_DTRSM igraphdtrsm_
                   ^
cigraph/src/igraph_blas_internal.h:50:29: note: expanded from macro 'igraphdtrsm_'
    #define igraphdtrsm_    dtrsm_
                            ^
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:842:17: note: did you mean 'ztrsm_'?
cigraph/src/CHOLMOD/Include/cholmod_blas.h:257:2: note: expanded from macro 'BLAS_dtrsm'
        BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:130:20: note: expanded from macro 'BLAS_DTRSM'
#define BLAS_DTRSM igraphdtrsm_
                   ^
cigraph/src/igraph_blas_internal.h:50:29: note: expanded from macro 'igraphdtrsm_'
    #define igraphdtrsm_    dtrsm_
                            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:261:6: note: 'ztrsm_' declared here
void BLAS_ZTRSM (char *side, char *uplo, char *transa, char *diag, BLAS_INT *m,
     ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:139:20: note: expanded from macro 'BLAS_ZTRSM'
#define BLAS_ZTRSM ztrsm_
                   ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:141:40: warning: unused variable 'tstart' [-Wunused-variable]
    double one [2], zero [2], fjk [2], tstart ;
                                       ^

2 warnings and 3 errors generated.
make: *** [cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.o] Error 1
ERROR: compilation failed for package ‘leidenbase’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/leidenbase’
Error: Failed to install 'monocle3' from GitHub:
  Failed to install 'leidenbase' from GitHub:
  (converted from warning) installation of package ‘/var/folders/v3/tdmhdpxd65n0j81wk859jdsw0000gq/T//Rtmph6G87V/file13db735dec4c5/leidenbase_0.1.1.tar.gz’ had non-zero exit status
</code>```

答:
you may need to download different compilers, this is from the leidenbase docs (https://github.com/cole-trapnell-lab/leidenbase)

```<code>MacOS Monterey on Apple ARM CPU
R distribution: https://cran.r-project.org/bin/macosx/big-sur-arm64/base/R-4.1.2-arm64.pkg C/C++ compilers: Xcode 13.2.1 FORTRAN compiler: gfortran 11.0 https://mac.r-project.org/libs-arm64/gfortran-f51f1da0-darwin20.0-arm64.tar.gz Note: after downloading gfortran, use the command sudo tar fxz gfortran-f51f1da0-darwin20.0-arm64.tar.gz -C / to install it to /opt. For more information, see https://mac.r-project.org/tools/

MacOS Monterey on Intel CPU
R distribution: CRAN package from https://cran.r-project.org/bin/macosx/R-4.0.2.pkg
C/C++ compilers: Apple Xcode 13.2.1 FORTRAN compiler: gfortran 8.2 from https://mac.r-project.org/tools/gfortran-8.2-Mojave.dmg
</code>```

I had a different error than you but ended in a compilation failure for both leidenbase and monocle3. Downloading the above fixed the problem for me

Body:
I'm trying to install the leidenbase and monocle3 packages in R using the code below:

devtools::install_github('cole-trapnell-lab/leidenbase')
devtools::install_github('cole-trapnell-lab/monocle3')

Everything I have tried in terms of troubleshooting isn't working. I have been able to install these packages on Windows after a decent amount of troubleshooting previously, but the issue with Mac is unresolved. I have also used the terminal to run the code below, but this resulted in errors as well.

% R CMD INSTALL /Users/name/Downloads/leidenbase-0.1.0.tar

I am also new to posting on stack overflow, so if there is any additional information that would be helpful, I can share that as well! Thanks in advance!

However, the error messages I receive are:

devtools::install_github('cole-trapnell-lab/leidenbase')

In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:63:
In file included from cigraph/src/igraph_blas_internal.h:33:
cigraph/src/config.h:131:9: warning: 'PACKAGE_VERSION' macro redefined [-Wmacro-redefined]
#define PACKAGE_VERSION "1.1.0"
        ^
<command line>:7:9: note: previous definition is here
#define PACKAGE_VERSION "0.8.2"
        ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:510:17: error: implicit declaration of function 'dsyrk_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                BLAS_dsyrk ("L", "N",
                ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:331:2: note: expanded from macro 'BLAS_dsyrk'
        BLAS_DSYRK (uplo, trans, &N, &K, alpha, A, &LDA, beta, C, &LDC) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:132:20: note: expanded from macro 'BLAS_DSYRK'
#define BLAS_DSYRK igraphdsyrk_
                   ^
cigraph/src/igraph_lapack_internal.h:86:29: note: expanded from macro 'igraphdsyrk_'
    #define igraphdsyrk_    dsyrk_
                            ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:713:13: error: implicit declaration of function 'dpotrf_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            LAPACK_dpotrf ("L",
            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:365:2: note: expanded from macro 'LAPACK_dpotrf'
        LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:135:23: note: expanded from macro 'LAPACK_DPOTRF'
#define LAPACK_DPOTRF igraphdpotrf_
                      ^
cigraph/src/igraph_lapack_internal.h:120:29: note: expanded from macro 'igraphdpotrf_'
    #define igraphdpotrf_   dpotrf_
                            ^
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:713:13: note: did you mean 'zpotrf_'?
cigraph/src/CHOLMOD/Include/cholmod_blas.h:365:2: note: expanded from macro 'LAPACK_dpotrf'
        LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:135:23: note: expanded from macro 'LAPACK_DPOTRF'
#define LAPACK_DPOTRF igraphdpotrf_
                      ^
cigraph/src/igraph_lapack_internal.h:120:29: note: expanded from macro 'igraphdpotrf_'
    #define igraphdpotrf_   dpotrf_
                            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:370:6: note: 'zpotrf_' declared here
void LAPACK_ZPOTRF (char *uplo, BLAS_INT *n, double *A, BLAS_INT *lda,
     ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:144:23: note: expanded from macro 'LAPACK_ZPOTRF'
#define LAPACK_ZPOTRF zpotrf_
                      ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:842:17: error: implicit declaration of function 'dtrsm_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                BLAS_dtrsm ("R", "L", "C", "N",
                ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:257:2: note: expanded from macro 'BLAS_dtrsm'
        BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:130:20: note: expanded from macro 'BLAS_DTRSM'
#define BLAS_DTRSM igraphdtrsm_
                   ^
cigraph/src/igraph_blas_internal.h:50:29: note: expanded from macro 'igraphdtrsm_'
    #define igraphdtrsm_    dtrsm_
                            ^
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:842:17: note: did you mean 'ztrsm_'?
cigraph/src/CHOLMOD/Include/cholmod_blas.h:257:2: note: expanded from macro 'BLAS_dtrsm'
        BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:130:20: note: expanded from macro 'BLAS_DTRSM'
#define BLAS_DTRSM igraphdtrsm_
                   ^
cigraph/src/igraph_blas_internal.h:50:29: note: expanded from macro 'igraphdtrsm_'
    #define igraphdtrsm_    dtrsm_
                            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:261:6: note: 'ztrsm_' declared here
void BLAS_ZTRSM (char *side, char *uplo, char *transa, char *diag, BLAS_INT *m,
     ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:139:20: note: expanded from macro 'BLAS_ZTRSM'
#define BLAS_ZTRSM ztrsm_
                   ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:141:40: warning: unused variable 'tstart' [-Wunused-variable]
    double one [2], zero [2], fjk [2], tstart ;
                                       ^

2 warnings and 3 errors generated.
make: *** [cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.o] Error 1
ERROR: compilation failed for package ‘leidenbase’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/leidenbase’
Error: Failed to install 'monocle3' from GitHub:
  Failed to install 'leidenbase' from GitHub:
  (converted from warning) installation of package ‘/var/folders/v3/tdmhdpxd65n0j81wk859jdsw0000gq/T//Rtmph6G87V/file13db735dec4c5/leidenbase_0.1.1.tar.gz’ had non-zero exit status

```
devtools::install_github('cole-trapnell-lab/monocle3')
```
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:63:
In file included from cigraph/src/igraph_blas_internal.h:33:
cigraph/src/config.h:131:9: warning: 'PACKAGE_VERSION' macro redefined [-Wmacro-redefined]
#define PACKAGE_VERSION "1.1.0"
        ^
<command line>:7:9: note: previous definition is here
#define PACKAGE_VERSION "0.8.2"
        ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:510:17: error: implicit declaration of function 'dsyrk_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                BLAS_dsyrk ("L", "N",
                ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:331:2: note: expanded from macro 'BLAS_dsyrk'
        BLAS_DSYRK (uplo, trans, &N, &K, alpha, A, &LDA, beta, C, &LDC) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:132:20: note: expanded from macro 'BLAS_DSYRK'
#define BLAS_DSYRK igraphdsyrk_
                   ^
cigraph/src/igraph_lapack_internal.h:86:29: note: expanded from macro 'igraphdsyrk_'
    #define igraphdsyrk_    dsyrk_
                            ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:713:13: error: implicit declaration of function 'dpotrf_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            LAPACK_dpotrf ("L",
            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:365:2: note: expanded from macro 'LAPACK_dpotrf'
        LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:135:23: note: expanded from macro 'LAPACK_DPOTRF'
#define LAPACK_DPOTRF igraphdpotrf_
                      ^
cigraph/src/igraph_lapack_internal.h:120:29: note: expanded from macro 'igraphdpotrf_'
    #define igraphdpotrf_   dpotrf_
                            ^
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:713:13: note: did you mean 'zpotrf_'?
cigraph/src/CHOLMOD/Include/cholmod_blas.h:365:2: note: expanded from macro 'LAPACK_dpotrf'
        LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:135:23: note: expanded from macro 'LAPACK_DPOTRF'
#define LAPACK_DPOTRF igraphdpotrf_
                      ^
cigraph/src/igraph_lapack_internal.h:120:29: note: expanded from macro 'igraphdpotrf_'
    #define igraphdpotrf_   dpotrf_
                            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:370:6: note: 'zpotrf_' declared here
void LAPACK_ZPOTRF (char *uplo, BLAS_INT *n, double *A, BLAS_INT *lda,
     ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:144:23: note: expanded from macro 'LAPACK_ZPOTRF'
#define LAPACK_ZPOTRF zpotrf_
                      ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:842:17: error: implicit declaration of function 'dtrsm_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                BLAS_dtrsm ("R", "L", "C", "N",
                ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:257:2: note: expanded from macro 'BLAS_dtrsm'
        BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:130:20: note: expanded from macro 'BLAS_DTRSM'
#define BLAS_DTRSM igraphdtrsm_
                   ^
cigraph/src/igraph_blas_internal.h:50:29: note: expanded from macro 'igraphdtrsm_'
    #define igraphdtrsm_    dtrsm_
                            ^
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:842:17: note: did you mean 'ztrsm_'?
cigraph/src/CHOLMOD/Include/cholmod_blas.h:257:2: note: expanded from macro 'BLAS_dtrsm'
        BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\
        ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:130:20: note: expanded from macro 'BLAS_DTRSM'
#define BLAS_DTRSM igraphdtrsm_
                   ^
cigraph/src/igraph_blas_internal.h:50:29: note: expanded from macro 'igraphdtrsm_'
    #define igraphdtrsm_    dtrsm_
                            ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:261:6: note: 'ztrsm_' declared here
void BLAS_ZTRSM (char *side, char *uplo, char *transa, char *diag, BLAS_INT *m,
     ^
cigraph/src/CHOLMOD/Include/cholmod_blas.h:139:20: note: expanded from macro 'BLAS_ZTRSM'
#define BLAS_ZTRSM ztrsm_
                   ^
In file included from cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.c:80:
cigraph/src/CHOLMOD/Supernodal/t_cholmod_super_numeric.c:141:40: warning: unused variable 'tstart' [-Wunused-variable]
    double one [2], zero [2], fjk [2], tstart ;
                                       ^

2 warnings and 3 errors generated.
make: *** [cigraph/src/CHOLMOD/Supernodal/cholmod_super_numeric.o] Error 1
ERROR: compilation failed for package ‘leidenbase’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/leidenbase’
Error: Failed to install 'monocle3' from GitHub:
  Failed to install 'leidenbase' from GitHub:
  (converted from warning) installation of package ‘/var/folders/v3/tdmhdpxd65n0j81wk859jdsw0000gq/T//Rtmph6G87V/file13db735dec4c5/leidenbase_0.1.1.tar.gz’ had non-zero exit status

Body:
you may need to download different compilers, this is from the leidenbase docs (https://github.com/cole-trapnell-lab/leidenbase)

MacOS Monterey on Apple ARM CPU
R distribution: https://cran.r-project.org/bin/macosx/big-sur-arm64/base/R-4.1.2-arm64.pkg C/C++ compilers: Xcode 13.2.1 FORTRAN compiler: gfortran 11.0 https://mac.r-project.org/libs-arm64/gfortran-f51f1da0-darwin20.0-arm64.tar.gz Note: after downloading gfortran, use the command sudo tar fxz gfortran-f51f1da0-darwin20.0-arm64.tar.gz -C / to install it to /opt. For more information, see https://mac.r-project.org/tools/

MacOS Monterey on Intel CPU
R distribution: CRAN package from https://cran.r-project.org/bin/macosx/R-4.0.2.pkg
C/C++ compilers: Apple Xcode 13.2.1 FORTRAN compiler: gfortran 8.2 from https://mac.r-project.org/tools/gfortran-8.2-Mojave.dmg

I had a different error than you but ended in a compilation failure for both leidenbase and monocle3. Downloading the above fixed the problem for me


问:
Is this possible Each inserts returned id Update another table
I'm merging 4 tables (com_app, com_system, com_platform,com_service) into 1 table (product)
using this sql

```<code> INSERT IGNORE INTO product(fields...)
  SELECT (fields...) from (com_app);
</code>```

but there is 5 related table left (upload_file_morph,com_apps__teches...)
its example  field is
example

upload_file_morph related to upload_file

```<code>id |upload_file_id |related_id |  related_type|      field
 1 |        835 |         1 |       com_app| coverPhoto
 2 |        836 |         1 |    com_system| coverPhoto
</code>```

com_apps__teches related to teches table

```<code>id | com_app_id |  tech_id |
 1 |        835 |        1 |
 2 |        836 |        1 |
</code>```

1 first get source tables com_app data id x then

2 in product get new inserted id y

3 find and update upload_file_morph table using x like this

```<code>UPDATE upload_file_morph
 SET related_id = [y]
 WHERE related_type='com_app' AND field='coverPhoto' AND related_id=x;
</code>```

final expectation is like

```<code> every insert y =
 INSERT IGNORE INTO product(fields...)
  every data x= {SELECT (fields...) from (com_app)}
 update on every insert
 { UPDATE upload_file_morph
    SET related_id = [y]
    WHERE related_type='com_app' AND field='coverPhoto' AND related_id=x
 }
</code>```

database structure is because  Strapi  database

答:
I'm assuming the product table has columns original_type and original_id, so you can see what the ID replacements are. Replace these in the query below with the actual columns that serve this purpose.

```<code>UPDATE upload_file_morph AS u
JOIN product AS p on p.related_id = u.original_id
SET related_id = u.id
WHERE u.original_table = 'com_app'
AND p.related_type='com_app' AND p.field='coverPhoto'
</code>```

If you don't have columns that relate the old and new IDs, I don't think you'll be able to solve this.

Body:
I'm merging 4 tables (com_app, com_system, com_platform,com_service) into 1 table (product)
using this sql

 INSERT IGNORE INTO product(fields...)
  SELECT (fields...) from (com_app);

but there is 5 related table left (upload_file_morph,com_apps__teches...)
its example  field is
example

upload_file_morph related to upload_file

id |upload_file_id |related_id |  related_type|      field
 1 |        835 |         1 |       com_app| coverPhoto
 2 |        836 |         1 |    com_system| coverPhoto

com_apps__teches related to teches table

id | com_app_id |  tech_id |
 1 |        835 |        1 |
 2 |        836 |        1 |

1 first get source tables com_app data id x then

2 in product get new inserted id y

3 find and update upload_file_morph table using x like this

UPDATE upload_file_morph
 SET related_id = [y]
 WHERE related_type='com_app' AND field='coverPhoto' AND related_id=x;

final expectation is like

 every insert y =
 INSERT IGNORE INTO product(fields...)
  every data x= {SELECT (fields...) from (com_app)}
 update on every insert
 { UPDATE upload_file_morph
    SET related_id = [y]
    WHERE related_type='com_app' AND field='coverPhoto' AND related_id=x
 }

database structure is because  Strapi  database

Body:
I'm assuming the product table has columns original_type and original_id, so you can see what the ID replacements are. Replace these in the query below with the actual columns that serve this purpose.

UPDATE upload_file_morph AS u
JOIN product AS p on p.related_id = u.original_id
SET related_id = u.id
WHERE u.original_table = 'com_app'
AND p.related_type='com_app' AND p.field='coverPhoto'

If you don't have columns that relate the old and new IDs, I don't think you'll be able to solve this.


问:
Convert text inside td with http to a link
I want to detect all links for all td with item-description class; How to make this work if my string is both just the link and when the description is link with other text. Here is my code but it does not work!

```<code><script>
var items = document.getElementsByClassName("item-description");
for (var i = 0; i < items.length; i++) {
      var text = items[i].innerText;
      var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
      text.replace(exp, "<a href='$1' target='_blank'>$1</a>");
    }
</script>
</code>```

It doesn't work as it is, the text in  are generated from form submissions. Basically if the text of td is something.com I want to make that into an a tag inside the td. I also want it to work when the text is the link text with other text. Sample: https:something.com other text here

答:
First of all a TD is a cell in a table.

The cell can have different elements in it, including the  tag which can make it clickable.

However, due to the nature of a table-cell, the height and width of a cell does not depend only on its contents but also on its neighboring  tags which can cause the clickable area to cover only a part of the cell.

Hence to make the entire link clickable, you will have to bind a JavaScript (JS) click event on that td to make it to redirect to another page or whatever link you want.

Body:
I want to detect all links for all td with item-description class; How to make this work if my string is both just the link and when the description is link with other text. Here is my code but it does not work!

It doesn't work as it is, the text in  are generated from form submissions. Basically if the text of td is something.com I want to make that into an a tag inside the td. I also want it to work when the text is the link text with other text. Sample: https:something.com other text here


问:
How can I filter out in haskell?
I know about the filter function but I'm wondering how I can filter out. For example: filter odd [1,2,3] = [1,3], but I want filter (not(odd)) [1,2,3] = [2] (yes I know there's an even function but this is just an example of it). I don't know if there's a separate function that I don't know about or if there's just something I can add to the argument. Thanks. note: I can't use the GHC.Utils.Misc filterOut.

答:
One might also use the partition function from Data.List.

```<code>Prelude> import Data.List
Prelude Data.List> lst = [1,2,3,4,5,6,7,8]
Prelude Data.List> (odds, evens) = partition odd lst
Prelude Data.List> odds
[1,3,5,7]
Prelude Data.List> evens
[2,4,6,8]
</code>```

Another alternative would be to use a list comprehension in place of filter.

```<code>Prelude Data.List> [x | x <- lst, not $ odd x]
[2,4,6,8]
</code>```

Title: How can I filter out in haskell?

Body:
One might also use the partition function from Data.List.

Prelude> import Data.List
Prelude Data.List> lst = [1,2,3,4,5,6,7,8]
Prelude Data.List> (odds, evens) = partition odd lst
Prelude Data.List> odds
[1,3,5,7]
Prelude Data.List> evens
[2,4,6,8]

Another alternative would be to use a list comprehension in place of filter.

Prelude Data.List> [x | x <- lst, not $ odd x]
[2,4,6,8]


问:
Is there a code that will use CSS to hide a class if within a certain window-type?
I'm currently trying to create an app from my WordPress site but when I do, I'm running into the issue of the header, right sidebar, and footer showing. I'd ultimately like to hide these if they appear within a window without a URL option. I'm not even sure that's viable.

What's happening is that the app maker is pulling in pages from my WordPress site and displaying like an app. Except for the header, sidebar, and footer unnecessarily being there. I can't hide these based on screen because I still want people with mobile devices to be able to see if they're looking on a browser window.

答: You could tell the app maker to call the url with an extra param like ?hide_ui=1 and then in your site use JS to check if that param is present in the url and hide the elements you don't want visible in the app.


问:
How to add drop shadow to TextFormField In Flutter
I have a text form field in flutter I want to add a drop shadow to it. how should I do that?</p>
```<code> final password = TextFormField(
    obscureText: true,
    autofocus: false,
    decoration: InputDecoration(
        icon: new Icon(Icons.lock, color: Color(0xff224597)),
        hintText: 'Password',
        fillColor: Colors.white,
        filled: true,
        contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
        enabledBorder: OutlineInputBorder(borderRadius:BorderRadius.circular(5.0),
        borderSide: BorderSide(color: Colors.white, width: 3.0))
     ),
   );
</code>```

答:
The problem when we use a Container, Material or any other Widget to wrap the input text field in order to apply the shadow is if we use the hint text, error text or any other property that change the size of our textbox, the design would be broken.

Intead of wrapping the input in another widget you could use custom painter extending the InputBorder class.
For example:

```<code>class MyInputBorder extends OutlineInputBorder {}
</code>```

Copy the following methods from the OutlineInputBorder implementation (Used for this example) to your new class:
_gapBorderPath
_cornersAreCircular
paint

Then in the paint method you could add the following lines

```<code>Path path = Path();
path.addRRect(center);
canvas.drawShadow(path, Colors.black, 4, true);
</code>```

The above lines must be included before the canvas.drawRRect line:
Example:

```<code>if (gapStart == null || gapExtent <= 0.0 || gapPercentage == 0.0) {
  // paint the shadow for the outlined shape
  Path path = Path();
  path.addRRect(center);
  canvas.drawShadow(path, shadowColor!, elevation, true);

  canvas.drawRRect(center, paint);
} else {... other code omitted to keep simple}
</code>```

Then, in your Widget, use the new Input border:

```<code>TextField(
         decoration: InputDecoration(
           border: MyInputBorder()
         ),
       )
</code>```

The result produced looks like the following without any of the issues of wrapper solutions:

text box with shadow

Here is a complete sample implementation, the post is in spanish but it has the idea explained: Full article for reference

Body:
I have a text form field in flutter I want to add a drop shadow to it. how should I do that?

 final password = TextFormField(
    obscureText: true,
    autofocus: false,
    decoration: InputDecoration(
        icon: new Icon(Icons.lock, color: Color(0xff224597)),
        hintText: 'Password',
        fillColor: Colors.white,
        filled: true,
        contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
        enabledBorder: OutlineInputBorder(borderRadius:BorderRadius.circular(5.0),
        borderSide: BorderSide(color: Colors.white, width: 3.0))
     ),
   );

Body:
The problem when we use a Container, Material or any other Widget to wrap the input text field in order to apply the shadow is if we use the hint text, error text or any other property that change the size of our textbox, the design would be broken.

Intead of wrapping the input in another widget you could use custom painter extending the InputBorder class.
For example:

class MyInputBorder extends OutlineInputBorder {}

Copy the following methods from the OutlineInputBorder implementation (Used for this example) to your new class:
_gapBorderPath
_cornersAreCircular
paint

Then in the paint method you could add the following lines

Path path = Path();
path.addRRect(center);
canvas.drawShadow(path, Colors.black, 4, true);

The above lines must be included before the canvas.drawRRect line:
Example:

if (gapStart == null || gapExtent <= 0.0 || gapPercentage == 0.0) {
  // paint the shadow for the outlined shape
  Path path = Path();
  path.addRRect(center);
  canvas.drawShadow(path, shadowColor!, elevation, true);

  canvas.drawRRect(center, paint);
} else {... other code omitted to keep simple}

Then, in your Widget, use the new Input border:

TextField(
         decoration: InputDecoration(
           border: MyInputBorder()
         ),
       )

The result produced looks like the following without any of the issues of wrapper solutions:

text box with shadow

Here is a complete sample implementation, the post is in spanish but it has the idea explained: Full article for reference