Create Nested Forms in Ruby on Rails
◷
تاریخ انتشار: 1395/2/11 | ساعت: 7:03
Vote count: 0 I am generating an html.erb file as part of my rails application. In it, I am using FormBuilder's form_for to create one of my main modeled objects. In the course of the page code, though, I also have a form_tag remote Ajax call for another related route. When I nested these within eac...
moq generic method setup on interface
◷
تاریخ انتشار: 1395/2/11 | ساعت: 7:03
Vote count: 0 How to setup generic method using moq library in C# Interface IA { void foo(); void Get<T>(); } [Fact] public void SetupGenericMethod() { var mock = new Mock<IA>(); mock.Setup(x=> x.Get<It.IsAny<???>()>() } Any help on this one is really appreciated. Thanks a bunch for your time asked ...
Unexpected NSDate when trying to grab date X days in future goes into next month
◷
تاریخ انتشار: 1395/2/11 | ساعت: 6:01
Vote count: 0 Right now its giving me this. It only happens when we go into the future towards the end of the month: 2016-04-29 17:40:13.926 ASAP[17658:927300] SECTION_ARRAY:( { "TYPE_OF_SECTION" = COMPLETED; }, { DAY = Friday; "DAY_END" = 1461988799; "DAY_START" = 1461902400; "TYPE_OF_SECTION" = DA...
How to get the index of the median element of a vector
◷
تاریخ انتشار: 1395/2/11 | ساعت: 6:01
Vote count: 0 I want to get the index of the median element of an std::vector in c++11, while comparing the elements with a custom comparator. I believe I can use nth_element ? Can someone give me an example ? asked 38 secs agoShiro Let's block ads! (Why?)
checking the ace editor in the onbeforeunload to see if changes were made
◷
تاریخ انتشار: 1395/2/11 | ساعت: 6:01
Vote count: 0 I'm trying to use the $(window).on('beforeunload', function(){}); and editor.session.getUndoManager().isClean(); in the ace editor to check if the user made changes to a document but didn't click the submit button but for some reason it doesn't work Here's the code: editor.on('change',...
Prime faces - message tooltip won't display
◷
تاریخ انتشار: 1395/2/11 | ساعت: 4:45
Vote count: 0 I want to display error message as a tooltip like in this example: http://www.primefaces.org/showcase/ui/message/messages.xhtml Here is my JSF code snippet: <h:form id="loginForm"> <p:messages id="messages" showDetail="true" closable="true" for="login"/> <h:panelGrid columns="3" cellpa...
How to replace a value within a large string in R
◷
تاریخ انتشار: 1395/2/11 | ساعت: 4:45
Vote count: 0 I have a long string (comes from a SQL query) that contains this phrase: "AND RO.[TPID] = 18411436" I want to replace the number portion each time I go through a loop. How do I exctract the patte so I can perform a sub or str_replace? When I run grep("[TPID] = ",x) it retu s a 0 as it ...
What's a good setup for React Native crash reporting?
◷
تاریخ انتشار: 1395/2/11 | ساعت: 4:45
Vote count: 0 I'm seeing that getSentry has crash reporting for React Native now: https://docs.getsentry.com/hosted/clients/javascript/integrations/react-native/ I like them because they do a good job correlating exceptions with your source maps. But I also want to catch native crashes. Do you basic...
Check if string contains date or datetime
◷
تاریخ انتشار: 1395/2/11 | ساعت: 3:39
Vote count: -1 Let's say I have a string, could be '2016-01-01' or with a time '2016-01-01 10:23:56', how can I identify if I'm receiving a date or a datetime ? asked 8 mins agocarlosm Let's block ads! (Why?)
Jenkins iOS Simulator timeout during xctool app install (Xcode 7, iOS 9.3.x)
◷
تاریخ انتشار: 1395/2/11 | ساعت: 3:39
Vote count: 0 I am ru ing Jenkins on an older Mac Pro (2012) and am having trouble ru ing my xctool test suite. My setup mirrors this blog post (which is recommended by the xctool project). The specific error I'm seeing tends to happen intermittently as of the latest Xcode 7 and iOS 9.3 update, and ...
How to use get_serving_url_async
◷
تاریخ انتشار: 1395/2/11 | ساعت: 3:39
Vote count: 1 Im trying to get the url of an image from the blogstore. In using webapp2 and python. I do this: from google.appengine.api.images import get_serving_url_async ... upload = self.get_uploads()[0] blob_key = upload.key() url = yield get_serving_url_async(blob_key, secure_url = True) And I...
WebSocket debugger in Google Chrome is "minimized" when a new message is received by the current WS
◷
تاریخ انتشار: 1395/2/11 | ساعت: 2:03
Vote count: 0 I am using Google Chrome, developing an AngularJS frontend generated with yeoman and served with grunt. I am trying to debug an issue happening on a WebSocket, the browser (client) receiving textual JSON messages at a fast pace (no binary data), with the server not expecting any messag...
catting together different files in unix
◷
تاریخ انتشار: 1395/2/11 | ساعت: 2:03
Vote count: 0 I have a folder which has a bunch of files in them, and I'd like to cat together specific files. The layout is like this: sample1_S99_L1_R1_001.fastq.gz sample1_S99_L2_R1_001.fastq.gz sample1_S99_L1_R2_001.fastq.gz sample1_S99_L2_R2_001.fastq.gz and so on for different samples. I would...
Volley erreor when parsing JSON
◷
تاریخ انتشار: 1395/2/11 | ساعت: 2:03
Vote count: 0 I get an error when I receive the response from a REST server. I found few topics with the same problem but still can't find the solution. This is my code public void clickFunc(View v){ String url = "http://localhost:8080/Server/file/04"; final CustomJSONObjectRequest jsonRequest = new...
Response time of an application unintutively correlated with number of input triggers in a give time period
◷
تاریخ انتشار: 1395/2/11 | ساعت: 0:14
Vote count: 0 I have an Multi threaded C++ network application which listens for UDP packets as input - this data then hops through the application/processed via various queues and threads and finally pushed out on a TCP socket. What I am seeing is that if inputs come in slow lets say 5/sec, the tot...
google maps api in javascript does not work if called from nested function
◷
تاریخ انتشار: 1395/2/11 | ساعت: 0:14
Vote count: 0 I am using google maps api to point certain locations. These locations I get from my rest api server. so when I try to run the code in my webapp, it does not show on the browser. (it showed once or twice and later not showing) But the same code works when run in link here (http://www.w...
Error during artifact deployment Tomcat 9 intellijIdea
◷
تاریخ انتشار: 1395/2/11 | ساعت: 0:14
Vote count: 0 I'm deploying a Spring web-application on Tomcat 9, IntellijIdea 2016.1.1 And when I start the server , I get this: C:UsersBirthrightDownloadsapache-tomcat-9.0.0.M4apache-tomcat-9.0.0.M4bincatalina.bat run [2016-04-29 07:43:45,681] Artifact AutoServ:war exploded: Server is not co ected...
Why can i not downcast UICollectionViewCell to a subclass thereof?
◷
تاریخ انتشار: 1395/2/10 | ساعت: 23:06
Vote count: 0 I am making a collection view, and have made my own custom collectionCell. I have specified so in the identity inspector, and as far as i can tell, i have done everything right. The code is import UIKit class SubjectCollectionViewCell: UICollectionViewCell { @IBOutlet weak var imageVie...
How to use session outside a controller
◷
تاریخ انتشار: 1395/2/10 | ساعت: 23:06
Vote count: 0 I have a Signalr Hub called NotificationHub that handles sending new notification to co ected clients. The NotificationHub class uses a NotificationManager class to retrieve notifications data. Now, I want to be able to use a session to store the last time a new notification has been a...
I want to use $lookup function of mongodb
◷
تاریخ انتشار: 1395/2/10 | ساعت: 23:06
Vote count: 0 product[{ "_id" : ObjectId("5720cc7d6e589904b855cc12"), "p_id" : "p0001", "p_name" : "printed_pant", "p_company" : "Hoffman", "p_price" : 3677.0, "p_color" : "charcol", "p_size" : "XL", "total_price" : 77217.0, "total_sell" : NumberInt(21) }] branch[{ "_id" : { "c_branch_id" : "b03", "...