2018-10-22         Monica

How to insert 100 records in mysql procedure and loop in MySQL procedure not in PHP?

I have a record of 100 or 200 questions when user submit the test all 100 or 200 questions from caches need to save to MySQL. Right now I have to loop in PHP and every time a single query has executed, any idea how I send an array in MySQL procedure and the loop of 100 or 200 should be done in MySQL procedure. I can convert the array to JSON as JSON is supported in MySQL. array which needs to be insert looks like thisArray([0] => Array ( [0] => 19287 [1] => 1 [2] => 1 [3] => 101 [4] => 224 [5] => 0 )[1] =...

 php                     1 answers                     27 view
 2018-10-22         Monica

Extending ActiveModel::Serializer with custom attributes method

I am trying to create my own attributes method called secure_attributes where I pass it an array of attributes and the minimum level the authorized user needs to be to view those attributes. I pass the current level of the authorized user as an instance_option. I'd like to extend the Serializer class so I can use this method in multiple serializers, but Im having issues.This is what i have so far:in config/initializers/secure_attributes.rbmodule ActiveModel class Serializer def self.secure_attributes(attributes={}, minimum_level) attributes.delete_if {|attr| attr...

 ruby-on-rails                     1 answers                     49 view
 2018-10-22         Monica

Manual Facebook login for website - Inspecting Access Tokens

I referred this Facebook page Manually Build a Login Flow to build a login script for my website.Here is the summary of steps from the page above:Get authorization codeExchanging Code for an Access TokenInspecting Access TokensQuery Graph ApiOn the third step Facebook requires the below parameters(I used the access token from step 2 here)input_token {token-to-inspect}// An app access token or an access token for a developer of the app.(Should i use my FB app id ?)access_token {app-token-or-admin-token}What should the access_token contain? I inserted my FB app id but got ...

 facebook                     1 answers                     63 view
 2018-10-22         Monica

xCopy into the top folder of a directory

I running an xcopy command to transfer from one file to the other.xcopy /s "c:\users\documents\thisfile.txt" "d:\otherfiles\1.2.1"I'd like to be able to just copy the file into the most recent folder in the otherfiles directory rather than hard coding it every time a new version folder is created. These are versions numbers and these tend to just increase. Is this entirely possible? If you wanted to do this in PowerShell, it is possible. This would require PowerShell 3.0 or higher. It can be done with 2.0, but would require changes. Hopefully, you are on or can upgrade t...

 batch-file                     2 answers                     59 view
 2018-10-22         Monica

Arduino digitalwrite not working like it should

So i have problems with my little project, i am making fog light turn signal mod. To be specific - when one of the turn signals are flashing then that side fog light is turn on(without flashing). If the fog lights are ON then opposite side fog light of the turning signal lights will turn off.About the code:Everything is working just fine except pin 5 gives relay to turn on and off pretty fast and it doesn't matter if pin 12 is HIGH or LOW it is still flashing.Flashing only appears if pin 5 is at HIGH position. Code it self:int MiglaK = 9; //Right foglightint MiglaL = ...

 flash                     1 answers                     8 view
 2018-10-22         Monica

NightwatchJS code generated in Snaptest.io not working in Nightwatch NPM test framework

I used snaptest.io chrome extension to record and automate a simple test to go to google , input a search . The test automates good using Snaptest chrome extension and NightwatchJS code is generated in the code section. However this NightwatchJS code is not working when i use it as a homepage.js file in Nightwatch NPM framework . This is the code generated in Snaptest chrome extension .const TIMEOUT = 10000;const random = "" + parseInt(Math.random() * 1000000);const random1 = "" + parseInt(Math.random() * 1000000);const random2 = "" + parseInt(Math.random() * 1000000);const...

 javascript                     1 answers                     65 view
 2018-10-22         Monica

Reverse for 'edit' with no arguments not found. 1 pattern(s) tried: ['articles/edit/(?P<pk>[0-9]+)/$']

I am a beginner in Django and now i am developing a blogging application. At the article editing section i got stucked and I dont know why its showing this error. Searched a lot and cant find an answer NoReverseMatch at /articles/edit/2/Reverse for 'edit' with no arguments not found. 1 pattern(s) tried: ['articles/edit/(?P<pk>[0-9]+)/$']edit_articles section in views.py@login_required(login_url="/accounts/login/")def edit_articles(request, pk): article = get_object_or_404(Article, id=pk) if request.method == 'POST': form = forms.CreateArticle(request.POST...

 django                     1 answers                     81 view
 2018-10-22         Monica

HTML and webbrowser

I tried to use html page in my code for that i found way from kichensink application, i am using same code and same page.html file applicatin working on simulator but not working on devices. Ondevices i got a blank screen. Below is my code. Please help me on this.void ShowForm(){ Form f = new Form("testweb"); Container cnt = new Container(new BorderLayout()); cnt = createDemo(); f.setLayout(new BorderLayout()); f.addComponent(BorderLayout.CENTER, cnt); f.show();}public Container createDemo() { Container cnt = new Container(new BorderLayout()); final ...

 codenameone                     1 answers                     99 view
 2018-10-22         Monica

How to Add the “Select All” option after long tapping a UITextView in xamarin.ios?

How to Add the “Select All” option after long tapping a UITextView in xamarin.ios. Its only show Copy, Look Up, Share...but we want "select all" option without Editable mode.Please help/guide to solve this.. the button "select all " will appear after long tapping .And if you click the button , the second menu will appear. [XXX]

 xamarin                     1 answers                     11 view
 2018-10-22         Monica

How to use spinner to store values to Firebase?

I am creating a Classified application, I am stuck at Post Activity, where the user needs to select the Category to post their products. Below is the rough sketch for Post Activity.Firebase Database Structure :How to let the user select the Category from the Category list and based on that Category the item/products needs to be saved under that Structure.For example : If the user needs to post an Advertisement for Audi, he will select "Cars" from the spinner list and that info(image,price,name) should be saved under "Cars" structure in the Firebase Database. Any help would ...

 android                     1 answers                     36 view
 2018-10-22         Monica

SQL Query ignores WHERE online = '0'

This question already has an answer here: SQL Ignoring WHERE clause 1 answer AND has higher precedence than OR so your first WHERE actually looks like (online = '0' and title like '%search%') or weight like '%search%'which means it will match any row where weight is like %search%, regardless of the value of online. What you actually want is: online = '0' and (title like '%search%' or weight like '%search%')so just change the WHERE clause to be like the above line and it should work fine...

 php                     3 answers                     93 view
 2018-10-22         Monica

Sql = want to use make an inner join statement but not with tables

I want to use the fact that on two tables t1 and t2 I can make an inner join with on t1.colum1>t2.colum2 to calculate the maximum drawdown of a return vector. The problem is that an inner join is only possible with two stored databases or tables and I wanted to do it selecting just a part of the tables.Is there any other possibility, I am totally new to sql and I can't find any other option?Thank youeditbefore manipulating my inner join to be able to calculate my maximum drawdown I have to be able to make this inner join on a selection on the tables and not the tables th...

 sql                     3 answers                     9 view
 2018-10-22         Monica

How to get relationship diagram of primary and foreign key in two tables of a database in sql server

I have a doubt about sql server: how to get primary and foreign keys of relationship of 2 tables in sql server except the way sp_help table name? You can use SchemaCrawler to generate a textual representation of your database schema including relationships indicated by foreign keys. You will need to install a Java runtime, though.Sualeh Fatehi, SchemaCrawler [XXX]

 sql-server-2014                     1 answers                     78 view
 2018-10-22         Monica

Stripe subscription - update with prorate disabled

I'm using Stripe to manage subscriptions, and I have a php function for upgrading a user's subscription. The current code is as follows:$stripe_subscription = \Stripe\Subscription::retrieve($stripe_subscription_data->id);$stripe_subscription->plan = $request->plan;$stripe_subscription->save();The existing code works, but I'm trying to tell Stripe not to prorate the subscriptions. According to Stripe's API, I can use the update function and set prorate to false. Their example code looks like this. As such I revised the code to this:$stripe_subscription = \Stripe\...

 php                     1 answers                     86 view
 2018-10-22         Monica

Node.js on Azure Worker Role w/ SSL results in ERR_SSL_PROTOCOL_ERROR

I have a WorkerRole configured to start node.exe via the Runtime/EntryPoint/ProgramEntryPoint element in the csdef and have a HttpsIn EndPoint configured for https on port 443 w/ a valid certificate. I'm also setting the PORT environment variable in Runtime/Environment which is used by node to listen on for incoming requests.When I start the service (either in local dev fabric or in Azure) and try to hit the service I get the following error:SSL connection errorUnable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a...

 javascript                     1 answers                     89 view
 2018-10-22         Monica

RecyclerView swap two adapters

I want to make an app which shows the last 15 match and next 15 matches using API.I created a RecyclerView with 2 different list view. One for the last match, and the other for the next match. I've also created 2 different adapters, so when I click the different navigation bar, it will change the view(for example last match) into another view(next match). However, when I click the second button(next match) it force stopped. I think the problem is in the Adapter set, but I don't know whereHere are my codes:MainActivity.ktprivate val mOnNavigationItemSelectedListener = Bottom...

 android                     1 answers                     75 view

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