Questions tagged [scalar]

In computing and programming, a scalar variable or value refers to a single value, as opposed to data structures such as arrays or lists.

In computing and programming, a scalar variable refers to a single value, as opposed to data structures such as or s. A scalar can be of any type, including a complex type such as an object or string. Being scalar only means that it is manipulated as a single value.

As an example, the string type in C++ is considered to be a scalar as it is a primitive type containing a single value, although in the C language there is no such primitive type. Thus, the char array implementation of strings typically used would not be considered as a scalar.

See also:

532 questions
0
votes
0 answers

Return Percent value from 2 Count(*) values in scalar function?

I am new to a particular job and using Scalar Functions for the first time. The more records I try to process however the S L O W E R .. it gets.. Am I doing something wrong? I am reading from a view and have 2 criteria in the WHERE clause. 40…
JoJo
  • 4,643
  • 9
  • 42
  • 65
0
votes
3 answers

Perl: file content into a scalar variable

I am having problems doing this: $contents = do { local $/; }; $contents =~ "s/\n/ /g"; print $contents; I want to join all lines of a file into one. However, it doesn't work... Any idea what's happening with my code? Thank you.
user2886545
  • 711
  • 2
  • 8
  • 18
0
votes
1 answer

Must declare scalar variable @BillNo

I have "Must declare scalar variable @BillNo" problem in this code don't know how to fix it. i'm very new to C# and programming. I've commented other scalar variables to understand but still have the problem. Data inserts when i don't use scalar…
user2566013
  • 407
  • 1
  • 4
  • 4
0
votes
2 answers

Accessing 3-tuple values of a char*

I am having what is follow: char* imgData; Scalar scal = cvGet2D(imgData, x, y); Where Scalar is defined as below: typedef struct Scalar { double val[3]; } Scalar; What I want to have a scalar as a result, but without the use of cvGet2D. How can I…
MelMed
  • 1,702
  • 5
  • 17
  • 25
0
votes
1 answer

Scaling a line segment by a given factor

I am having trouble implementing a scaleByFactor() method in my code for a project. I keep getting errors that say the return statement is wrong but I simply don't know what the code is supposed to be returning. public class LineSegment { /** …
user2785079
  • 57
  • 1
  • 2
  • 9
0
votes
1 answer

Scaling a line segment - Java

In a project for my CS class, I am supposed to use a double value to scale a LineSegment and return a new LineSegment whose start Point is the same start Point of the old LineSegment, but with a new end point from being scaled. I am unsure of how to…
0
votes
2 answers

XTK - Add scalar field to vtk mesh

We are trying to associate scalars values to cells/points from a VTK mesh read from file. We know that is possible to do something like using FreeSurfer different curvature files - CRV (as shown in example 12 -http://lessons.goxtk.com/12/ ) Our…
0
votes
2 answers

Given a full name (First Last) as one scalar entered by the user, how can I print the first and last names individually?

I'm pretty new at Perl. I have to have the user enter their full name and then print just the first, just the last, and the in "last, first" format. I basically just have chomp ($name = <\STDIN>); so far. And a bunch of stuff that hasn't worked.…
0
votes
0 answers

How to transform a Bitmap

Or to ask it in a other way "How to repair a crooked Bitmap by given Parameters" the Situation i got an Bitmap which was scanned and could be crooked so i will check it agains some known values to get all 4 (real)corners for example: …
WiiMaxx
  • 5,322
  • 8
  • 51
  • 89
0
votes
1 answer

Using a scalar as a condition in an OLE DB data flow

I am having a problem with a data flow task in an ssis package i am trying to build. The objective of the package is to update tables situated in our local server using a connection to a distant server containing the source of the data, through a…
0
votes
3 answers

casting vars in function calls

So if I build a class... class Foo { public $_string; public function($sString = 'new string') { $this->_string = $sString; } } I would like to forcibly say that $sString is of type string in my function arguments, something…
Rob
  • 237
  • 2
  • 9
0
votes
2 answers

How to select output scalar values in sql server?

Hi I'm still new in TSQL. How can I output Scalar variables so that my vb code can access it? in VB I use the rs method. In this case I will have to create 3 rs to be be able to access the data below. I would like to have a stored proc that can…
user2059064
  • 153
  • 3
  • 7
  • 17
0
votes
1 answer

Scalar becoming matrix without asking R

I'm writing a chi-sq stat test in R and my scalar chisq is being converted to a matrix and I can't figure out why. The variables used here include k is a scalar f is a kxk matrix n is the number of data points being evaluated chisq is meant to be a…
vcelloho
  • 81
  • 1
  • 5
0
votes
1 answer

Applicability in SNMP scalar objects

What is the correct way to show applicability of SNMP Scalar Objects when doing an SNMP-GET request? For example, imagine that we have a monitoring parameter that is only valid under certain system configuration: Should we return a noSuchObject…
Marda
  • 161
  • 1
  • 11
0
votes
2 answers

add 18 hours to getdate() result

I'm trying to get yesterdays date on 18:00:00 time. I've tried this: DECLARE @YesturdayDate datetime = DATEADD(D, 0, DATEDIFF(D, 0, GETDATE()-1)); select dateadd(h,18,@YesturdayDate) but i'm getting an error when run the select statement: "Must…
user1508682
  • 1,329
  • 5
  • 23
  • 34