Questions tagged [concept]

Concept programming is a programming paradigm focusing on how concepts that live in the programmer's head translate into representations that are found in the code space. This approach was introduced in 2001 by Christophe de Dinechin with the XL Programming Language.

Concept programming is a programming paradigm focusing on how concepts that live in the programmer's head translate into representations that are found in the code space. This approach was introduced in 2001 by Christophe de Dinechin with the XL Programming Language.

For more, see Wikipedia.

300 questions
1135
votes
12 answers

Node.js + Nginx - What now?

I've set up Node.js and Nginx on my server. Now I want to use it, but, before I start there are 2 questions: How should they work together? How should I handle the requests? There are 2 concepts for a Node.js server, which one is better: a.…
Van Coding
  • 24,244
  • 24
  • 88
  • 132
114
votes
3 answers

how to implement Interfaces in C++?

Possible Duplicate: Preferred way to simulate interfaces in C++ I was curious to find out if there are interfaces in C++ because in Java, there is the implementation of the design patterns mostly with decoupling the classes via interfaces. Is…
helpdesk
  • 1,984
  • 6
  • 32
  • 50
66
votes
2 answers

What is a distributed cache?

I am confused about the concept of Distributed Cache. I kinda know what it is from google search. A distributed cache may span multiple servers so that it can grow in size and in transactional capacity. However, I do not really understand how it…
Joey
  • 2,732
  • 11
  • 43
  • 63
54
votes
3 answers

Why does same_as concept check type equality twice?

Looking at the possible implementation of the same_as concept at https://en.cppreference.com/w/cpp/concepts/same_as i noticed something strange is happening. namespace detail { template< class T, class U > concept SameHelper =…
user7769147
  • 1,559
  • 9
  • 15
28
votes
5 answers

Interact with other programs using Python

I'm having the idea of writing a program using Python which shall find a lyric of a song whose name I provided. I think the whole process should boil down to couple of things below. These are what I want the program to do when I run it: prompt me…
ttriet204
  • 353
  • 1
  • 5
  • 13
22
votes
2 answers

Python supports a limited form of multiple inheritance. In what way limited?

In the python tutorial it's said that "Python supports a limited form of multiple inheritance". What are the limitations?
ElenaT
  • 2,600
  • 4
  • 24
  • 41
19
votes
2 answers

How to do simple C++ concept has_eq - that works with std::pair (is std::pair operator== broken for C++20)

Compiler Explorer link template concept HasEq = requires(T t) { { t == t } -> std::convertible_to; }; struct X {}; static_assert(not HasEq); //bool a = pair{} == pair{}; static_assert(! HasEq>); //…
lewis
  • 1,116
  • 1
  • 12
  • 28
19
votes
12 answers

Is it necessary to write else part in every if condition?

The question I asked might be closed, But i just want to know that is it necessary to write else part of every if condition. One of my senior programmer said me that "you should write else part in every if condition" . Suppose we have no condition…
Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256
13
votes
6 answers

Recursion Vs Loops

I am trying to do work with examples on Trees as given here: http://cslibrary.stanford.edu/110/BinaryTrees.html These examples all solve problems via recursion, I wonder if we can provide a iterative solution for each one of them, meaning, can we…
sachin
  • 1,376
  • 2
  • 15
  • 37
12
votes
4 answers

Why .NET is a Framework and Java is a Language

Ok. It's not a battle. I'm curious about the concept of framework, I worked with some frameworks like django, zend, rails and cakephp in various levels. Today a friend of mine sent me a presentation where he listed .NET as a framework, no big…
Jonathan DS
  • 2,050
  • 5
  • 25
  • 48
12
votes
2 answers

Passing a concept to a function

Since concepts are defined as compile-time predicates, is it also possible to actually reuse these predicates for compile-time algorithms? For example would it be possible to check whether all types in a tuple conform to a concept? As far as I have…
Andreas Loanjoe
  • 2,205
  • 10
  • 26
12
votes
3 answers

Can a pure function call external function?

Can a pure function call an external method? for example: class Dog { function jump(name) { return "a dog named " + name + " jumped!" } function jumpTwice(names) { var result = []; for (var i = 0; i < 2; i++) { …
bbnn
  • 3,505
  • 10
  • 50
  • 68
11
votes
6 answers

Remove unwanted jQuery functions

Helo, A library like jQuery is fully loaded and comes with many functions that we may not use in our scripts. Am wondering if there is a way to say read my script find out all the jQuery functions that I am using and its dependencies and then remove…
Alec Smart
  • 94,115
  • 39
  • 120
  • 184
11
votes
3 answers

Getting started with Core Data

I am having trouble understanding how Core Data works conceptually and in terms of code. I get that there is a coordinator and a context. I also get that there is state management. How do they work together? I don't understand how I can store, say,…
Moshe
  • 57,511
  • 78
  • 272
  • 425
11
votes
1 answer

Give a generic enum type as template argument

In short: Is there a way I can feed a General templated class with something that only represent an enum type? Something like: template struct General {}; struct EnumSpecific : General {}; is too much / does not…
iago-lito
  • 3,098
  • 3
  • 29
  • 54
1
2 3
19 20