2018-10-22         Frederic

Alpha Vantage stockinfo only collects 4 dfs properly formatted, not 6

I can get 4 tickers of stockinfo from Alpha Vantage before the rest of the DataFrames are not getting the stockinfo I ask for. So my resulting concatenated df gets interpreted as Nonetype (because the 4 first dfs are formatted differently than the last 2). This is not my problem. The fact that I only get 4 of my requests is... If I can fix that - the resulting concatenated df will be intact.My codeimport pandas as pdimport datetimeimport requestsfrom alpha_vantage.timeseries import TimeSeriesimport timetickers = []def alvan_csv(stocklist): api_key = 'demo' # For use wi...

 python                     1 answers                     87 view
 2018-10-22         Frederic

Google Cloud Firestore documents limit

I've been working with Google Cloud Firestore. I'm about to import 13000+ records from a CSV to the firestore back-end. I'll be using this collection for look up and auto-completion purposes. I'm curious and concerned to know if this is a good idea. Also, I'm looking for some suggestions on what techniques should I be using to make retrieval of this this data as efficient as possible. I'm working with Angular 5 and using AngularFire2 to connect with Firestore.The document itself is really small such as:{ address: { state: "NSW" street: "19 XYZ Road" suburb: "Darli...

 firebase                     1 answers                     51 view
 2018-10-22         Frederic

Symfony 4 + API Plantform +LexikJWTAuthenticationBundle Bad Credential

Good afternoon. Please i'm using LexikJWTAuthenticationBundle in a symfony 4 api project. I'm using UserProvider for Doctrine. After Configure Doctrine User Provider, I've install and configure LexikJWTAuthenticationBundle. But when i tried to athentificate using Postman on the url http://localhost:8000/api/login_check whith this JSON {"username":"ak","password":"ak"} I've this error: { "code": 401, "message": "Bad credentials"}.See below my Security.yaml config file. I've read forums to tried to solve this issue but i've not yet found the solution. Can you please hel...

 symfony                     2 answers                     91 view
 2018-10-22         Frederic

django TokenAuthentication is key always unique inside the authtoken_token table?

I am using:http://www.django-rest-framework.org/api-guide/authentication#tokenauthenticationIn my design this question is crucial:django TokenAuthentication is key always unique inside the authtoken_token tableI have had a look on database table in mysql. It seems that it should be unique. Correct me if I am wrong. It should be unique yes,as you can see here it uses os.urandom wrapped inside binascii.hexlify which in turn provides 40 chars randomly which should be enough to prevent clashes.If you want to be absolutely sure though, combine the user id with the token in th...

 django                     1 answers                     25 view
 2018-10-22         Frederic

Using subprocess wait() and poll()

I am trying to write a small app that uses the subprocess module. My program calls an external Bash command that takes some time to process. During this time, I would like to show the user a series of messages like this: Processing. Please wait... The output is foo()How can I do this using Popen.wait() or Popen.poll(). I have read that I need to use the Popen.returncode, but how I can get it to actively check the state, I don't know. Both wait() (with timeout specified) and poll() return None if the process has not yet finished, and something different if the process h...

 python                     2 answers                     69 view
 2018-10-22         Frederic

On redirection external JS is not working in react-router-dom

I am creating an app using react.js and Node.js and Using react-router-dom 4 for Front end routing.I am using jquery for AJAX request. There is user login api,when User logged in with credentials then redirecting to Dashboard page by using this.props.history.push('/dashboard')UserLoginAPI(){ let formData = this.state.form; $.ajax({ url:BASEURL+CONSTANT.login, type:'POST', data:formData, success:(data)=>{ let form = this.state.form; this.setState({popUpMessage:data.data }); ...

 reactjs                     1 answers                     44 view
 2018-10-22         Frederic

Getting an unexpected result while configuring Swagger with Spring Boot

I'm pretty much new to Swagger and I started Documenting very simple my web service that I've build using Spring Boot.The problem is, After I configure swagger, in the browser when I type localhost:8080/swagger-ui.html I get this following screen with some weird popup message that says "Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway". I do know it may seems repeated question, but I couldn't resolve this at all with all those answers given. Following, I've posted the screenshot and complete code where...

 spring                     5 answers                     49 view
 2018-10-22         Frederic

Implementation of multi-screen layout with toolbar limited to only one portion of the layout

I am trying to create a XML design for android tablet. Please look at the samples I attached Navigation drawer , Main-layout, Layout-2. I have to implement multi-screen layout with toolbar limited to only fragment-1 (ie orange portion in Main-layout) and fragment-2(ie. white portion in Main-layout) should be full screen in the Main-layout, leaving all other layout to have complete toolbar(Example. Layout-2). How can i implement this. Thanks in advance. You must be implementing this using one Activity class and two Fragment classes. So, you can achieve this by removing ...

 android                     1 answers                     75 view
 2018-10-22         Frederic

SELECT Records Where Date > Date On Each Row

I am working in Microsoft SQL ServerI have a table like below for Campaign Responses :Id Name CreateDate001 Tom Cruise 2018-08-29002 Tom Hanks 2018-09-02003 Bill Nye 2018-06-25004 Johnny Cash 2018-06-27I also have a table like below for General Activities: Id PersonId Name ActivityDate117 001 Tom Cruise 2018-08-30118 001 Tom Cruise 2018-09-31211 003 Bill Nye 2018-06-26212 003 Bill Nye 2018-06-27I want to create a query that COUNTS the number of activities each campaign m...

 sql                     3 answers                     39 view
 2018-10-22         Frederic

SQL error in php

Hey, I wrote some code for extracting some information out of the database and checking to see if it met the $_COOKIE data. But I am getting the error message:Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1My code so far is:$con = mysql_connect("XXXX","XXXXX","XXXXXXX");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("XXXXXX", $con);$id = $_COOKIE['id']; $ends = $_COOKIE['ends'];$userid = strtolower($_SESSION['username']);$queryString = $_G...

 php                     5 answers                     59 view
 2018-10-22         Frederic

Combining views programmatically - Android

I've got a list of layouts that I need displayed on a PDF. However I'd like to find a way where I can combine these views into one view.for(LinearLayout cardView : selectedCardIDList){ pageNo++; cardView.measure(measuredWidth, 0); cardView.layout(0, 0, pageWidth, cardView.getHeight()); cardView.draw(canvas); }This is the method I use to draw each view. I'd like to combine the views and then draw the new view.Here's a quick example i drew up with 'V' being View.On the left I have View 1 and View 2, I'd to try and stack them ...

 android                     1 answers                     2 view
 2018-10-22         Frederic

Why can't I install SQL Server SP1 (KB968369)?

I have a Windows Server 2008 x64 machine. I have the "Microsoft SQL Server 2008 Service Pack 1 (KB968368)" as an "optional" update available from Windows Update. I choose to install it, my computer installs it for a while, I restart, and that update is available again. Why doesn't my computer install it?Thank you. Not sure, but I had the same problem. Did you ever do an "Edition Upgrade" in the SQL Server 2008 installer? Many users who did such an upgrade are reporting problems with the update package. For me, it wasn't a mission-critical system, so I just uninstalled th...

 sql-server-2008                     4 answers                     16 view
 2018-10-22         Frederic

PyQt and Bespin (KDE style)

What tab widget decorate by Bespin Tabs? I tried QTabWidget, QTabBar, KTabWidget, KTabBar, bau no effect. What Im doing wrong?All KDE apps and SMPlayer decorate by Bespin, but acetoneiso and PyQt apps have regular tabs=(I mean this Bespin:http://kde-look.org/content/show.php/Bespin?content=63928 That is a bit strange. It should have automatically decorated your application with the style Bespin. However you can force it decorate the application with a specific style.# Check the available styles with qtsf = QStyleFactory()print list( sf.keys() )That should list all the st...

 python                     1 answers                     44 view
 2018-10-22         Frederic

R Shiny: Formatting text within tableOutput

Consider the following very simple shiny app that outputs a table of text stored in the dataframe df: library(shiny)df <- data.frame(id=1:3, text=c('It was a good day today', 'It is good to hear from you', 'I am feeling good'), stringsAsFactors = FALSE)ui <- fluidPage( tableOutput("freetext"))server <- function(input, output){ output$freetext <- renderTable({ df })}shinyApp(ui=ui, server=server)I would like the word "good" in each line to appear in red. Is this possible using tableOutput?I have seen posts such as this one th...

 r                     1 answers                     23 view
 2018-10-22         Frederic

Updating AKS kubernate cluster agent pool profile

I have created an AKS kubernetes cluster with az CLI :az aks create \ --name abcdefAKSCluster \ --resource-group abcdef \ --node-count 5 \ --generate-ssh-keys \ --service-principal <...> \ --client-secret <...> \ --location westeurope(I followed the steps on this documentation)I deployed a bunch of docker, based on unix images. Everything works fine (nestjs and angular apps, but this is not relevant).Now I have the requirement to deploy a docker image, but based on windows. This image is built and uploaded to our azure container registry. I ...

 azure                     1 answers                     35 view
 2018-10-22         Frederic

Save File in DocumentDb with custom name

I'm trying to save a XML file in DocumentDb in Json format. I have no problem in converting it and saving. All the conversion and saving are working fine.However when I store my Xml file the DocumentDB provides its own file name to the file. Eg; 8756b9b9-41ac-47ca-9f4c-abec60b318be.But I want to save the file with my own custom name Eg; MyXmlFile1 or MyXmlFile2 etc;How do I pass my custom name when saving the file? That is MyXmlFile1 or MyXmlFile2. "jsontoStore" has the content of the file I want to store into DocumentDB.Code1: Storing without passing any file name.await cl...

 azure                     1 answers                     35 view

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