Posts

Showing posts from September 7, 2018

Angular runtime error calling a function inside the render() loop: 'undefined is not an object (evaluating this.watchLocation)'

Image
Clash Royale CLAN TAG #URR8PPP Angular runtime error calling a function inside the render() loop: 'undefined is not an object (evaluating this.watchLocation)' I am creating an ionic-native Angular app, using three.js and I can't call any function inside the render loop. I have tried using different forms for the watchLocation function, such as including it inside the 'init3D' method, but the full watchLocation() method uses ionic-native plugins which do not work if I declare the function inside the function that calls it. I have looked at all the other questions on stack overflow, but those methods did not work for this application. I think the problem is in the creation of the 'watchLocation' method or with calling another function within the render loop of a three.js application. Here is the code (with the changes suggested by @UncleDave): import Component, Input, Renderer from '@angular/core'; import STLLoader from "./stlloader"; imp...

How to make a phone call using intent in Android?

Image
Clash Royale CLAN TAG #URR8PPP How to make a phone call using intent in Android? I'm using the following code to make a call in Android but it is giving me security exception please help. posted_by = "111-333-222-4"; String uri = "tel:" + posted_by.trim() ; Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse(uri)); startActivity(intent); permissions <uses-permission android:name="android.permission.CALL_PHONE" /> Exception 11-25 14:47:01.661: ERROR/AndroidRuntime(302): Uncaught handler: thread main exiting due to uncaught exception 11-25 14:47:01.681: ERROR/AndroidRuntime(302): java.lang.SecurityException: Permission Denial: starting Intent act=android.intent.action.CALL dat=tel:111-333-222-4 cmp=com.android.phone/.OutgoingCallBroadcaster from ProcessRecord43d32508 302:com.Finditnear/10026 (pid=302, uid=10026) requires android.permission.CALL_PHONE 11-25 14:47:01.681: ERROR/AndroidRuntime(302): at android.os.Parcel....

signup using retrofit and handle radiobutton & spinner

Image
Clash Royale CLAN TAG #URR8PPP signup using retrofit and handle radiobutton & spinner How to handle RadioButton and Spinner in user registration using retrofit. RadioButton Spinner RadioButton is user type (professional, Visitor) and Spinner is list having user type category how to pick data from both using retrofit for user registration .... need help RadioButton Spinner Design Screen import android.content.Intent; import android.os.Build; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Patterns; import android.view.View; import android.view.Window; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Spinner; import android.widget.Toast; import com.example.saadhashmi.docdirect.Interface.RetrofitClient; import com.example.saadhashmi.docdirect.R; import java.io.IOException; import java.uti...

How to schedule the orders Export in BigCommerce?

Image
Clash Royale CLAN TAG #URR8PPP How to schedule the orders Export in BigCommerce? How can we schedule the orders to be exported into FTP for every 1 hour in the big commerce? I can export it manually but i need something to run automatically to export the orders data to FTP.Is it possible in BigCommerce? Thanks, Manoj 2 Answers 2 You could write a script to pull orders from the API on an hourly interval (or even better, respond to orders as they come in by using webhooks). If you needed to retrieve the orders from a folder in WebDAV, you could also automate the browser with Selenium to do regular order exports. Webhooks really seems like the way to go here. store/order/created is the one you want: developer.bigcommerce.com/api/v2/#order-products-array – Scott C Wilson Apr 4 at 15:18 At this time you are not able to schedule downloads from the FTP. You can write your own program to do that. We also offer webhooks where you can get order notifications in almost r...

DP coin change with exact number of coins [closed]

Image
Clash Royale CLAN TAG #URR8PPP DP coin change with exact number of coins [closed] I have 1 to n coins.How many ways i can get n by using 1 to n coins exact k of them??For example I have to make 3 with 1,2,3 coins using exactly 2 coins. There are four ways: (3,0) (1,2) (2,1) (0,3) How can I solve this iteratively? I've solved it recursively. Here is the code: https://paste.ubuntu.com/p/C5sgF8JK23/ Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question. I'm voting to close this question as off-topic because it is not a programming question. (And if it was, no, we won't write all the code for you. Give it a try. Post here if you're truly stuck and can't find answers after searching.) – Mat Aug 10 at 15...

PayPal payments were created but were never executed

Image
Clash Royale CLAN TAG #URR8PPP PayPal payments were created but were never executed I am using paypal-rest-sdk@1.8.1 for Node.js. I have created the payments and saved their payerId, token and paymentId, but I never executed those payments. var paypal = require('paypal-rest-sdk'); paypal.configure( 'mode': 'live', 'client_id': '_CLIENT_ID_', 'client_secret': '_CLIENT_SECRET_' ); . . let payment = "intent": "sale", "transactions": [ "item_list": "items": some_items_array, "shipping_address": "recipient_name": "some_recipient_name", "line1": "Fake street", "city": "Fake city", "country_code": "Fake country", "postal_code": "123456", "state": "Fake state", "phone": "0000000" , "amount": "currency": ...

How to pass command line argument to docker run and print it?

Image
Clash Royale CLAN TAG #URR8PPP How to pass command line argument to docker run and print it? I created a .Net core 2.1 console application with docker (linux) support. Here is the system generated Dockerfile . Dockerfile FROM microsoft/dotnet:2.1-runtime AS base WORKDIR /app FROM microsoft/dotnet:2.1-sdk AS build WORKDIR /src COPY MyApp/MyApp.fsproj MyApp/ RUN dotnet restore MyApp/MyApp.fsproj COPY . . WORKDIR /src/MyApp RUN dotnet build MyApp.fsproj -c Release -o /app FROM build AS publish RUN dotnet publish MyApp.fsproj -c Release -o /app FROM base AS final WORKDIR /app COPY --from=publish /app . ENTRYPOINT ["dotnet", "MyApp.dll"] The console program just prints out the argument. ( Console.WriteLine("The args are 0", args); ) Console.WriteLine("The args are 0", args); However, docker run MyApp:dev doesn't print anything. And docker run MyApp:dev ABC got the following error. docker run MyApp:dev docker run MyApp:dev ABC C:Program File...

Woocommerce FIlter Product using color and Category?

Image
Clash Royale CLAN TAG #URR8PPP Woocommerce FIlter Product using color and Category? I am trying to integrate the woocommerce rest APIs with my Applications. All the defaults operations like get all products, get products by category etc are working perfectly fine. but how i apply color filter in my code.? bellow is my code. $data = array( 'category' => $category_ids, 'attribute' => 'Options', 'attribute_term' => 'Blue', 'per_page' => 100, 'page' => 1 ); $temp = ($woocommerce->get('products', $data)); 2 Answers 2 You just have to append 'pa' before your attribute name. so if your using 'color' attribute then it is going to be 'pa_color'.And pass attribute_term id instead of slug or name in 'attribute_term'. After Correction $data = array( 'category' => $category_ids, 'attribute' => 'pa_color', 'attribute_term' => ...

What is a raw type and why shouldn't we use it?

Image
Clash Royale CLAN TAG #URR8PPP What is a raw type and why shouldn't we use it? the java tutorials still use the JComboBox that causes this warning. Which version of the combobox will not cause this warning ? docs.oracle.com/javase/tutorial/uiswing/components/… – SuperStar Apr 2 '13 at 10:04 Note that the reason why raw types exist is for backwards compatibility with Java 1.4 and older, which did not have generics at all. – Jesper May 23 '16 at 8:07 14 Answers 14 The Java Language Specification defines a raw type as follows: A raw type is defined to be one of: The reference type that is formed by taking the name of a generic type declaration without an accompanying type argument list. An array type whose element type is a raw type. A non- static member type of a raw type R that is not inherited from a superclass or superinterface of R . static R R Here's an example to illustrate: public class MyType<E> class Inner static c...