Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~4K People Reached
Favorite Forums
Favorite Tags
Member Avatar for johans22

Got blue, red and yellow lights that each can turn ON independently of one another. Using operators, structs, etc. how to obtain the current color, if having: Red & Blue is purple, Blue and Yellow is green and Yellow & Red is Orange. This is not a homework.

Member Avatar for rubberman
0
266
Member Avatar for johans22

typedef struct { unsigned char Val1; unsigned char Val2; unsigned char Val3; unsigned char ValArray1[2]; unsigned char ValArray2[2]; unsigned char ValArray3[2]; unsigned char Val4; unsigned char Val5; }s1; From the above structure, would like to map only the Val3, ValArray1,ValArray2 and ValArray3 to series of bit values using ideas like …

Member Avatar for AssertNull
0
255
Member Avatar for johans22

how to populate/add & read values to this map?. typedef map<string, map<string,map<string,vector<int>>> > myNestedMap; The combination Key1+key2+key3 is unique.

Member Avatar for Taywin
0
148
Member Avatar for johans22

I am very new to vb6.0. I got these questions: in vba 6.0, how to check if time is between today 6:00 PM and next day 6:00 AM then do something. in vba 6.0, how to check if time is between today 1:00 AM and 6:00 AM then do something. …

Member Avatar for mlesniak
0
112
Member Avatar for johans22

vector<vector<double>> v2d(2, vector<double>(3,0.0)); How later on reset all elements back to 0.0?. How to clear vec entirely, free memory?. Are there any performance degradation in using vector arrays verus conventionl arrays using new or malloc?.. What can be done to minize such degradation if any?.

Member Avatar for ravenous
0
296
Member Avatar for johans22

Got an array 350x550 of type integer. There are groups of connected or single elements with value 7 in some areas of the array. I need a c or c++ code that identifies each group or element and returns each group's total element(s) plus location of each element in the …

Member Avatar for johans22
0
206
Member Avatar for johans22

I am looking for a simple c/c++ code that converts 16b-greyscale image to raw format using tiffio.h?.

0
53
Member Avatar for johans22

The 3rd party to EXE calls like call backs work but call backs from 3rd party DLL to another DLL won't work. 3rd party DLL has to message the upper EXE or DLL that evetually gets emailed out. Working platform is Vista or Win 7.

Member Avatar for johans22
0
88
Member Avatar for johans22

how to do this in C: if got: myheader.h: #define sz 5 in program if option = 2, sz for marray change to 10. extern unsigned char marray[arrsz]; also, in C file, locations[] be the first one if option = 1 or be locations[] be the second one if the …

Member Avatar for David W
0
218
Member Avatar for johans22

#include <stdio.h> static int Var1; static FUNC() { //do stuff with var } void CALL_FUNC() { //call FUNC //do stuff } void fc1(void) { CALL_FUNC(); } void fc2(void) { CALL_FUNC(); } void fc3(void) { CALL_FUNC(); } //etc. void main() { } goal is to break the fc1, fc2 and others …

Member Avatar for johans22
0
186
Member Avatar for johans22

i need to be able to delete registry key in windows 7 and win XP using c/c++. Is there any example code that does it? I modified a VB code that I wrote for win2000 and it partially works on both OSs with error messages. I need to start fresh.

0
45
Member Avatar for johans22

how to convert float number (92.764 or 2.14) to character string without using sprintf?.

Member Avatar for Ancient Dragon
0
95
Member Avatar for johans22

#include <iostream> typedef struct _elems { int a; int b; int c; }elems; static elems eArray1[]={{5,9,13}, {12,22,1}, {2,3,4},{4,3,1}}; static elems eArray2[]={{23,121,55}, {88,23,90}}; eArray1 and eArray2 can have different sizes such as 1x3, 2x3, 4x3, 5x3, etc.How to combine these ,eArray1 and eArray2, into a structure called eArray and loop and …

Member Avatar for Ancient Dragon
0
141
Member Avatar for johans22

I have a text file with one of the lines as : name=AB,CD,EF I read the line like this: input# line,str first str is name=AB then the next line is CD and then EF, why it does not read the whole line at once.

Member Avatar for rishif2
0
135
Member Avatar for johans22

A loop continuouly runs 3*Y/8. In intel processor, how to optimize the speed of this computation: 3*Y/8

Member Avatar for rubberman
0
93
Member Avatar for johans22

#include <iostream> typedef struct _test { int a; int b; int c; }test; test sArray1[]= { {10,2,3}, {3,9,0}, {90,56,82}, {7,8,2} }; test sArray2[]= { {10,12,32}, {13,99,40} }; *//i need to initialize sArray as:* test sArray[]={//how?. is this possible?. sArray1 sArray2 }; int main(int argc, char* argv[]) { *//in here be …

Member Avatar for johans22
0
115
Member Avatar for johans22

given struct s={int A; int B}; what is most logical and fastest way to find the B element given A in this array or vice versa?. s table1[]={{1,2},{3,4},{5,6},..};

Member Avatar for johans22
0
139
Member Avatar for johans22

why this program crashes?. what is the fix?. #include <iostream> typedef struct test { int array[10]; }test; static test *p; int main(int argc, char* argv[]) { p->array[0] = 10; std::cout << p->array[0] << std::endl; return 0; }

Member Avatar for RonalBertogi
0
165
Member Avatar for johans22

import logging ... log1 = logging.getLogger() How can I find out what is the file name + path used for logging?. Like to find that out from anywhere the logging is accomplished. also, for plotting, plot.xticks(), I like to create a range to force beginning tick, the ending tick and …

Member Avatar for johans22
0
149
Member Avatar for johans22

I have numpy type array, array[x][y], 16bit, little endian. How to save this to a tiff file as an image?.

Member Avatar for johans22
0
160
Member Avatar for johans22

import matplotlib.pyplot as plt plt.plot(x, y, 'b-') plot.legend ( ... ) 'put legend on left, i do not have the actual code with me. plt.show() How can I resize the plot window to show the legend on the left side?. Also, I like for program Not to stop when calling …

Member Avatar for Lardmeister
0
136
Member Avatar for johans22

I was reviewing the code at the following two sites. I noticed that memory allocation "new" has been used to allocate space for the Node(s). How are they freed?. very good codes. http://visualcsamples.blogspot.com/2010/11/sparse-matrix.html http://www.syntax-example.com/Code/implement-subtract-function-big-number-992.aspx

Member Avatar for jackmaverick1
0
154
Member Avatar for johans22

//use nib in Nibbler to set nib1, nib2, nib3. How the Nibbler and ABC get more efficient to send the Nbytes in ABC?. [CODE]union ABC { unsigned char Nbytes[4]; struct { unsigned short nib1 : 4; unsigned char NA1 : 2; unsigned short nib2 : 4; unsigned short nib3 : …

Member Avatar for L7Sqr
0
69
Member Avatar for johans22

I like to be able to modify the content of "pBuf" without modifying the content of the file. what would be the options, if that would be possible at all?. pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object FILE_MAP_ALL_ACCESS, // read/write permission highDWordVal, lowDWordVal, BUF_SIZE1); //BUF_SIZE);

Member Avatar for johans22
0
78
Member Avatar for johans22
Member Avatar for Derek Elensar
0
107
Member Avatar for johans22

my text file name is doubledata.bin. It is quite a large file, but too large. data in it is like: 12.3453<tab>0.4065<tab>88.3454 etc. I like to read these files as fast as possible into memory arrays. any code to do that?.

Member Avatar for VernonDozier
0
73
Member Avatar for johans22

is it possible to create array of pointers and set + get its elements using a class like this?. make changes/add to the class as needed. show actual code, if possible. [CODE]class t { t::t() { } t::~t() { free(array); array = NULL; } void set_size(int s) { array = …

Member Avatar for Fbody
0
146
Member Avatar for johans22

can i use the same handle over again in a loop?.. HANDLE fhandle; HANDLE fhandleMap int *Mem = NULL; for (loop 7 times) { fhandle = CreateFile(file, GENERIC_READ, ...); fhandleMap = CreateFileMapping(fhandle, ...); . . Mem = ...; ... // do various things } if (fhandleMap) {CloseHandle(fhandleMap);} if (fhandle) {CloseHandle(fhandle);}

Member Avatar for thelamb
0
138
Member Avatar for johans22

I use visual studio tool. This compiles but no real output. [CODE]#include <iostream> #include <windows.h> #include <cstdlib> struct somestruct { char *name; int number; }; void mythread(void *lpParam) { somestruct* p = static_cast<somestruct*>(lpParam); printf("%d\n",p->number); ExitThread(0); } int main() { DWORD thread; struct somestruct *p; p = (somestruct*)malloc(sizeof(struct somestruct)); p->name=(char*)malloc(strlen("First Last")+1); …

Member Avatar for daviddoria
0
84
Member Avatar for johans22

I am sort of new to forums, therefore forgive me for mistakes. I am trying to eliminate a for loop within a function and run the function in multiple threads. Is it possible?. The comment inside the code, explains it. Any reasonsble change that results in a good multi-threading. [CODE]#include …

Member Avatar for johans22
0
97