2018-10-22         June

Shared authentication for web services

Our company, Company A, may soon be partnering with Company B under some sort of licensing agreement. If it goes through, it will be necessary for users of Company B's web service to have access to Company A's web service. In other words, any user with an account for Company B's service should automatically have an account with Company A, but without having to create a new account...their's should be a shared account.I'm not an expert in this matter (obviously) but I think this scenario would call for something along the lines of OpenID, but just between our two web sites. ...

 authentication                     3 answers                     4 view
 2018-10-22         June

Terraform: how to support different providers

I have a set of terraform codes in a directory called myproject:\myproject\ec2.tf\myproject\provider.tf\myproject\s3.tf ....the provider.tf shows:provider "aws" { region = "us-west-1" profile = "default"}so, if I terraform apply in myproject folder, a set of aws resources are launched in us-west-1 under my account.Now I want to introduce a AWS Glue resource, which is only available in a different region us-west-2. then how do I layout glue.tf file? Currently I store it in a sub-directory under myproject and run terraform apply in that sub-directory i.e.\myproject\gl...

 terraform-provider-aws                     1 answers                     96 view
 2018-10-22         June

Prevent pip from installing some dependencies

We're developing an AWS Lambda function for Alexa skill in Python and using pip to install the ask-sdk package to our dist/ directory:pip install -t dist/ ask-sdkThe trouble is with the -t dist/ because pip wants to have all the dependencies there, even if they are installed system-wide.Now, ask-sdk has a dependency on boto3 which pulls in a whole lot of other packages. However the AWS Lambda runtime environment provides boto3 and there is no need to package that and its dependencies with our code. I do have boto3 installed in the system and import boto3 works, so I thought...

 python                     2 answers                     59 view
 2018-10-22         June

Select drop down from associated model

I have a model InstrumentFunding (id,title) that belongsTo InstrumentFundingGroup (id,title)In the backend when I add/edit the InstrumentFunding I want a select dropdown to select the InstrumentFundingGroupI tried using $form->input('InstrumentFundingGroup',array('type' => 'select')); but the dropdown is emptyHow can I do this? In your controller:$instrumentFundingGroups = $this->InstrumentFundingGroup->find( 'list' );$this->set( compact( 'instrumentFundingGroups' ) );In your view:$form->input('InstrumentFundingGroup.id' );Cake does the work of recogniz...

 cakephp                     1 answers                     25 view
 2018-10-22         June

Python can't find my module

I have a python project (which I run within a virtualenv) and that has the following structure:Project├───.git├───venv└───src ├───__init__.py ├───mymodules │ ├───__init__.py │ ├───module1.py │ └───module2.py └───scripts ├───__init__.py └───script.pyscript.pyimport src.mymodules.module1...I run the project with venv activated and from the Project directory using the following command:(venv)$ python src/scripts/script.pyThe script runs but gives out the following error before exiting:Traceback (most recent call last): File "src/scripts/s...

 python                     3 answers                     42 view
 2018-10-22         June

How to extract response items from a Google Form

I have made a form to capture 2 data.Email address.Group which user wants to subscribe to.Each group has their own spreadsheet. [According to the posted code, each has their own sheet within the same spreadsheet.]When a user submits the form, the form should capture the email address, and sends the data to the respective spreadsheet which the user subscribed to.This is what I've done so far. I'm stuck..Is there a way to retrieve data specifically from a particular textbox/options ..etc?The only way I know is to loop all the data and retrieve it 1 by 1.. and that makes it di...

 google-apps-script                     1 answers                     74 view
 2018-10-22         June

Select2 plugin fired by

newbie herefirst, my english is not good enough to describe the problem that i'm facing right now, so consider to see my code below$('#selectOriginAirport, #selectDestinationAirport').select2({ placeholder: 'Select Airport', ajax: { url: '{{url('get-airports')}}', dataType: 'json', delay: 250, data: function(params){ return { keyword: params.term }; }, processResults: function(datas, params) { return { r...

 javascript                     1 answers                     10 view
 2018-10-22         June

How to Update and Delete MySQL Table in PHP using this kind of method?

Using laracasts 'The PHP Practitioner' course I learn that I can insert into table using following format:public function insert($table, $parameters){ $sql = sprintf( 'insert into %s (%s) values (%s)', $table, implode(', ', array_keys($parameters)), ':' . implode(', :', array_keys($parameters)) ); try { $statement = $this->pdo->prepare($sql); $statement->execute($parameters); } catch (\Exception $e) { // }}How I update and delete data using this method just passing table name and array as arguments in ...

 php                     1 answers                     10 view
 2018-10-22         June

Will the Sql Server Import And Export Wizard have shapefile support anytime soon?

Do you know?PS: Some of you will tell me to check the Sql Server Management Studio features roadmap. But where is it? I the Social Msdn there's a simmilar question, you can see the answer.http://social.msdn.microsoft.com/forums/en-US/sqlspatial/thread/12b4d06e-0336-4dbc-bfdf-48fcfe5e834c/ [XXX]

 sql-server                     1 answers                     85 view
 2018-10-22         June

Kafka Java Consumer SDK long pull without using while

I try to use Kafka Java SDK to implement a consumer however most consumer examples I saw are using while(true) loop and inside the loop call consume method to get a message.while (true) { final ConsumerRecords<Long, String> consumerRecords = consumer.poll(1000); if (consumerRecords.count()==0) { noRecordsCount++; if (noRecordsCount > giveUp) break; else continue; } consumerRecords.forEach(record -> { System.out.printf("Consumer Record:(%d, %...

 java                     2 answers                     59 view
 2018-10-22         June

Node.js installation on raspberry PI 3 issue

I'm following quite simple steps of upgrading Node.js on Raspberry:curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -sudo apt-get install -y nodejsit produces like veerything is correct:...Selecting previously unselected package nodejs.(Reading database ... 56727 files and directories currently installed.)Preparing to unpack .../nodejs_9.11.1-1nodesource1_armhf.deb ...Unpacking nodejs (9.11.1-1nodesource1) ...Processing triggers for man-db (2.7.0.2-5) ...Setting up nodejs (9.11.1-1nodesource1) ...However, after when i try to launchnode -vit gives error-bash: /us...

 node.js                     1 answers                     40 view
 2018-10-22         June

Get Branch name in gitlab ci

In my Gitlab CI, I have a stage that triggers another stage by api call trigger and I want to pass the current branch name as parameter to the other project holding the trigger. I used the CI_COMMIT_REF_NAME for this, it seemed to work, but now that I call the stage only when merging the branch to master, the CI_COMMIT_REF_NAME always says "master". In the documentation it says "The branch or tag name for which project is built", do I understand it correctly that it kind of holds the target branch of my working branch? I tried to get the current branch in gitlab ci with gi...

 gitlab                     1 answers                     52 view
 2018-10-22         June

Authentication Options for PHP based Azure Website?

I am writing a simple admin tool in PHP for my own personal use that I would like to host on the free Azure Websites tier. I need to secure the site through a simple authentication scheme such as .htpasswd under *NIX servers. Are there any recommended approaches to do this when running the site in PHP? I have looked at the options in web.config, however they all appear to require a Windows user-account against which to authenticate. I have taken a look at Windows Azure Basic Authentication but I'm not too sure how I could run appcmd.exe against this website.I have checked ...

 php                     2 answers                     95 view
 2018-10-22         June

How do I properly set up a single SQLAlchemy session for each unit test?

When testing my Pyramid application using WebTest, I have not been able to create/use a separate Session in my tests without getting warnings about a scoped session already being present.Here is the main() function of the Pyramid application, which is where the database is configured.# __init__.py of Pyramid applicationfrom pyramid_sqlalchemy import init_sqlalchemyfrom sqlalchemy import create_enginedef main(global_config, **settings): ... db_url = 'some-url' engine = create_engine(db_url) init_sqlalchemy(engine) # Warning thrown here.Here is the test code.# te...

 python-3.x                     1 answers                     60 view
 2018-10-22         June

Flutter - Trying to get the scaffold of a widget context from reducer

I am hitting a wall since I am trying use the context (to call a snackbar when the async action is done) of a widget from a reducer.I have tried using GlobalKey, but when I get such key and I try to use the context of it to call the widget Scaffold it throws an error which says there is no Scaffold for such context, when there is infact.Sadly I cannot provide the code because is for a customer and the code cannot be shown, but I can provide you with the details if it is needed.The snackbar/toast itself is not that important, but if the context of a widget cannot be get from...

 android                     2 answers                     16 view
 2018-10-22         June

Alternative solution for :focus on multiple buttons

I'm struggling to find a different solution for :focus when clicked on a button, as Safari doesn't support :focus on buttons. I have a field of 16 buttons, which should change colours when clicking on it and loose it when different button is clicked.I have created this fiddle to show the events. toggleClass is not the right solution and would like to avoid :focus.Current JS code:$(".tbl-button").on("click", function() { $(".tbl-button:focus").addClass("table-btn-color");}); You can just change your css declaration from .table-btn-color to .tbl-button:active.but if...

 javascript                     2 answers                     124 view

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