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
2
votes
1 answer

PHP7 - Can type hinting be trusted?

I have recently began to look into the new type hinting which was introduced in PHP 7 and found that it was a really nice and useful addition to add to some of my application therefore I have gone to do so however I have a question regarding…
mhvvzmak1
  • 307
  • 2
  • 12
2
votes
2 answers

Apache-Zeppelin / Spark : Why can't I access a remote DB with this code sample

I am doing my first own steps with Spark and Zeppelin and don't understand why this code sample isn't working. First Block: %dep z.reset() // clean up…
Xaltos
  • 31
  • 1
  • 8
2
votes
1 answer

Calling SQL scalar function from Linq Query

There are many similar threads here, but none of them can't solve my problem. As far as I know, there are two methods for calling SQL scalar function from linq. 1. method: I've added my function to .edmx file using XML editor and my function…
NavCore
  • 1,115
  • 3
  • 10
  • 25
2
votes
2 answers

Perl "scalar" function returning "1" on an empty array

The following Perl code will print a "1", however the function test2 really has no legitimate input value. Why does Perl act this way? test(); sub test { my ($var) = @_; test2($var); } sub test2 { my (@array) = @_; print scalar…
tjwrona1992
  • 8,614
  • 8
  • 35
  • 98
2
votes
4 answers

How do I define an anonymous scalar ref in Perl?

How do I properly define an anonymous scalar ref in Perl? my $scalar_ref = ?; my $array_ref = []; my $hash_ref = {};
tjwrona1992
  • 8,614
  • 8
  • 35
  • 98
2
votes
2 answers

Can't dereference scalar in Perl

Can anyone tell me why this prints REF(*) instead of 0? $a = 0; $a = \$a; print $$a . "\n";
iPherian
  • 908
  • 15
  • 38
2
votes
1 answer

Unable to resolve: 'Must declare the scalar variable "@Parameter"`'

I need to enter a parameter in the pivot down below in the stored procedure. but it states, "Must declare the scalar variable "@pWeek"." I have tried to declare it every which way, but I am unable to figure this out. Everything else is fine on this…
2
votes
4 answers

Scalar or array function

I have to do function which will work as scalar and as array. For example: @t = testfunc(1, 2, 3, 4); $x = testfunc(1, 2, 3, 4); Anbody have idea how I can do it? It have to print "scalar" if it's $x and print "array" if @t. I tried to do something…
Mateusz
  • 323
  • 2
  • 11
  • 23
2
votes
2 answers

Counting unique keys in Couchbase views

I'm trying to figure out a way to count the number of unique values in a bucket that is not a primary key. Couchbase 2.5 provides a n1ql method to do this. If we use their beer-sample you can issue the following command: select count(distinct…
2
votes
2 answers

Saving coefficients and standard errors as variables

I have run a regression and I would like to save the coefficients and the standard errors as variables. I can see the coefficients with ereturn list and e(b) but I have trouble at getting the standard errors. Also, I don't really now how to turn…
user3507584
  • 3,246
  • 5
  • 42
  • 66
2
votes
0 answers

Breeze cannot handle Complex Type Array (Non-Scalar) property from remote service

Library: BreezeJS 1.4.11 client-side library Data Service Adapter: webApiOdata Remote Service: Web API 2 Implementation of OData v3 without Breeze Controller Database: MongoDb I'm running into an issue when handling metadata exposed from an OData…
MrFlavin
  • 21
  • 2
2
votes
0 answers

Hibernate Criteria API and Scalar Subqueries

I want to translate a HQL query to Criteria API but I don't know if it's possible to write the same thing with Criteria. The HQL looks like this: select distinct new DataTransferObject(property1, property2, ..., (select NVL(property3, null) from…
Marius
  • 21
  • 3
2
votes
1 answer

OpenCV java get values from scalar

I've written an image processing routine with OpenCV in C++. Right now I am converting my code into Java, because I have more Java skills than C++. I am using the Scalar Datatype out of the org.opencv.core.Scalar Library. In C++ I was able to…
2
votes
2 answers

function to display dates as YYYY-MMM

as the title states, I'm trying to make a little function to take date values already in the database and display them as YYYY-MMM (eg: 2013-Nov). SQL Server. I tried DatePart but it only takes one part arguement at a time (cant do YYYY-MMM). Any…
jacksonSD
  • 677
  • 2
  • 13
  • 27
2
votes
2 answers

Why do I get the last value in a list in scalar context in perl?

I had assumed that, in perl, $x=(2,3,4,5) and ($x)=(2,3,4,5) would give me the same result, but was surprised at what happened in my tests. I am wondering why this behavior is the way it is and why wantarray behaves differently. Here are my tests…
hepcat72
  • 890
  • 4
  • 22