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

Why does `ranges::view::for_each` require the functor must return a model of the `InputRange` concept?

#include #include #include using namespace ranges; int main() { auto coll = std::vector{ 1, 2, 3 }; std::for_each(coll.begin(), coll.end(), [](auto){}); // ok coll | view::for_each([](auto){});…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
10
votes
4 answers

The difference between a `global variable` and a `field`?

Fields are variables within a class or struct, local variables sit within a method and global variables are accessible in every scope (class and method included). This makes me think that fields might be global variables but that global variables…
Arthur Mamou-Mani
  • 2,303
  • 10
  • 43
  • 69
10
votes
2 answers

Which one is fast, Abstract class or Interface?

Possible Duplicate: Why are interface method invocations slower than concrete invocations? I recently had a chance to appear in an interview in which interviewer asked which one is faster among Abstract class and Interface. Though i got confused…
Furqan Safdar
  • 16,260
  • 13
  • 59
  • 93
9
votes
1 answer

Unterstanding how Vaadin uses GWT

After playing around with Vaadin for about a week I'm curious about how Vaadin uses GWT. GWT compiles Javacode to Javascript. This has to be done everytime when you are redeploying. Since Vaadin has to be understood as a server-centric framework,…
Benjamin Brandmeier
  • 724
  • 1
  • 9
  • 19
9
votes
1 answer

Can concepts be used to put a constraint on values as well as types?

Concepts can be used to put a constraint on types as template parameters like the example below: template concept the_concept1 = sizeof(t) > v; template t> struct some_struct1{}; I am trying to use a…
AKL
  • 1,367
  • 7
  • 20
9
votes
7 answers

Is Hashing a suitable solution? Am I over-complicating it?

I write a 2D platformer game where I need rooms with (maximum 4) doors. I write it in Java, but the language is irrelevant. Each room can have 4 doors, on the top, bottom and sides. I call them NORTH, SOUTH, EAST and WEST. When I'm building a room,…
Dávid Tóth
  • 2,788
  • 1
  • 21
  • 46
9
votes
2 answers

Understanding C's fork() through a simple example

#include int num = 0; int main(int argc, char*argv[]){ int pid; pid = fork(); printf("%d", num); if(pid == 0){ /*child*/ num = 1; }else if(pid > 0){ /*parent*/ num = 2; } printf("%d",…
Locke McDonnell
  • 93
  • 1
  • 1
  • 4
8
votes
2 answers

What's the difference between software and firmware?

I know this is a bit of a basic question, but I am a little confused and couldn't find the complete answer on Google. I know that the difference has to deal with how permanent and malleable a section of code is. However, how do you draw the line…
wcarhart
  • 2,685
  • 1
  • 23
  • 44
8
votes
4 answers

"Client" concept in OOP Design Patterns?

I read many topics about OOP Design Patterns of GoF, but i am not sure about "Client" concept. So what is it? How can we realize it in our application. Thank!
Trần Minh
  • 1,633
  • 4
  • 15
  • 17
7
votes
4 answers

Demandware MVC concept

I am new guy to Demandware and I am switching from Magento to Demandware. Demandware is not opensource I am not getting proper tutorials, stuff to understand the concepts of it. I am from Magento so I know the Magento MVC structure. But in…
Charlie
  • 524
  • 2
  • 11
  • 31
6
votes
2 answers

Extjs: How to approach the concept: Add, remove, add instance

Concept: Consider having two panels A and B, and a window C like in the following example. The buttons on the window switches between the two panels. var A = new Ext.Panel({ title: 'A' }); var B = new Ext.Panel({ title: 'B' }); var C = new…
Chau
  • 5,540
  • 9
  • 65
  • 95
6
votes
4 answers

Timer Efficiency

I am planning to develop a system with tens of thousands of objects in it, which will each have up to 42(but more likely down around 4 or 5) separate actions they will potentially be performing at regular intervals. I also plan to write code that…
Jrud
  • 1,004
  • 9
  • 25
6
votes
3 answers

Handle multiple EntityManager in Java EE application

I have Java EE application with about 10 EntityManagers (number of EMs will probably increase). My application also contains many stateless, statefull and message driven beans. Rather than inject in each bean my EMs with @PersistenceContext (and 2…
Olivier J.
  • 3,115
  • 11
  • 48
  • 71
5
votes
6 answers

Why should I use asynchronous operation over synchronous operation?

I have always pondered about this. Let's say we have a simple asynchronous web request using the HttpWebRequest class class webtest1 { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("www.google.com"); public webtest1() …
deutschZuid
  • 1,028
  • 2
  • 15
  • 33
5
votes
1 answer

What happens when the name of a C++20 concept is the same as the name of a class type

Does C++ define the behavior of the following code: template concept C = true; struct C {}; template struct A {}; template struct B {}; int main() { // when using MSVC C c; // error bool b = C; //…
ValueError
  • 53
  • 4
1
2
3
19 20