Now this all works, and items are displayed in a listview with a buy button generated when a item is detected as purchasable.
Now what I am confused about is the following:
1.How to induce the payment method from a seperate view controller, i can not see any calls to buy the product from the existing buttons?
2.How would they know what product i was wanting to buy, how is the product reference being passed through when buying a product.
Looking through the code i am struggling to understand these 2 vital elements.
Code attached below
Thanks
Product Cell class, appears to dynamically create buy button in the table view based on the products available from the store import UIKit import StoreKit
RageProducts, contains product identifiers for products in itunes connect
import Foundation
public struct RageProducts {
public static let Item1 = "com.justlift.Recipe1"
public static let Item2 = "com.justlift.Test"
fileprivate static let productIdentifiers: Set<ProductIdentifier> =[RageProducts.Item1,Item2]
public static let store = IAPHelper(productIds: RageProducts.productIdentifiers)
}
func resourceNameForProductIdentifier(_ productIdentifier: String) -> String? {
return productIdentifier.components(separatedBy: ".").last
}
I'm currently trying to queue tasks in App Engine using the Flask framework, but I'm having some difficulty. I run my code, and it seems like the tasks are queued properly when I check the admin server at localhost:8000/taskqueue. However, the console repeatedly print the following error:
`
WARNING 2016-10-05 17:08:09,560 taskqueue_stub.py:1981] Task task1 failed to execute. This task will retry in 0.100 seconds
`
Furthermore, it doesn't seem like the desired code is being executed.
My question is, why isn't my code working? I apologize for the very broad question, however there's no stack trace to guide me through to something more specific. I've simplified my code however to make my error reproducible. The code below should print the phrase "sample task" onto the console 5 times. However, this does not occur.
`
#main.py
from google.appengine.api.taskqueue import taskqueue
from flask import Flask, Response
app = Flask(__name__)
@app.route("/get")
def get():
for i in range(5):
# attempt to execute the desired function 5 times
# the message "sample task" should be printed to the console five times
task = taskqueue.add(
queue_name='my-queue',
url='/sample_task',
)
message += 'Task {} enqueued, ETA {}.<br>'.format(task.name, task.eta)
response = Response(message)
return response
@app.route("/sample_task")
def sample_task():
message = "sample task"
print (message)
return Response(message)
if __name__ == "__main__":
app.run()
`
I am trying to make an application that switches between an image of the heads sign of a coin and the tails side of a coin. However, every time I press either the "heads" button or the "tails" button, an error occurs. How can I fix my code so that the image successfully switches?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace HeadsOrTails
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Image_Loaded(object sender, RoutedEventArgs e)
{
}
private void tailsButton_Click(object sender, RoutedEventArgs e)
{
//create a second bitmap image (tails)
BitmapImage c = new BitmapImage();
c.BeginInit();
c.UriSource = new Uri(@"C:\Users\Raymond Karrenbauer\Documents\Visual Studio 2015\Projects\HeadsOrTails\tails.jpg");
c.EndInit();
var image = sender as Image;
image.Source = c;
}
private void headsButton_Click(object sender, RoutedEventArgs e)
{
//create the new bitmap image (heads)
BitmapImage b = new BitmapImage();
b.BeginInit();
b.UriSource = new Uri(@"C:\Users\Raymond Karrenbauer\Documents\Visual Studio 2015\Projects\HeadsOrTails\heads.jpg");
b.EndInit();
var image = sender as Image;
image.Source = b;
}
private void exitButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}
I am looking for a way to return an ID only if NO rows hold a certain value
For example:
ID | Date
1 | 01/01/2001
1 | 02/02/2002
1 | 03/03/2003
If I want SQL to return the ID only if no dates are equal to 02/02/2002, how would I script that? I have tried and failed with the below:
select ID
from (example)
where date != 02/02/2002
The problem is that this still returns the ID - 1, as the first and last row do not equal 02/02/2002. What I am aiming for is no returned results because at least one row held the matching date.
I would need the script to completely skip the ID when there is a matching date in any row.
For clarity the below should return the ID when using the same 'select' as above because no dates are matching:
I'm designing an android application where a user can enter there address and it will fetch a list of bars/clubs/eateries within a 300 miles radius.
The way it currently works is, The user inputs his/her address and the app sends a call to a RESTful service(asp) which then selects every bar/club/eaterie and checks there distance from the users location, puts any within a 300 mile distance into an array and returns the result as json once it's finished.
The problem is this is really slow because it has to select every bar/club/eaterie from the database and calculate the distance(I have roughly 20k rows of data)
The average response time for the entire process (user clicking search to having the information displayed on there phone) is about 6-8 seconds, I would like to get it down to about 1-2 seconds
Is there a better way to go about this ? having to select all of the records and check the distance for each one is what's causing the issue.
handling large amounts of data using the google maps api