specializing member S::display requires ‘template’ syntax

specializing member S::display requires ‘template’ syntax

I'm creating a trait class to help with my program. I have a template class called operations that contains the methods display and area. When I define these functions I get errors. Here they are: error: specializing member ‘traits::operat

C++ “fatal error LNK1120” unresolved static class members

C++ “fatal error LNK1120” unresolved static class members

I get the following error message (someone feel free to edit the unnecessary bits): 1>FIXDecoder.obj : error LNK2001: unresolved external symbol "private: static class std::unordered_map,class std::allocator >,class std::basic_string,cla

MPI hangs on MPI_Send for large messages

MPI hangs on MPI_Send for large messages

There is a simple program in c++ / mpi (mpich2), which sends an array of type double. If the size of the array more than 9000, then during the call MPI_Send my programm hangs. If array is smaller than 9000 (8000, for example) programm works

SIGIO arriving for file descriptors I did not set it for and when no IO is possible

SIGIO arriving for file descriptors I did not set it for and when no IO is possible

I am trying to receive a signal when I/O is possible on a file descriptor. The program needs to be doing something else when it is not doing I/O, so using select(2) is not an option.When I run the sample code is below, it is printing the m

How to pass a method to qsort?

How to pass a method to qsort?

There is a class that contains some data and it sorts them at some point of time. I use qsort() and I'd like to keep the comparing function within the class as a method. The question is how to pass a method to qsort() so that the compiler (

Initializing in constructors, best practice?

Initializing in constructors, best practice?

I've been programming in C++ a while and I've used both methods:class Stuff {public: Stuff( int nr ) : n( nr ) { }private: int n;}Orclass Stuff {public: Stuff( int nr ) { n = nr; }private: int n;}Note: This is n

Implementing take using foldr

Implementing take using foldr

This is my take version using foldr:myTake n list = foldr step [] list where step x y | (length y) The output is not what I expect:[3,4]I then tried to debug by inserting the length of y into itself and the result was:[3,2,1,

using class name in a class template without template parameters

using class name in a class template without template parameters

the code comes from a C++ book as below:Why does this public member Link* next have no typename argument?template class Link {private: static Link* freelist;public: E element; Link* next; // this line confused me.... Link(cons

Passing lambdas to std::thread and calling class methods

Passing lambdas to std::thread and calling class methods

I'm having a bit of trouble using std::thread together with lambdas. I have a method TheMethod where I should use std::thread to parallelize some function calls to methods in the same class.I define a lambda function, and try to pass it as

How to convert a string literal to unsigned char array in visual c++

How to convert a string literal to unsigned char array in visual c++

How to convert a string to Unsigned char in c++...I have,unsigned char m_Test[8];I want to assign a string "Hello world" to m_Test.how to do it? 1:Firstly, the array has to be at least big enough to hold the string: unsigned char m_Test[

How to allocate a non-constant sized array in Go

How to allocate a non-constant sized array in Go

How do you allocate an array in Go with a run-time size?The following code is illegal: n := 1 var a [n]intyou get the message prog.go:12: invalid array bound n (or similar), whereas this works fine: const n = 1 var a [n]intThe trouble is, I

vba Excel 2010: convert string array into int array

vba Excel 2010: convert string array into int array

Dim myarray(2) as Variantmyarray(0)="3"myarray(1)="4"myarray(2)="5"myarray(3)="9"I want it to become myarray(0)=3myarray(1)=4myarray(2)=5myarray(3)=9What there any way to make it with no loops, just in 1 line?This is for Excel 2010.I want s

How to render scripts, generated in TagHelper process method, to the bottom of the page rather than

How to render scripts, generated in TagHelper process method, to the bottom of the page rather than

I am generating scripts in process method of TagHelper class as follows[TargetElement("MyTag")] public Class MYClass: TagHelper{ public override void Process(TagHelperContext context, TagHelperOutput output) {StringBuilder bu

How to limit react-redux connect update re-renders to specific state branches?

How to limit react-redux connect update re-renders to specific state branches?

I have an action and reducer that updates a global counter. This action is fired on a rapid interval. The reducer returns a new copy of the state for each action. The reducer looks like:import { handleActions } from 'redux-actions';import {

From a timezone and a UTC time, get the difference in seconds vs local time at that point in time

From a timezone and a UTC time, get the difference in seconds vs local time at that point in time

This should be very simple, but I can't quite figure it out in Python.I want to have a function which takes two arguments, a UTC time in seconds and a zoneinfo name like 'Europe/Vienna' and returns the offset in seconds from local time and

How CudaMalloc work?

How CudaMalloc work?

I am trying to modify the imageDenosing class in CUDA SDK, I need to repeat the filter many time incase to capture the time. But my code doesn't work properly.//start__global__ void F1D(TColor *image,int imageW,int imageH, TColor *buffer){

Extract file name from full path in C using MSVS2005

Extract file name from full path in C using MSVS2005

In a C program, I have a file path in a string (specifically, this is the exe name stored in argv[0]). I would like to extract the file name and discard the directory path using MS Visual Studio 2005. Any built in function for that? 1:No

DateTimePicker automatically move to next datepart

DateTimePicker automatically move to next datepart

Currently, when using the datetimepicker, after you enter the month you have to either hit the right arrow or the "/" for it to move to the day. Is there a property that I can set or a way to know that the month is done and move to the day

GTK Modifying Background Color of GtkButton

GTK Modifying Background Color of GtkButton

Trying to change background/foreground color....Using Gtk+ and C. GdkColor color; gdk_color_parse( "#0080FF", &color ); gtk_widget_modify_fg( GTK_WIDGET(button), GTK_STATE_SELECTED, &color ); gtk_widget_modify_fg( GTK_WIDGET(button), GT

How to test whether a float is a whole number in Go?

How to test whether a float is a whole number in Go?

I originally tried this, however the % operator isn't defined for float64.func main(){ var a float64 a = 1.23 if a%1 == 0{ fmt.Println("yay") }else{ fmt.Println("you fail") }} 1:Assuming your numbers will fit

CString to char*

CString to char*

We are using the CString class throughout most of our code. However sometimes we need to convert to a char *. at the moment we have been doing this using variable.GetBuffer(0) and this seems to work ( this mainly happens when passing the Cs

phpDoc class constants documentation

phpDoc class constants documentation

How do I document class constants for phpDoc? I've read the manual but I can't find anything about them. 1:I'm fairly sure that you can use @const, though I can't find any English documentation. There's a German example here. It shows

find out the type of auto

find out the type of auto

I am playing with generic lambda in C++1y and I often confused by don't know what is the type of auto variable/parameter. Is any good way to find it out?Currently I am using typeid(decltype(arg)).name()) but it is not very useful. @encode g

fastest way to determine if a bit is set in a integer data type

fastest way to determine if a bit is set in a integer data type

I have a method that computes a hash value as per some specific algorithm.uint8_t cal_hash(uint64_t _in_data) { uint8_t hash; // algorithm // bit at hash[0] = XOR of some specific bits in _in_data // repeat above statement for o

Assigning the value of a worksheet cell to a constant

Assigning the value of a worksheet cell to a constant

I am trying to assign the value of a worksheet cell to a constant variable in a VBA macro. The logic behind that action is that the end user is supposed to enter the current week in a specified cell before running the Macro. Since this valu