Questions tagged [singular]

Singularity is a mathematical term indicating an undefined point on a set (function). Singularity arises in many mathematical optimization problems with many variables.

An example of singularity is the derivative of the absolute value function |x| at x = 0.

Singularity arises in many ill-posed problems

137 questions
67
votes
2 answers

Ruby on rails: singular resource and form_for

I want user to work with only one order connected to user's session. So I set singular resource for order routes.rb: resource :order views/orders/new.html.erb: <%= form_for @order do |f| %> ... <% end %> But when I open the new order page I get…
petRUShka
  • 9,812
  • 12
  • 61
  • 95
44
votes
4 answers

rails singular resource still plural?

I have a search route which I would like to make singular but when I specify a singular route it still makes plural controller routes, is this how it's supposed to be? resource :search Gives me search POST /search(.:format) …
holden
  • 13,471
  • 22
  • 98
  • 160
26
votes
10 answers

function switching between singular and plural?

I'm looking for a function that given a string it switches the string to singular/plural. I need it to work for european languages other than English. Are there any functions that can do the trick? (Given a string to convert and the…
dynamic
  • 46,985
  • 55
  • 154
  • 231
20
votes
3 answers

Test if a word is singular or plural in Ruby on Rails

Quick question. How can I test a word to see if it is singular or plural? I'd really like: test_singularity('word') # => true test_singularity('words') # => false I bet rails is capable! Thanks.
doctororange
  • 11,670
  • 12
  • 42
  • 58
15
votes
3 answers

Converting plural to singular in a text file with Python

I have txt files that look like this: word, 23 Words, 2 test, 1 tests, 4 And I want them to look like this: word, 23 word, 2 test, 1 test, 4 I want to be able to take a txt file in Python and convert plural words to singular. Here's my…
theintern
  • 511
  • 2
  • 6
  • 14
14
votes
1 answer

Swift - CGAffineTransformInvert: singular matrix. UITextView & iAd

I have View Controller with UITextView and in the bottom I have iAds. When I access the View Controller I get an error: : CGAffineTransformInvert: singular matrix. Why? Everything works fine, but when I change from Portrait to Landscape or…
Bogdan Bogdanov
  • 882
  • 11
  • 36
  • 79
12
votes
7 answers

best practice(s) for singular word or plural words?

This is about best practices in general, not specific for a single language, database or whatever We all have to deal with generated output where you can be reporting "one products" or "two product". Doesn't read very well... Some just solve this by…
Wim ten Brink
  • 25,901
  • 20
  • 83
  • 149
9
votes
1 answer

How to find degenerate rows/columns in a covariance matrix

I am using numpy.cov to create a covariance matrix from a dataset of over 400 time series. Using linalg.det gives me a value of zero so matrix is singular. I can use linalg.svd to see that the rank is two less than the number of columns so somewhere…
user1812712
  • 91
  • 1
  • 2
8
votes
2 answers

Return elements of the Groebner Basis as they are found

This question could refer to any computer algebra system which has the ability to compute the Groebner Basis from a set of polynomials (Mathematica, Singular, GAP, Macaulay2, MatLab, etc.). I am working with an overdetermined system of polynomials…
mboratko
  • 376
  • 3
  • 16
8
votes
1 answer

How can I implement "natural" url scheme routing tables in ASP.NET MVC

I would like to specify my routing tables such that they would feel much more "natural" /Products /Product/17 /Product/Edit/17 /Product/Create Close to the defaults configuration but such that "Index" action would be mapped to the multiples form of…
Roland Tepp
  • 8,301
  • 11
  • 55
  • 73
8
votes
1 answer

Detecting mulicollinear , or columns that have linear combinations while modelling in Python : LinAlgError

I am modelling data for a logit model with 34 dependent variables,and it keep throwing in the singular matrix error , as below -: Traceback (most recent call last): File "", line 1, in test_scores =…
ekta
  • 1,560
  • 3
  • 28
  • 57
7
votes
3 answers

Confused by AngularJS ng-repeat syntax

What is the meaning of the singular/plural syntax in, say, ng-repeat="product in store.products"?
dpren
  • 1,225
  • 12
  • 18
6
votes
2 answers

numpy.linalg.inv returns inverse for a singular matrix

The matrix below is singular, and AFAIK attempting to invert it should result in numpy.linalg.linalg.LinAlgError: Singular matrix but instead, I do get some output matrix. Note that output matrix is a non-sensical result, because it has a row of…
niklas
  • 81
  • 1
  • 4
6
votes
1 answer

Singular matrix - python

The following code shows a problem of singularity of a matrix, since working in Pycharm I get raise LinAlgError("Singular matrix") numpy.linalg.linalg.LinAlgError: Singular matrix I guess the problem is K but I cannot understand exactly how: from…
johnhenry
  • 1,293
  • 5
  • 21
  • 43
5
votes
1 answer

zeroinfl "system is computationally singular" whereas no correlation in predictors

I am trying to model count data on the number of absence days by worker in a year (dependant variable). I have a set of predictors, including information about workers, about their job, etc..., and most of them are categorical variables.…
Rcoffee
  • 51
  • 1
  • 3
1
2 3
9 10