2018-10-22         Mavis

Retrieving YAML parameters during runtime in App Engine (Python)

Is it possible to programmatically retrieve any of the YAML parameters during run-time? Are they stored in the environment somewhere?Good example would be to automatically find the application version and to add it as a comment in the landing HTML page. No, but some of the data is available from os.environ - for example, os.environ['APPLICATION_ID'], and os.environ['CURRENT_VERSION_ID']. [XXX]No (except for what environment settings CGI and WSGI standards mandate). If you need the full contents of app.yaml to use in your code, then I'd recommend keeping a copy of app...

 python                     3 answers                     54 view
 2018-10-22         Mavis

How do I move a user to a specific channel on discord using the discord.py API

Okay, so I know the command to do this but my issue is I do not know what arguments to pass to the parameters. I want my code to take a user's message content and then move the user to a voice channel named "afk". Here is a snippet of my code:All I want to do is move a user that types the words !move in any case to be moved to another voice channel. I am sorry if my code is bad but I just need this down.I know you might need to see my definitions but all it is:def on_message(message): if '!MOVE' in message.content.upper(): author = message.author voice_chan...

 python                     1 answers                     8 view
 2018-10-22         Mavis

when is the defintion of a function checked in class?

class A{ public: int fun1(); int fun2(); void sum() { cout<<fun1()+fun2(); }};class B: public A{ int fun1() { return 1; } int fun2() { return 2; }};int main(){ A x; B y; x.sum();// line 3 y.sum();// line 4 return 0;}Why there is error now?? and Why there is no errors if line 3, line4 are missing?How does the sequence of checks performed?EDIT why doesn't the compiler generate error though there is error when a call to x.sum() is made Why there is error now??Because you have not defined them. ...

 c++                     2 answers                     82 view
 2018-10-22         Mavis

Bidirectional Replication Design: best way to script and execute unmatched row on Source DB to multiple subscriber DBs, sequentially or concurrently?

Thank you for help or suggestion offered. I am trying to build my own multi-master replication on Postgresql 10 in Windows, for a situation which cannot use any of the current 3rd party tools for PG multimaster replication, which can also involve another DB platform in a subscriber group (Sybase ADS). I have the following logic to create bidirectional replication, partially inspired by Bucardo's logic, between 1 publisher and 2 subscribers:When INSERT, UPDATE, or DELETE is made on Source table, Source table Trigger adds row to created meta table on Source DB that will act a...

 postgresql                     1 answers                     52 view
 2018-10-22         Mavis

how to fix Python Error, In description is the the code and the error

How to fix the error in the code, I'm using python 3.7, macOS high sierrainstalled libraries are: sklearn matplotlib numpy. code:import matplotlib.pyplot as pltfrom sklearn import datasetsfrom sklearn import svmimport numpydigits=datasets.load_digits()'''print(digits.data)print(digits.target)print(digits.images[0]) '''clf=svm.SVC(gamma=0.001, C=1.0)print(len(digits.data))x,y = digits.data[:-1],digits.target[:-1]clf.fit(x,y)print('prediction:',clf.predict(digits.data[-1]))plt.imshow(digits.images[-1], cmap=plt.cm.gray_r, interpolation="nearest")plt.show()Error: Traceback (...

 python                     1 answers                     91 view
 2018-10-22         Mavis

Django type object 'Template' has no attribute 'objects'?

i am using Django 1.10.5. this error comes when i click on AttributeError at /rentacar/list/Viewsimportsfrom rentacar.forms import *from template.models import Templatefrom module.models import *@csrf_protectdef rentacar_list(request, page_number=1): menu_config_list = MenuItemRentacarList.objects.all()[0] menu_config = MenuItemRentacarList.objects.get(id=menu_config_list.id) all_cars = Car.objects.all().order_by('-id') if menu_config.menu_item_rentacar_list_show_unavailable == 0: all_cars = all_cars.exclude(car_available=0) else: all_cars = all...

 django                     1 answers                     84 view
 2018-10-22         Mavis

Custom payload in APNS not delivered

We are using APNS to send push notifications to out devices. The payload looks like the following:{ "data":{ "aps":{ "alert":{ "loc-args":["bharathp"], "loc-key":"LiKudoAlertBody", "title-loc-key":"LiKudoAlertTitle" } }, "fromName":"bharathp", "source":"community", "type":"kudos", "message":"{....some dictionary....}", "fromId":"1696757163" },"to":"some string"}But on iOS when I receive the notification I only get the "aps" part of the payload. [AnyHasha...

 ios                     1 answers                     25 view
 2018-10-22         Mavis

Text not showing in pygame

I have two functions in a class called "NPC", which will be used to display a textbox to display text the NPC is meant to be saying. Here is the whole NPC class for context:class NPC(object): def __init__(self, path, x, y): self.image = pygame.image.load(path).convert_alpha() self.x = x self.y = y def spawn(self, surface): surface.blit(self.image, (self.x, self.y)) def text_objects(self, text, font): textSurface = font.render(text, True, white) return textSurface, ...

 python                     1 answers                     82 view
 2018-10-22         Mavis

Combine 2 Tables on 2 columns but different value columns - MS Access

I'm having difficulties merging 2 tables, which each have a different value column and 2 columns that are identical.Table1 has the columns; Proj, Mnth, LeftTable2 has the columns; Project, Mnth, TotalI'm trying to achieve a table that has four columns; Project, Mnth, Left, Total. And aggregates the sums of Left and Total, and groups by project and Mnth so each row is unique with respect to Project and Mnth.SELECT Proj AS Project, Mnth, Left FROM Table1UNION ALLSELECT Project, Mnth, TotalFROM Table2GROUP BY Project, Mnth;This is what I've tried so far, but with no effect. ...

 sql                     1 answers                     7 view
 2018-10-22         Mavis

Displaying data from SQL server on UI or on browser

I am working on an application wherein data flows in the form of trades in SQL server. We have different tables and the data flows down from one table to other every day.I want to develop a kind of UI wherein the daily summary of inflow of data into the database should be shown on a browser. (may be on local hose 8080?)I am a QA and don't have development experience, it would be great if anyone can let me know simplest way to do this? You will need to create functions or stored procedures to collect these for you; there's no tool in SQL that will automagically know what ...

 sql-server                     1 answers                     28 view
 2018-10-22         Mavis

running custom built Kafka streams DSL app returns java.lang.ClassNotFoundException

I'm attempting to read from a kafka topic that contains json data and write to a new topic based on the value of the field "entity". I'm using the following code to read and write from kafkaimport org.apache.kafka.common.serialization.Serde;import org.apache.kafka.common.serialization.Serdes;import org.apache.kafka.streams.KafkaStreams;import org.apache.kafka.streams.KeyValue;import org.apache.kafka.streams.StreamsConfig;import org.apache.kafka.streams.kstream.KStream;import org.apache.kafka.streams.kstream.KStreamBuilder;import java.util.Properties;public class entityDataL...

 java                     1 answers                     43 view
 2018-10-22         Mavis

run in ubuntu 17.10 with (scd mode) published:the specified framework 'Microsoft.AspNetCore.App',version '2.1.1' was not found

publish enviroment:windows 10run enviroment:ubuntu 17.10,.netcore 2.1.2 runtime is installedprojuect .netcore version:2.1Before using cli command published,I added Property int the .csproj file:<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>but after published successfully, found no dependencies packages generated under the publish folder.The same publish action with .netcore 2.0 version project,there will be some folder (eg: de,es,fr,it,ja,ko,ru) generated under publish folder.Is there anybody know how to resolve? I'm sorry,I...

 .net-core                     1 answers                     28 view
 2018-10-22         Mavis

Make Symfony forms use simple GET names

I am currenly creating a simple search form, using Symfony 4.1's form builder. Rendering works great, but I lack a bit of control on the way the request is formed.The generated request looks like:http://localhost:8000/fr/search?advanced_search%5Bquery%5D=test&advanced_search%5Bcategory%5D=1&advanced_search%5BverifiedOnly%5D=&advanced_search%5Bsave%5D=And I want it to look like:http://localhost:8000/fr/search?query=test&category=1&verifiedOnly=The code I'm using:$this->ff->create( AdvancedSearchType::class, null, ...

 symfony                     1 answers                     28 view
 2018-10-22         Mavis

Planner - BadRequest when updating Task Details

When using the Graph API I can successfully create a task, I then wish to update the task details, specifically the description and to add some references.I'm following the documentation here https://graph.microsoft.io/en-us/docs/api-reference/beta/api/taskdetails_updateI add the request headers, Authentication Bearer, If-Match using the eTag from when I created the task. The URL is:https://graph.microsoft.com/beta/tasks/6oqAlz30WE66F915zUcSepYAM2ki/detailsHttp method used is PATCHBody is:{ "description": "My Task Title description", "references": { "https://tenant.sha...

 microsoft-graph                     1 answers                     53 view
 2018-10-22         Mavis

How to join a query result with an existing table to perform an UPDATE?

My query looks like this, and I am thinking it is because of the use of ConcatRelated(), which concatenates related fields:SELECT C.ID, ConcatRelated(["GameNames", "BaselineQuery", "CC.ID = " & [ID]) AS Games FROM BaselineQuery AS C GROUP BY C.IDThe Result Set will look like:ID GameNames 1 "A, "B", "C", D" 2 "A", "B" 3 "D", "E", "A", "B"My Games Table I want to UPDATE Looks likeID GameNames 1 2 3Where GameNames is currently blank and I want to use the ID of the query and the ID of the table to populate GameNames, so 1 in the Games table should be "A", ...

 sql                     1 answers                     28 view
 2018-10-22         Mavis

How to get key Value from post webservice API and fetch that to tableview

I got data from API in this format but the problem is that I want to get all questions and answers from the API but whenever I try to get the value by using the key value it returns nil value and application crashesthis is my api data looks like after getting into a dictionaryhere's my code for getting data from APIAlamofire.request(url, method: .post, parameters: parameters,encoding: JSONEncoding.default, headers: header ).responseJSON { response in switch response.result { case .success: print(response) if let result = response...

 ios                     1 answers                     76 view

Page 1 of 143  |  Show More Pages:  Top Prev Next Last