2018-10-22         Jane

Cannot access user model from Devise sessions controller: [merit] no target_obj found on Rule#applies?

I have class CustomSessionsController < Devise::SessionsController def create @user = resource # needed for Merit super end protected def after_sign_in_path_for(resource) @user = resource # needed for Merit resource.update_streak superAnd grant_on 'custom_sessions#create', badge: :streak, level: 3, temporary: true, model_name: 'User' do |user| puts user.inspect user.streak.count >= 3 endBut it gives the error[merit] no target_obj found on Rule#applies?And I can't access the model and it doesn't grant the badge or log the user. What i...

 ruby-on-rails                     1 answers                     73 view
 2018-10-22         Jane

Set Visible true for a component after the page loads using Java script

I have the below requirement:I am using and ADF jsff page. On that page, i have a SelectBooleanCheckbox which gets rendered even before the entire page content load and is therefore available for the user to click which is not desirable. I want to set visibility as false for that component and then use Javascript later to make it visible only after the entire page loads.Thoughts? for example This is the HTML code:<input type="checkbox" id="checkbox" style="display:none">you can add this for body tag :<body onload="checkbox()">this is the function with JS and...

 javascript                     1 answers                     61 view
 2018-10-22         Jane

Does it make sense to have negative epsilon when tuning a linear-SVM model in R?

I'm using the following tuning code to find the best case and epsilon for my svn model.tuneResult <- tune( svm, labels ~ ., data = dataset, ranges = list(epsilon = seq(-5.0, 5, 0.1), cost = 2^(0:3)))But surprisingly it suggests cost = 4 and epsilon = -5!Then I trained the model using these parameters and tested with confusionMatrix. Unfortunately, the model is not as accurate as a model without these parameters.model1 <- svm(labels ~ ., data = dataset, kernel = "linear", cost = 4 , epsilon = -5)model2 <- svm(labels ~ ., data = dataset, kernel = "li...

 r                     1 answers                     40 view
 2018-10-22         Jane

Is there a non-transitive version of target-specific variables?

I've been using target-specific variables for a while to pass object-specific flags. For example, if I need to link an executable with a certain library, I might do:bin/foo: LDFLAGS += -lbarAnd the bin/% rule will pick up -lbar. This works great for system libraries, but there's a problem when the libraries I'm linking against are also part of the project. In this case I'll have a dependency likebin/foo: lib/libbar.soand the target-specific rule I applied to bin/foo is also passed when building lib/libbar.so! This doesn't work since libbar.so can't link to itself. As t...

 makefile                     2 answers                     66 view
 2018-10-22         Jane

Personal access token only to modify repositories GITHUB

I want to select the correct option that will allow this API key to modify my repositories by only pushing to them (adding content).Which one of the following options do I select here? I want to limit the key as much as possible.It will also only be pushing to public repos that I have.I think its under repo, maybe repo deployment ... but hat makes me feel like its the ability to create repos. I want to basically only **modify ** one. That would be the public-repo scope, which is narrower than the repo scope according to this issue.However, the "write" access does not di...

 git                     1 answers                     63 view
 2018-10-22         Jane

ADFS 3.0 works with WS-Federation but fails with SAML

We use ADFS 3.0 (Windows 2012 R2) server to access an ASP.NET browser (.NET 4.5) application, which uses ClaimsPrincipal class (part of the Windows Identity Foundation library). The ADFS servers authenticates to our Active Directory. The ASP.NET application runs properly if we use WS-Federation sign-in protocol but fails if we use SAML sign-in protocol. The error message is not helpful "An error occurred"The ASP.NET is a web form application, developed using VB.NETMy questions:1) Does ADFS 3.0 with SAML sign in protocol work with ASP.NET web form application which uses Clai...

 saml                     1 answers                     43 view
 2018-10-22         Jane

Python 3.x tkinter comboboxes syncing ['variables']

I am trying to have multiple (two for this example) ttk.Comboboxes with unique variables. The boxes are syncing my selection rather than allowing me to select individual variables.I am using a main file and an import to store the variable:list.py (the variables)class object(): def __init__(self, name): self.name = name self.list = ['a','b','c']main.py (the program):from tkinter import *from tkinter import ttkimport listroot = Tk()aList = list.object('aName')bList = list.object('bName')aVariable = aList.listaCombobox = ttk.Combobox(root, textvariable=aVariab...

 python                     1 answers                     71 view
 2018-10-22         Jane

Add 15 minutes to current time then determine whether new time went past midnight

This question already has an answer here: Check if two PHP datetime objects are set to the same date ( ignoring time ) 9 answers You have the right idea, but $now will never be less than $now2, so your conditional will never trigger. Even if you added the 15 minutes to $now2 the logic wouldn't hold, as it would always trigger.To correct this, I would recommend comparing against strtotime('today midnight'):$now = new DateTime(date('H:i:s'));$now->modify('+15 minutes');$midnight = new ...

 php                     1 answers                     62 view
 2018-10-22         Jane

Reading binary data of indeterminate length in R

I would like to read a binary file -- of indeterminate length -- directly from a URL in R. Using readBin to read from a URL, without specifying the file size, does not work. anImage <- readBin('http://user2010.org/pics/useR-large.png','raw')Is there another approach that would allow this? This will download the file to the working directory, but not directly into memory. download.file('http://user2010.org/pics/useR-large.png', 'anImage.png')The Rcurl package may also do what you want. (link not posted because of SO restrictions) [XXX]A simple solution if to set '...

 r                     2 answers                     17 view
 2018-10-22         Jane

sql conversion of data types cast and convert

I have two columns in my table: AmountIncl_LC, AmountExcl_LC which are nvarchar data type.Now O want to change data type of these two columns and sum two columns into a one column result us.select cast(AmountIncl_LC as int)int [AmountIncl_LC] from dbo.table2 I used the above query and it is throwing me an error saying Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'AmountIncl_LC'. Try this:select cast(AmountIncl_LC as numeric(16,8))+cast(AmountExcl_LC as numeric(16,8)) from dbo.table2 [XXX]try thisselect cast(AmountIncl_LC as int)+cast(AmountExcl_LC as i...

 sql                     3 answers                     40 view
 2018-10-22         Jane

Selecting a single (random) row for an SQL join

I've got an sql query that selects data from several tables, but I only want to match a single(randomly selected) row from another table.Easier to show some code, I guess ;)Table K is (k_id, selected)Table C is (c_id, image)Table S is (c_id, date)Table M is (c_id, k_id, score)All ID-columns are primary keys, with appropriate FK constraints.What I want, in english, is for eack row in K that has selected = 1 to get a random row from C where there exists a row in M with (K_id, C_id), where the score is higher than a given value, and where c.image is not null and there is a row...

 sql                     3 answers                     3 view
 2018-10-22         Jane

How to write an xquery containing sequence elements?

I've got a very large xml data set that is structured like the following:<root> <person> <personid>HH3269732</personid> <firstname>John</firstname> <lastname>Smith</lastname> <entertime>01/02/2008 10:15</entertime> <leavetime>01/02/2008 11:45</leavetime> <entertime>03/01/2008 08:00</entertime> <leavetime>03/01/2008 10:00</leavetime> ... // number of enter times and leave times vary from person to person // ...

 sql-server                     3 answers                     16 view
 2018-10-22         Jane

Kafka Connect: How does Kafka Connect read the latest offset?

As per my understanding KafkaConnect reads the latest offset from the name of the last file written.How would it keep track of the last offset it read if the files have been moved from the directory? This depends on which connectorStandalone mode for sinks (can) store an offset file. In Distributed mode, howver, the connect-offsets topic is read from. Connect still maintains a consumer group id, though, so if a file is gone, the protocol is still capable of resuming from the last committed offset. [XXX]

 java                     1 answers                     103 view
 2018-10-22         Jane

MVC3 Ap in Visual Studio 2010- Changed to use Local IIS Web Server and can not get it back to VS dev server

I changed from running Use Visual Studio Development Server to Local IIS Web Server becasue I read it would create the virtual directories properly - it did not - once I navigate out of the account area I getHTTP Error 404.0 - Not FoundThe resource you are looking for has been removed, had its name changed, or is temporarily unavailable.Requested URLhttps://localhost:443/xxx/IndexPhysical PathC:\inetpub\wwwroot\xxx\IndexI have been googling and trying to get it to work, but can not and can no longer debug - Now I am trying to change it back and it keeps starting in Local II...

 asp.net-mvc-3                     2 answers                     21 view
 2018-10-22         Jane

getLimit () returns null

I am developing an app using google drive api.However, getLimit() may return null from a specific account.Why does getLimit() return null?[OAuthGoogleDrive.java:updateAccountInfo:getLimit : null[OAuthGoogleDrive.java:updateAccountInfo:getUsage : 7592740408804https://developers.google.com/resources/api-libraries/documentation/drive/v3/java/latest/com/google/api/services/drive/model/About.StorageQuota.html#getLimit-- Docs says that it will not always return a valid number, only "if applicable". The usage limit, if applicable. This will not be present if the user has unli...

 google-drive-android-api                     1 answers                     4 view
 2018-10-22         Jane

Downcasting Any? to UIBarButtonItem

override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "detailSegue" { let indexPath = tableView.indexPathForSelectedRow! let card = cards[indexPath.row] let detailTableViewController = segue.destination as! DetailTableViewController detailTableViewController.card = card detailTableViewController.picture = card.image } else if segue.identifier == "addEditSegue" { let addEditTableViewController = segue.destination as! AddEditTableViewController let buttonPressed = sender as? UIB...

 ios                     1 answers                     23 view

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