attaching multiple files in html form and send them in email as attachment but this should be optional

Uncategorized
Question: this site has helped me a lot in creating my form. I am totally new to php and have created my php file by searching so many sites and with lot of help from experts. Please somebody help me in this also. I want to allow user to attach multiple files and send them to me as attachment. I want to keep this as optional i.e. if the user wants he may not attach the files or if he wishes he can attach multiple files and submit. Please help me in this. I am using phpmailer. As I am totally new to php, please let me know the code by making changes in my php file. All the thanks in advance. Saxena. My php is as follows: Answer: Read…
Read More

GLKView : Trouble with offscreen RenderBuffer with Core Animation Layer

Uncategorized
Question: I am trying to attach a renderbuffer following Apples guide Here. My problem is that if try to I create the FBO this way, 2 scenarios happen : a) If I draw any thing or call self.bindDrawable() prior to renderbufferStorage(_:_:), renderbufferStorage will return false, so the whole thing fails b) If I run the two functions below before I call bindDrawable or draw anything, the renderbuffer will be successfully created, but I will get this error when I try to draw : Failed to bind EAGLDrawable: to GL_RENDERBUFFER 2 Failed to make complete framebuffer object 8cd6 private func initFrameBuffer() -> GLuint { var framebuffer_id: GLuint = 0 glGenFramebuffers(1, &framebuffer_id) glBindFramebuffer(GLenum(GL_FRAMEBUFFER), framebuffer_id) return framebuffer_id } private func initRenderBuffer() -> GLuint { var renderBuffer_id: GLuint = 0 glGenRenderbuffers(1, &renderBuffer_id); glBindRenderbuffer(GLenum(GL_RENDERBUFFER), renderBuffer_id);…
Read More

Firebase, Swift: Send a push notification to specific user given device token

Uncategorized
Question: I have a Firebase Swift chat app where I'd like to send a push notification to a specific user. I have already captured and have access to the user's device token. All the references mention having to have a 'web app' to manage this, but I haven't managed to find any specific examples of this. Is it necessary to have a web app to manage push notifications for Firebase? If so, are there any examples of how this can work? Thank you. Answer: Read more
Read More

How to send the output of a GET REST request as body of POST request using Postman

Uncategorized
Question: For our application, we are supposed to write the test scripts which tests our REST api. So I have written individual tests in postman in a collection. When ran individually, all tests pass. Now to run all tests sequentially in a collection, I want the output of first GET request (the response is array of json objects), to pass as input body to next POST request. The following code is written as test in Tests of GET request. var jsonData = JSON.parse(responseBody); postman.setEnvironmentVariable("data", jsonData); postman.setNextRequest("POST request"); I have named my post request as "POST request". But this test is failing. Please let me know if I have done any mistake. Answer: Read more
Read More

android: I want to retrieve an image from firebase and show it in a new activity

Uncategorized
Question: This is how I upload the image to Firebase storage. Every time the app opens, I want to fetch image from storage and display in new activity. StorageReference childRef=mStorage.child(newsnow).child("image3"); UploadTask uploadTask=childRef.putFile(uri3); uploadTask.addOnSuccessListener(new OnSuccessListener() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Toast.makeText(PostNews.this, "uploaded", Toast.LENGTH_SHORT).show(); } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(PostNews.this, "no da", Toast.LENGTH_SHORT).show(); } }); Answer: For retrieving an image from firebase you have to store image URL in your Firebase database. After retrieving an image URL you can use libraries like Picasso, glide and so many others for getting an image from URL. You can prefer this link for more description. Read more
Read More

Regex invalid character in password field [on hold]

Uncategorized
Question: i have a client that raise an error, where my password field throws "field contains invalid character" my regex in my model are ^[a-zA-Zd!@#$%&+ ]*$ He said that the password contains no special character. I tried this regex in my dev but got no error. Can anyone knows if i am doing wrong in my regex that can cause the error. Thanks Answer: "Special" characters are a vague concept, You are allowing the following "special" characters: !@#$%&+ User may have a different opinion about what's "special" characters for example he may enter ^ character or other "special" character. If you need to support all characters you can use [^b]* for example. Read more
Read More

How can I add multiple rows in the same cell – PDF

Uncategorized
Question: I have a text which contains ±50 words. So I want to add it in the same cell here is my code://header $this->SetX(30); $this->Cell(270, 20, "Suggested Improvement ",0, 0, 'C', true); $this->SetX(300); $this->Cell(270, 20, "Current Situation ",0, 0, 'C', true); //data retrieved from DB $this->Ln(20); $this->SetTextColor(0); $this->SetFillColor(19, 68, 160); $this->SetLineWidth(0.25); $this->SetX(30.5); $this->Cell(269, 100,$row1['Suggested Improvement'], 1, 0, 'C', false); $this->SetX(300); $this->Cell(269.5, 100,$row1['Current Situation'], 1, 0, 'L', false); But the problem is that the text is not filled in the cell, it is printed as one line, as it is shown here: How can I make the text to start from the top right and to be filled in this block only? Answer: Think you are using fpdf for php.. Have a look at MultiCell. There you can youse n for…
Read More

Grouping and dividing between the columns

Uncategorized
Question: This question is a follow-up to Group to Group division date bal D 1: 1/31/2013 10 NA 2: 1/31/2013 11 NA 3: 1/31/2013 12 NA 4: 1/31/2013 13 NA 5: 1/31/2013 14 NA 6: 2/28/2013 20 NA 7: 2/28/2013 30 3.000000 8: 2/28/2013 40 3.636364 9: 2/28/2013 50 4.166667 10: 2/28/2013 60 4.615385 11: 3/30/2013 10 NA 12: 3/30/2013 11 0.550000 13: 3/30/2013 12 0.400000 14: 3/30/2013 13 0.325000 15: 3/30/2013 15 0.300000 as per the below: library(data.table) # CRAN version 1.10.4 used setDT(bb)[, D := bal / shift(bal, 6L)][seq(1L, nrow(bb), 5L), D := NA][] Now my questions is: at every 4th and 5th of each group, the answer should print 100%, that means, for 9th, 10th, 14th and 15th, and so on, the values under D should be…
Read More

Vision with camera live stream and ARKit

Uncategorized
Question: I'd like to implement an scenario like this: to use a camera live stream with Vision to detect some rectangles, then to process this output according to some logic, then to display AR elements according to the logic output with ARKit. The examples I've found don't cover this full process from Vision live stream detection to ARKit with SpriteKit, but for those "steps" separatedly. The one I found for live stream with Vision is using a UIImageView for that. Other ones I found for ARKit with SpriteKit are using an ARSKView for that. Which the best way to integrate all this in a stepped process Vision -> logic -> ARKit would be? Answer: Read more
Read More