Saturday, July 9, 2022

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow


I can't quite understand how this while loop works (python)

Posted: 09 Jul 2022 09:42 PM PDT

This code essentially prompts the user to enter their name and say hello to them and if no value is entered by the user is keeps on prompting for their name .

name = None

while not name:

name = input('what is your name ? ')  

print('hello '+name)

How does this while loop work , Because as I can understand this while loop checks if the variable name is not null then the condition for the loop is true and keeps on going but how is it not working like that .

How do I save patterns automatically in p5.js?

Posted: 09 Jul 2022 09:41 PM PDT

So, I've been playing around with codes to generate patterns. Now I'm getting decent patterns right now but I'd like to save them to compare them with another version. Currently, patterns keep generating themselves when I play it on Processing.

My question is how do I automatically save like x number of patterns in Processing?

openie :FileNotFoundError: [Errno 2] No such file or directory: '/tmp/openie/out.txt'

Posted: 09 Jul 2022 09:41 PM PDT

I use openie tool to extract triples, but this error is reported when I run two py files at the same time to extract triples, how should I deal with it? enter image description here

enter image description here

enter image description here

Python Pandas - Drop duplicate if one duplicate cell contains one value, and the other duplicate contains another

Posted: 09 Jul 2022 09:41 PM PDT

So I have this type of dataset while working in python with pandas:

    id   pos    result  0   1     1       AB  1   1     1       --  2   1     1       BC  3   1     1       AB  4   1     2       CA  5   2     1       CA  6   2     2       --  7   2     2       BA  8   3     1       --  9   3     1       --  

Desired result:

    id   pos    result  0   1     1       AB    2   1     1       BC  3   1     1       AB  4   1     2       CA  5   2     1       CA    7   2     2       BA  8   3     1       --  9   3     1       --  

I would like to drop duplicate rows on [id] AND [pos] where the result are '--', but only if there already exist a result on the same [id] AND [pos] that has a A, B or C combination.

If no A, B or C combination exist on the same [id] AND [pos], then I want to keep the result '--'.

I know how to drop duplicate rows, but this problem is really beyond my knowledge and I am hoping for your help.

Switching pages in WPF application - Page cannot save data

Posted: 09 Jul 2022 09:40 PM PDT

The program needs to achieve multi-page switching, I used ContentControl and Page. However, in the test, it was found that when switching from Page1 to Page2 and then back to Page1, the data inside will not be saved.

Code:

In MainWindow.xaml:

<ContentControl x:Name="ShowPage" Height="450" Width="770"/>  

In MainWindow.xaml.cs:

private void OpenHomePage(object sender, RoutedEventArgs e) //A button event  {      Pages.Home Home = new Pages.Home();      ShowPage.Content = new Frame() { Content = Home };  }  

E.g: I enter "123" in the text box in Page1, I switch to Page2 and then go back to Page1, the content of the text box will disappear, and the "123" I entered is not saved.


Is there any way to save the entered data?

How to Add Target OS in Visual Studio?

Posted: 09 Jul 2022 09:40 PM PDT

I want to add linux as one of the target OS, how can I do that?

enter image description here

How to make auto posting in facebook group with Imacros?

Posted: 09 Jul 2022 09:44 PM PDT

I have an issues when make auto [posting on Facebook with imacros. I use palemoon 29.1.1 and imacros 8.9.7 I want to filter just open group on facebook, how I can filter it?

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES
SET!ERRORCONTINUE YES SET !DATASOURCE_LINE {{!LOOP}} SET !LOOP 1 SET !TIMEOUT_STEP 1 SET !TIMEOUT_TAG 1 SET !EXTRACT_{{{!col1}}}_POPUP NO SET !DATASOURCE list group.txt

SET !VAR1 EVAL("var letters = ['WINLIVE4D Game Slot Online Terpercaya 2022','WINLIVE4D slot online deposit pulsa tanpa potongan'];var string = ''; for(var i = 0; i < 1; i++){string += letters[parseInt(Math.random() * 2)]}; string")

wait seconds=5 'group target URL GOTO=https://mbasic.facebook.com/search/groups/?q={{!col1}} wait seconds=5

' click group TAG POS=1 TYPE=DIV ATTR=CLASS:cg wait seconds=5

'content TAG POS=1 TYPE=TEXTAREA FORM=ID:mbasic-composer-form ATTR=ID:u_0_0_* CONTENT={{!VAR1}} wait seconds=5

'submit TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:mbasic-composer-form ATTR=ID:u_0_* TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:mbasic-composer-form ATTR=NAME:view_photo wait seconds=5

'input picture

TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:/composer/mbasic/?csid=* ATTR=NAME:file1 CONTENT=C:\Users\USER-\Downloads\WD.jpeg wait seconds=2 TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:/composer/mbasic/?csid=* ATTR=NAME:file2 CONTENT=C:\Users\USER-\Downloads\JEPE.jpeg TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/composer/mbasic/?csid=* ATTR=NAME:add_photo_done > wait seconds=5

'posting TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:composer_form ATTR=NAME:view_post wait seconds=8

Why does using FixedUpdate makes my object stutter?

Posted: 09 Jul 2022 09:38 PM PDT

I'm having a problem with my object when it jumps. I'm working with this code (I'm using unity):

public CharacterController controller;        public float speed = 12f;    public float gravity = -9.81f;    public float jumpHeight = 10f;        public Transform groundCheck;    public float groundDistance = 0.4f;    public LayerMask  groundMask;               Vector3 velocity;    bool isGrounded;        // Update is called once per frame    void Update ()     {        isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask);            if(isGrounded && velocity.y < 0)        {            velocity.y = -2f;        }            float x = Input.GetAxis("Horizontal");        float z = Input.GetAxis("Vertical");            Vector3 move = transform.right * x + transform.forward * z;                controller.Move(move * speed * Time.deltaTime);            if(Input.GetButtonDown("Jump") && isGrounded)        {            velocity.y = Mathf.Sqrt(jumpHeight * -4f * gravity);        }          velocity.y += gravity * Time.deltaTime;            controller.Move(velocity * Time.deltaTime);    }  

It works perfectly for what I want, a third person character movement, however, when I play on a lower framerate, the jump height is smaller, so instead of multiplying gravity and velocity by Time.deltaTime on void Update, I moved that operation to void FixedUpdate(), so the code look like this:

void FixedUpdate()     {        velocity.y += gravity * Time.deltaTime;            controller.Move(velocity * Time.deltaTime);    }  

It works perfect too and the jump height is consistent on different framerates! but when my character jumps it stutters while it's on air, there's no stutter in any other action, only when it jumps. I'd like to know why it Stutters and if there's a solution for this problem.

How to make /(movie) for Netflix type site

Posted: 09 Jul 2022 09:37 PM PDT

I'm making a Netflix type site and for movies I want to make like a system (all html CSS and js) where on the movie select I can add an image name description rating length genre and tags. So what I want is to save time by creating a simple page with placeholder images and text on like web.com/movie name and takes data from the movie select (name description rating genre length and tags) and creates the page for me like for example the movie name is hello then I put on movie select hello, 1hour, romance, description and it just makes the page web.com/movies/hello and all I have to do is create the simple movie select screen. Hopefully not too complicated put shortly: I make details on a /movieselect and it makes a custom page for the movie /movie/hello. Thank you

Error in pom.xml org.springframework.boot:spring-boot-starter-parent:pom:2.2.7.RELEASE failed to transfer from http://ohisnapscmnxs01:/ during a

Posted: 09 Jul 2022 09:37 PM PDT

Multiple annotations found at this line: - Project build error: Non-resolvable parent POM for net.javaguides:springboot-thymeleaf-crud-web-app:0.0.1-SNAPSHOT: org.springframework.boot:spring-boot-starter-parent:pom:2.2.7.RELEASE failed to transfer from http://ohisnapscmnxs01:8081/repository/all-group/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus-all has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.7.RELEASE from/to nexus-all (http:// ohisnapscmnxs01:8081/repository/all-group/): ohisnapscmnxs01 and 'parent.relativePath' points at no local POM - Non-resolvable parent POM for net.javaguides:springboot-thymeleaf-crud-web-app:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.2.7.RELEASE from/to nexus-all (http://ohisnapscmnxs01:8081/repository/all-group/): ohisnapscmnxs01

How to set sensitivity header in eml file for Outlook?

Posted: 09 Jul 2022 09:35 PM PDT

I'm trying to write an email via a dynamically created eml file with JavaScript.

I've modified this code to my needs from another SO answer but I'm not sure why Sensitivity and Priority headers are not working when I open the file with Outlook. In Outlook I see differently named sensitivity levels compared to rfc2156 (company set or Outlook?): "public", "internal", "confidential", and "strictly confidential". Not sure if that's important.

I've tried all possible combinations, with or without double quotes, etc but so far nothing seems to set either headers. I can see them If I read the eml in text editor but when I open the file in Outlook I just see the default settings being applied.

I'm using Outlook version 2102.

const emailBody = "<html><body><b>hello</b> world</body></html>";    let emlHeader = "data:message/rfc822 eml;charset=utf-8,";  emlHeader += `From: guy1@mail.io\n`;  emlHeader += `Subject: Sensitive message\n`;  emlHeader += `To: guy2@mail.io\n`;  emlHeader += `Bcc: guy2@mail.io\n`;  emlHeader += `Date: Sun, 10 Jul 2022 03:54:14 +0000\n`;  emlHeader += "Priority: Urgent\n";  emlHeader += "Sensitivity: Private\n";  emlHeader += "X-Unsent: 1\n";    const emlString = `${emlHeader}\n\n${emailBody}`;    const emlContent = encodeURI(emlString); //encode spaces etc like an url  const a = document.createElement("a"); //make a link in document  a.href = emlContent;  a.id = "fileLink";  a.download = "filename.eml";  a.style = "display:none;"; // hidden link  document.body.appendChild(a);  document.getElementById("fileLink").click(); //click the link  

Reorder and Group Multiple Columns by Regex/pattern

Posted: 09 Jul 2022 09:43 PM PDT

I have the following:

a_aa a_ab a_ac b_aa b_ab b_ac  2    3    3    3     1    2  3    4    1    1     3    1  

Desired outcome:

a_aa b_aa a_ab b_ab a_ac b_ac  2    3    3    1     3    2  3    1    4    3     1    1  

Code with data:

d <- "a_aa a_ab a_ac b_aa   b_ab b_ac  2    3    3    3     1    2  3    4    1    1     3    1"  dd <- read.table(textConnection(object = d), header = T)  

My current solution is manual:

    dd %>% select(a_aa, b_aa, a_ab, b_ab, a_ac, b_ac)  

however, is onerous when number of columns is large. Any ideas how to do this kind of column ordering with grouping (e.g. sequence a_etc1, b_etc1, a_etc2, b_etc2)? Thank you!

Give me Java encoded solution? [closed]

Posted: 09 Jul 2022 09:41 PM PDT

Encoded String: ETEwSFQ6JCNJGBct

(Decode Method)

"Saved Directory: main/com/a/a/a/a/a.java"

package com.a.a.a.a;  import android.util.Base64;  import java.io.UnsupportedEncodingException;    public final class a {      public static String a(String str) {          return new a().a(str, "UTF-8");      }        private static byte[] a(byte[] bArr, String str) {          int length = bArr.length;          int length2 = str.length();          int i = 0;          int i2 = 0;          while (i < length) {              if (i2 >= length2) {                  i2 = 0;              }              bArr[i] = (byte) (bArr[i] ^ str.charAt(i2));              i++;              i2++;          }          return bArr;      }        public String a(String str, String str2) {          try {              return new String(a(Base64.decode(str, 2), str2), "UTF-8");          } catch (UnsupportedEncodingException unused) {              return new String(a(Base64.decode(str, 2), str2));          }      }  }  

"Saved Directory: main/com/project/simple/MainActivity.java"

package com.test.sample;    import com.a.a.a.a.a;  import java.util.Base64;  import java.io.UnsupportedEncodingException;    public class Main{      public static void main(String[] args) {      String en_cont = "ETEwSFQ6JCNJGBct";      System.out.println(a.a(en_cont));  }  }  

Output: Developed By

I need same encoded method?

Example: Developed By => ETEwSFQ6JCNJGBct

Cannot convert IActivity<Animal> to IActivity<Dog>

Posted: 09 Jul 2022 09:38 PM PDT

The only class we can modify is the generic Executor below. I want an executor of type Dog to be able to invoke not only an activity of type Dog but also an activity of type Animal.

My code below fails to do so

var executorDog = new Executor<Dog>();  var animalActivity = new AnimalActivity();  executorDog.Execute(animalActivity);  

with the following error:

error CS1503: Argument 1: cannot convert from 'AnimalActivity' to 'IActivity<Dog>'  

How to fix it?

using System;    class Animal { }  class Dog : Animal { }    interface IActivity<T>  {      void Eat();  }    class Activity<T> : IActivity<T>  {      public virtual void Eat() { }  }    class DogActivity : Activity<Dog>  {      public override void Eat()      {          Console.WriteLine("Dog is eating...");      }  }    class AnimalActivity : Activity<Animal>  {      public override void Eat()      {          Console.WriteLine("Animal is eating...");      }  }      class Executor<T> where T : Animal  {      public void Execute(IActivity<T> activity)      {          activity.Eat();      }  }    class Program  {      static void Main()      {          var executorDog = new Executor<Dog>();          var animalActivity = new AnimalActivity();          executorDog.Execute(animalActivity);      }  }  

How to add a link to the typewriter effect in react?

Posted: 09 Jul 2022 09:37 PM PDT

I am using the typewriter effect in react, and want to add a link to the second line (where is says "learn more about me") so that when you click it it sends the user to the about me page, but I am confused as to how to do it. I tried using href or onclick but neither work. please help.

<Typewriter

onInit={(typewriter)=> {

typewriter

.typeString("Hi")

.pauseFor(1000)

.deleteAll()

.typeString("Learn More about me")

.start();

}}

/>

Missing statement body in do loop: MissingLoopStatement

Posted: 09 Jul 2022 09:38 PM PDT

I'm trying to follow this tutorial and encountered this error:

MissingLoopStatement error in Do loop in Powershell

Command:

`for file in images/*; do cwebp -q 50 "$file" -o "${file%.*}.webp"; done`  

Selenium does not recognize pop up as existing

Posted: 09 Jul 2022 09:37 PM PDT

try: WebDriverWait(driver, 30).until(EC.alert_is_present())

        obj=driver.switch_to.alert          obj.dismiss()      except NoSuchElementException:                 pass  

Unfortunately pop up stays on the screen and 30 seconds passes resulting in a time out. Any advice would be appreciated!

Associating string positions before and after changes

Posted: 09 Jul 2022 09:40 PM PDT

I have a UTF-8 string with multi line text. I perform some preprocessing on it that changes lengths and adds/removes characters.
Something like replacing \r\n with \n.
How do I associate positions in the new string with positions in the old so my code would be able to say "invalid syntax at position X" and that position would be in the original string so the user would have no issues finding the character that triggered the error?

How does bash handles control characters

Posted: 09 Jul 2022 09:44 PM PDT

I'm writing a shell that tries to simulate bash's behaviour. The problem is that I've read that when Bash gets the user input, it uses a non-canonical mode and turn off the ECHO kind of like this :

(*conf)->newterm.c_lflag &= ~(ICANON | ECHO);  

But if it turns ECHO off, how is SIGINT still displayed as ^C on the temrinal ? When I try this, I get the character which is -1 (if you try to print it).

If we pay enough attention to bash behaviour, control characters are never displayed except for ctrl-c AKA SIGINT. My only theory is that bash hard coded ^C and just print it to the screen when SIGINT is detected. Am I right saying this ? Of not, how does BASH or ZSH display ^C having ECHO and ICANON turned off ? I've looked everywhere and I really can't seem to find an answer to this...

Thank you for your time and your explanation !

How to set static alinment in Flutter in blue thermal printer

Posted: 09 Jul 2022 09:43 PM PDT

The first time I print it is correct but on the second and third try it is wrong. What is my problem and how to solve it.. Please help me

pubspec.yaml => blue_thermal_printer: ^1.2.0 | screenshot: ^1.2.3

scan image

final screenshotController = ScreenshotController();  final bluetooth = BlueThermalPrinter.instance;  
Screenshot(    controller: screenshotController,    child: Container(      width: 256,      // color: Colors.white,      decoration: BoxDecoration(        border: Border.all(color: Colors.black),        color: Colors.white,      ),      child: Column(        mainAxisAlignment: MainAxisAlignment.start,        crossAxisAlignment: CrossAxisAlignment.start,        mainAxisSize: MainAxisSize.max,        children: [          Center(            child: Column(              children: [                Image.asset(                  'assets/logo/logo2.png',                  height: 100,                  alignment: Alignment.topCenter,                ),                ... some widgets  
ElevatedButton(    onPressed: () async {      var imageTextRawUint8List = await screenshotController.capture() ?? Uint8List(0);        bluetooth.isConnected.then((isConnected) async {        if (isConnected??false) {          bluetooth.printImageBytes(imageTextRawUint8List);            bluetooth.printNewLine();        }else{          Get.to(BTDeviceScreen());          log("error");        }      });    },    child: Text("print"),  )  

Writing list of data in excel file using JAVA is entering the data only in the last column

Posted: 09 Jul 2022 09:41 PM PDT

I am iterating through a list of data which I am sending from the runner file(FunctionVerifier.java). When I am calling the function writeExcel() in excelHandler.java it is entering only the last data from the list that I am iterating through.

Can someone please let me know the reason and how to fix this

This is the final output from my code I am getting

public void writeExcel(String sheetName, int r, int c, String data) throws IOException {      file = new FileInputStream(new File(inFilePath));      wb = new XSSFWorkbook(file);      Sheet sh;      sh = wb.getSheet(sheetName);      Row row = sh.createRow(r);      row.createCell(c).setCellValue(data);      closeExcelInstance();      FileOutputStream outputStream = new FileOutputStream(inFilePath);      wb.write(outputStream);      wb.close();      outputStream.close();  }    public void closeExcelInstance() {      try {          file.close();      } catch (Exception e) {          System.out.println(e);      }  }  

FunctionVerifier.java

    package Sterling.oms;    import Sterling.oms.Process.CouponValidationProcess;  import Sterling.oms.Utilities.ExcelHandler;    import java.util.ArrayList;    public class FuncVerify {      public static void main(String args[]) throws Exception {            String filePath = System.getProperty("user.dir") + "/src/test/resources/TestData/test.xlsx";          ExcelHandler excelHandler = new ExcelHandler(filePath);          excelHandler.readExcelData("Validation");          CouponValidationProcess couponValidationProcess = new CouponValidationProcess("OMS-T781");          excelHandler.createSheet();  //        couponValidationProcess.enterValidationHeaderRowInExcel(filePath);          String sheet = "ValidationData";          if (excelHandler.getRowCountWhenNull(sheet) < 1) {              ArrayList<String> header = new ArrayList<>();              header.add("Test Case");              header.add("Coupon ID");              header.add("Grand Total");              header.add("Manual Grand Total");              for (int i = 0; i < header.size(); i++) {  //                excelHandler = new ExcelHandler(filePath);                  excelHandler.writeExcel(sheet, 0, i, header.get(i));  //                excelHandler.closeExcelInstance();              }          }      }  }  

All possible binary trees storing a value

Posted: 09 Jul 2022 09:43 PM PDT

I want to write a function allTrees to generate a list of all possible binary trees that store the number of leafs each tree has:

Here are my data types and my attempt of the allTrees function:

data BTree = L | B BTree BTree      deriving (Eq, Ord, Show)    data SpecTree = S Integer BTree      deriving (Eq, Ord, Show)    leafNode :: SpecTree  leafNode = S 1 L    branch :: SpecTree -> SpecTree -> SpecTree  branch (S size1 sub1) (S size2 sub2) = S (size1 + size2) (B sub1 sub2)    allTrees :: [SpecTree]  allTrees = leafNode : [branch b1 b2 | b1 <- recursive , b2 <- recursive]      where recursive = allTrees    

Expected output: take 9 allTrees = [S 1 L,S 2 (B L L),S 3 (B L (B L L)),S 3 (B (B L L) L),S 4 (B L (B L (B L L))),S 4 (B L (B (B L L) L)),S 4 (B (B L L) (B L L)),S 4 (B (B L (B L L)) L),S 4 (B (B (B L L) L) L)]

Actual output: take 9 allTrees = [S 1 L,S 2 (B L L),S 3 (B L (B L L)),S 4 (B L (B L (B L L))),S 5 (B L (B L (B L (B L L)))),S 6 (B L (B L (B L (B L (B L L))))),S 7 (B L (B L (B L (B L (B L (B L L)))))),S 8 (B L (B L (B L (B L (B L (B L (B L L))))))),S 9 (B L (B L (B L (B L (B L (B L (B L (B L L))))))))]

My output is close but not quite it. Please help me fix allTrees.I think foldM may be useful here, but not sure how I can use it.

Reference ephemeral external IP address in startup script for compute engine

Posted: 09 Jul 2022 09:43 PM PDT

Is there a special variable that references the assigned ephemeral external IP address so I can define it in the startup script?

How build lib for 386 arch with cgo on windows?

Posted: 09 Jul 2022 09:38 PM PDT

I have a golang library that builds and works well on Linux, MacOs and Windows. The problem comes when I'm trying to build it for 386 on the amd64 Windows VM. I've installed latest golang SDK and mingw, which makes amd64 build work fine, but not the 386:

PS > gcc -v  gcc.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0    PS > go version  go version go1.18.3 windows/amd64        PS > $Env:GOOS = "windows"; $Env:GOARCH = "386"; $Env:CGO_ENABLED ="1"; go build -v -buildmode=c-shared -ldflags="-s -w" -gcflags="-l" -o xyz_amd64.dll xyz_win_dll.go  ...  runtime/cgo  c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/pro  gramdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/libmingwthrd.a when searching for -lmingwt  hrd  ...  <a lot of skipping incompatible messages here>  collect2.exe: error: ld returned 1 exit status  

How to fix it? AFAIK it should be possible to build for both arch on the same box.

React Native Javascript -> How can I split a complicated string?

Posted: 09 Jul 2022 09:37 PM PDT

I'm trying to create a (fake) banking application for a school assignment. I'm at the stage where I need to display the transaction history of that account.

To store the history I'm using a single string (ik this will get long, but its just a demo). However the issue is that I've tried using .split() and all of that but my string is complicated.

Example string: July 6, 2022|email2@email.com|description|-200~July 3, 2022|email@email.com|another description|+200~ So each individual transaction is split by '~' and each variable within each transaction (date, email, des, amount) is split by the '|'.

This needs to loop for all the transaction within the loop.

Anyone have an idea of the logic, and some syntax that I could use? Thanks in advance

What I've got so far (txnHistory is the initial string):

    txnHistory.split('~').forEach( () => {          //console.log(items) // splits array into line. Each line is one transaction          var eachLine = txnHistory.split('|')          //console.log(eachLine)          var xdate = eachLine[0]          //setTodayDate(xdate)          var xemail = eachLine[1]          var xdes = eachLine[2]          var xam = eachLine[3]          console.log(xdate, xemail, xdes, xam)      }, []);  

enter image description here

            <SafeAreaView>                  <View>                      <Text style={{fontFamily:'Ubuntu_500Medium', fontSize:25, left: Dimensions.get('window').width/5.5,                               marginVertical:7,}} >                          {xdate}                      </Text>                      <Text style={{fontFamily:'Ubuntu_500Medium', fontSize:20, left: Dimensions.get('window').width/3.5,                               marginVertical:3,}}>                          {xemail}                      </Text>                                                <Text style={{fontFamily:'Ubuntu_400Regular',fontSize:25, left: Dimensions.get('window').width/2.7,                               marginVertical:3,}}>                          {xdes}                      </Text>                  </View>                    <Text style={{fontFamily:'Ubuntu_700Bold', fontSize:25, left: Dimensions.get('window').width/1.3,                           marginVertical:5, bottom:35, color: '#8c8b8b', textShadowColor:'#00fa36', textShadowRadius:5, }}>                      ${xam}                   </Text>              </SafeAreaView>  

How do I send a DM to a user in discord.js v13

Posted: 09 Jul 2022 09:37 PM PDT

All I'm doing right now is trying to send a dm to myself to see if I can get this working. I've tried:

client.users.cache.get(id).send('hi')
But I'm getting "TypeError: Cannot read properties of undefined (reading 'send')." I suppose this has something to do with myself not being cached, but I'm unsure how to go about caching myself. Does anyone know how to properly do this?

npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC

Posted: 09 Jul 2022 09:37 PM PDT

I tried to create React app in VS Code by using below code. I got this error "npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC" Node version: v14.18.1 npm version: 8.1.0 OS: windows 10 VS code: 1.16.0

PS D:\React-Projects> npx create-react-app first-app

Creating a new React app in D:\React-Projects\first-app.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC npm ERR! 10796:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:677: npm ERR!

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\bizwe\AppData\Local\npm-cache_logs\2021-10-16T08_13_20_686Z-debug.log

Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... node_modules Deleting generated file... package.json Deleting first-app/ from D:\React-Projects Done.

I tried all solutions given in stack overflow, but none of them is worked, Anybody help me please.

How can I get Unity to automatically add the Sign In With Apple capability when compiling for iOS?

Posted: 09 Jul 2022 09:39 PM PDT

I have been Googling for hours and trying every variation of this code that I can think of but I haven't been able to get the Sign In With Apple capability to be added automatically.

I have tried examples from this Github project: https://github.com/lupidan/apple-signin-unity/blob/master/AppleAuth/Editor/ProjectCapabilityManagerExtension.cs

I have been following these posts: https://forum.unity.com/threads/how-to-put-ios-entitlements-file-in-a-unity-project.442277/

https://answers.unity.com/questions/1224123/enable-push-notification-in-xcode-project-by-defau.html

An entitlements file without this capability looks like this:

<?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  <plist version="1.0">  <dict>  </dict>  </plist>  

And one with the capability looks like this:

<?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  <plist version="1.0">  <dict>      <key>com.apple.developer.applesignin</key>      <array>          <string>Default</string>      </array>  </dict>  </plist>  

I have tried to guestimate with this code:

proj.AddBuildProperty(target, "SystemCapabilities", "{com.apple.developer.applesignin = [Default];}");  proj.AddCapability(target, PBXCapabilityType.SignInWithApple, relativeDestination, true);  

But none of these modify the entitlements file or add the capability.

I treid using the ProjectCapabilityManager with this:

ProjectCapabilityManager capabilityManager = new ProjectCapabilityManager(buildPath, filename, targetName);  capabilityManager.AddSignInWithApple();  capabilityManager.WriteToFile();  

But I get an error message in the console saying that access was denied to the buildPath (which was provided by OnPostProcessBuild())

I could really use some help.

sqldf - Alter syntax to add new column to data frame

Posted: 09 Jul 2022 09:36 PM PDT

I want to add a new field to a data frame by sqldf.

> data(mtcars)  > library(sqldf)  > sqldf("alter table mtcars add newfield  int not null")  Error in result_create(conn@ptr, statement) :     Cannot add a NOT NULL column with default value NULL  >   > sqldf("alter table mtcars add newfield  int")  data frame with 0 columns and 0 rows  Warning message:  In result_fetch(res@ptr, n = n) :    Don't need to call dbFetch() for statements, only for queries  

I get an empty data frame from the last command. The sql expression seems ok. But I don't know what is going wrong.

Making text box hidden in ASP.NET

Posted: 09 Jul 2022 09:37 PM PDT

I am using ASP.NET 3.5 and C#.

On my page I need to have a Text box that must not be visible to the user but it MUST be there when you look at the Page Source, reason being, another program called Eloqua will be looking at the page source and it must get the value of that text box.

The value of that text box will be populated based on what the user selects.

Thus, I cant set the text box property to Visible = False because then it will not be in the source HTML and I can't set the Enabled = False because I do not want the user to see the text box.

Is there some property I can use to make this text box hidden to the user but still visible in the page source?

My ASP.NET text box

<asp:TextBox ID="txtTester" runat="server"></asp:TextBox>  

No comments:

Post a Comment