2018-10-22         Daniel

Light Gate Timer Arduino

I have been trying for the past few hours to get a light gate timer to work with 2 photocells and lasers. It is like a trip wire, when the 1st sensor is low (when it is tripped), it triggers to start the time. This then is supposed to continue and then stop the timer when the second sensor is triggered using the same method as sensor 1 is triggered. The problem that I am having now is that the timer never stops. It seems to be a problem with my second sensor, I have switched the second sensor and the sensor seems to be fine. The other problem is that the timer does weird th...

 timer                     1 answers                     23 view
 2018-10-22         Daniel

Chromedriver on Ubuntu 12.04 - Error while loading shared libraries: libXi.so.6

I downloaded the 32-bit chromedriver version on my Ubuntu 12.04 machine.However, it won't run and exits with the following message. I have searched various places on the internet but failed to find a solution../chromedriver: error while loading shared libraries: libXi.so.6: cannot open shared object file: No such file or directory libXi.so.6 is provided by libxi6. Chromedriver will then also ask for libgconf-2-4 with a similar message.sudo apt-get install libxi6 libgconf-2-4Whenever facing an issue of missing a specific file apt-file comes to rescue:$ apt-file search lib...

 ubuntu                     2 answers                     73 view
 2018-10-22         Daniel

How to use single Django Template for multiple purpose

I have different django models which are identical e.gItemCategoryInventoryCategoryMenuCategoryExpenseCategoryAll of these models carry same attributes. I want to use single html page which is category_list.html for displaying these models as list. I don't want to use different pages like item_category_list.html, inventroy_category_list.html, menu_category_list.html and so on. Every page contains page header which is actual kind of title of page represented in h1 tag. I want to change with respect to currently loaded page.Note: I am using Generic Views for Listing Items and...

 django                     1 answers                     98 view
 2018-10-22         Daniel

Convert OpenEXR to WebM Alpha Edges Grey

I apologise if this has been answered before. I have tried lots of options but can't seem to solve my issue.I have a sequence of OpenEXR images that I want to merge into a WebM and include transparency. This I the basics of my ffmpeg command:ffmpeg -i test%04d.exr exr.webmThe problem is the transparency looks dodgy on the edges. Here is an example of how it currently looks. The edge of the box should fade to white but the transparency shows a dirty grey.Here is an example exr file: Test EXR FileI've tried lots of things like-vf premultiply=inplace=1or-pix_fmt yuva420pbut I ...

 ffmpeg                     1 answers                     42 view
 2018-10-22         Daniel

JSONDecodeError: Expecting value: line 1 column 1 (char 0) at line response.json()

I am getting error Expecting value: line 1 column 1 (char 0) on the line response.json().WHAT I TRIEDAs opposed to other answers I do not get an error at json.loads() but at response.json().I have also tried tweaking response data body but no help.Here is the code.import requestsimport jsonfrom bs4 import BeautifulSoup as Soupdef get_links(search_name): search_name = search_name.replace(' ', '+') response = requests.get("http://www.google.com/search", params={'q': search_name, 'first': 0}, headers={'User-Agent': user_agent}) dataform = response.jso...

 json                     1 answers                     47 view
 2018-10-22         Daniel

How to redirect login page to dashboard using ReactJS?

I want when I submit the email and the password to login, it will be redirected to the dashboard, my code is below : handleClick(event){ var payload={ "email":this.state.email, "password":this.state.password } axios({ method: 'post', url: '/app/login/', data: payload, withCredentials: true, headers: { 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Accept': 'application/json', } }) .then(function (response) { console.log(respo...

 javascript                     2 answers                     15 view
 2018-10-22         Daniel

Monotouch Compiler Directive if debug

In my MonoTouch app, how can I put in a # compiler directive to include code only if in debug mode? MonoDevelop by default sets the DEBUG define when you create a solution, so you can use two things: you can use [Conditional ("DEBUG")] attributes on methods that you use to instrument your code and you can use standard if #DEBUGs in your source.Like this:[Conditional ("DEBUG")]void Log (string msg){ Console.WriteLine (msg);}void Foo (){ Log ("Start"); .. Log ("End");}What is nice about the Conditional attribute is that the compiler will remove the calls at com...

 c#                     1 answers                     29 view
 2018-10-22         Daniel

Android: Get Spinner Data from a Recycler view

I creating a feedback screen in an application in which user will have to select their opinion(displayed as Spinner) for each question(TextView).Multiple questions & options will be displayed in a RecylcerView. On clicking submit button, I need to get all the data(Both Question and Selected spinner value) from recycler view and send to the server.I saw the many suggesting to implement onItemSelectedListener on the Spinner. It will not suitable for me because Each spinner will have default value. Also user may not select each and every spinner.How to get the value of e...

 android                     1 answers                     49 view
 2018-10-22         Daniel

Database Modeling vs Manually create Database with SQL instructions (Creating a DB for project)

I am currently working on a project which include some "little" database, however I got into the question of "should I made the relational modeling of the db and then export it into a sql query" or " should I manually create the database via sql instructions". since I've heard that creating db with frameworks (modeling) limits the db flexibility for further updates. however creating a DB on pure SQL instructions would allow me to do stuff much more easily.Is that actually truth? or in the industry there is always a model? The best practice when creating a database would...

 sql                     1 answers                     11 view
 2018-10-22         Daniel

SQL splitting a column and updating alternate table

I'm working with a few different tables consisting of data from users rating movies. My movies table currently lists MovieId, MovieTitle, and Category. The data in each category column has repeating groups in each row that I want to eliminate by moving them over to MovieCategories which will consist of MovieId, CategoryId.My category column uses | as a delimiter, such as "Action | Thriller | Drama". I have a separate table CategoryDescription that assigns a CategoryId to each genre, so for example, I want my final MovieCategories table to look like this: MovieId | CategoryI...

 sql                     2 answers                     33 view
 2018-10-22         Daniel

Table CTE And Date recursion

The following query has returned Result 1 in the attached image Fichiers recus.I would also like to have Result 2 and I do not know how to go about it.Thank you for your help.DECLARE @dateDebut DATE = 2018-07-10DECLARE @dateFin DATE = 2018-07-14DECLARE @cols VARCHAR(MAX)DECLARE @cols VARCHAR(MAX)DECLARE @query VARCHAR(MAX)DECLARE @sum_cols VARCHAR(MAX)WITH DatesAS (SELECT [Date1] = CONVERT(Date,@dateDebut)UNION ALLSELECT [Date1] = DATEADD(DAY,1,[Date1])FROM DatesWHERE DATEADD(DAY,1,[Date1]) < @dateFin)SELECT LEFT(CONVERT(VARCHAR,[Date1],20),10) DateINTO #DatesSerieFROM D...

 sql-server                     1 answers                     72 view
 2018-10-22         Daniel

Count columns in a table and count columns in joint table

I'm using SSMS 2014 and I'd like to do two things: i) Count the number of columns in a table called 'aggregatedsaleshistory.' I understand that I'd have to write something similar to this. Can you please modify the code where it's wrong? select count (*) from aggregatedsaleshistory where table_name ='aggregatedsaleshistory'ii) count the number of columns if that table is joined to another table. e.g with the code below, I'm getting the Category and Subcategory data from the Enterprise Structure view and a sum of the Units and Cash Sales for them from the Aggregated Sales Hi...

 sql                     1 answers                     93 view
 2018-10-22         Daniel

Stripe: how can I block a specific credit card number?

We would like to block a payment from specific card number. But it seems like we have no way to determine if it's the same card number or not using Stripe API. The closest I can see is Saving Cards which can return customer.id. But from testing, customer.id is different each time even if credit card number is the same. So is there any way that we can block credit card number using Stripe API? If you have access to write Radar rules within your Stripe account, you can write a rule to block a card if the card fingerprint matches whatever card you are looking to block. The ...

 stripe-payments                     1 answers                     99 view
 2018-10-22         Daniel

How to use jQuery in Firefox plugins?

I'm trying to create a Firefox plugin and I would like to use some jQuery functions. How to include needed jQuery libraries? Some way to include the libraries to the plugin itself?I need to show a jQuery Dialog type window on various web sites when user clicks a link injected to the page.Thank you for your answers! In your overlay.xul file, just include it as if you were including any other Javascript file:<script type="application/x-javascript" src="chrome://my-firefox-extension/content/path/to/jquery.js" /> [XXX]I suggest using chrome dialogs instead of jQuery...

 javascript                     2 answers                     11 view
 2018-10-22         Daniel

Microsoft Azure Cosmos DocumentDB Optimal Read Query Performance

We have implemented an Azure CosmosDB (MongoDB with SQL API) database in the cloud. Through java, we'd like to generate reports based on the data hiding in the MongoDB. I'm not yet too happy with the performance of my read queries, and I was wondering what can be improved to my current setup.Like said, I use Java to query the database. I use the Microsoft Azure DocumentDB library to query the database:<dependency> <groupId>com.microsoft.azure</groupId> <artifactId>azure-documentdb</artifactId> <version>1.16.2</version></...

 java                     2 answers                     12 view
 2018-10-22         Daniel

how to make a html login page that connect to database

Lets say I have a login.html page with a html templateAnd I want to use that login.html template to login to another login.php page.Say, when a user types in email and password in login.html, I want that login.html page to type the same email and password in my another website which has login.php page.For this example, lets take blesta - it has a login.php page but the landing page is simple and is not beautiful.I have another html page named login.html which looks sleek and beautiful but I don't want to transfer users to blesta login.php and then they enter their credentia...

 html                     1 answers                     86 view

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