Questions tagged [language-concepts]

Use this tag to ask about how a particular idea (arrays, lists, tables, search, sort) is implemented in language X or how to understand a basic part of the language.

Often there is a particular concept that isn't quite grouped into any of the other tags, or it is just too embarrassing because it's a "newbie" idea. Or there isn't a concrete problem to solve and you were just wondering about how something works in language X.

If you wanted to ask about which version of the moot() function is used if class A is inherited from class B and implements C, tag it with inheritance..

But also use this tag to point out it's more of a "Hmm..." question than a "How do I solve this" question.

98 questions
0
votes
1 answer

What type of datastructure does 'collections.defaultdict(set)' create?

Here, we are using set as the missing value default, how can we use an undefined set for that purpose?
0
votes
1 answer

How does the nlp object work in spacy library?

From what I understand so far, it is an instance of the 'Language' class in spacy, and can process text and perform a bunch of operations on it. import spacy nlp = spacy.blank("en") # Process the text doc = nlp( "In 1990, more than 60% of…
Esa Anjum
  • 13
  • 3
0
votes
1 answer

When is a variable in a nested scope destroyed from the memory?

void main() { int x=5; { int x= 6; cout<
Fajer
  • 19
  • 2
0
votes
2 answers

Is every variable and register name just a pointer in NASM Assembly?

There are [] operations which are similar to dereferencing in high-level languages. So does that mean that every variable and register name is just a pointer or are pointers a high-level languages idea and have no use in Assembly?
0
votes
2 answers

When overloading a parent method, why did PHP8.1 change towards deprecating incompatible return types?

I overloaded query method of mysqli class like so: class MySql extends \mysqli { function query(string $sql): ?MySqlResult // line #30 { $result = parent::query($sql); return new MySqlResult($result); } } in PHP8.0 that…
Dennis
  • 7,907
  • 11
  • 65
  • 115
0
votes
0 answers

What is AsyncStorage *for*?

I can find information on how to write calls to AsyncStorage, how it actually stores information on device, etc., and some basic examples of usage storing keys, but what I'm looking for is a broader understanding of why I would use it. The reason…
0
votes
1 answer

An exercise about Java constructors

I have an exercise which is asking us about basics concept apparently. But I can't find any information or at least I'm not sure about what I'm suppose to search. So I have a small class and I need to comment 3 different constructors. It look like…
Alex
  • 21
  • 5
0
votes
1 answer

Add new concepts to the WordNet using NLTK python API OR attach other concepts banks to WordNet

I am working on a project where I want to retrieve the list of semantically similar concepts for a given sentence using WordNet and BERT. But there are some concepts which are not included in the WordNet. So I want to integrate my own list of…
0
votes
1 answer

Simple: Why doesn't function A inside function B change the global variable passed to it?

Code doesn't add one to 'ctr' variable. How to do it? ctr = 0 def x(ctr): #function A ctr+=1 def y(): #function B global ctr x(ctr) #function A y() print(ctr) >>> 0
user12997246
0
votes
1 answer

Where does predefined macros reside in C?

I wonder where are predefined macros are defined and resided in? Predefined macros are defined in compiler or preprocessor which has a dictionary that hold the pre-defined macros in the source code. I mean __FILE__ macro has a definition and…
0
votes
1 answer

How can i make my rounds() function in MATLAB, be very precised when handling around 400 values at a time?

I have made this function rounds() which rounds the values to the nearest multiple of 0.5, ie, rounds(2.685)=2.5 rounds(2.332)=2.5 rounds(2.7554)=3.0 rounds(2.245)=2.0 it works well in the way mentioned above, but while handling large number of…
0
votes
2 answers

How should I change a class value from another

I am learning to program in Java, and I want to know if it is a good concept of OO programming to change a value to a composed class from another composed class. Like this: public class X{ public void x(Y y){ y.setY(0); } } Or…
0
votes
1 answer

SQL INNER JOIN performance

While putting up the SQL Inner join, which table should be defined as the left table and which one as the Right table. Does the size of the table is a determinant in the same. Please explain. I am asking this question from the performance/…
0
votes
1 answer

How to map multiple types in a model class using scala?

I want to map multiple types in a model class, which is being referred from controller and repository class. For Example : case class ManagedService( ...some parameters, attributes: Seq[Attribute], ...etc ) extends…
AKDGP
  • 25
  • 9
0
votes
0 answers

Why array shall be used for sending one single object?

We were going through the Messenger Broadcast API docs. It says: Only one message may be defined per Message Creative. This one message is defined under an array named messages. Not to offend Facebook developers My…
Zameer Ansari
  • 28,977
  • 24
  • 140
  • 219