|
As you were said in the previous post, this is the wrong forum for such questions.
Please search the right forum and post it there. Here is to post about the internal things of the site
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Do not use encryption for passwords. You should add a salt value and use the two pieces of data to create a one-way hash which you store in your database. Remember, encrypted data can be decrypted, hashes cannot. There are many articles and samples explaining this in detail, including Secure Password Authentication Explained Simply[^].
|
|
|
|
|
A whipper-snapper (sort-of) on my team wrote this:
for (index = 0; index < num_systems && systems[index].type == SYSTEM_TYPE_XYZ && (systems[index].name, "XYZname"); ++index);
I don't care very much for excessive cleverness. I care for maintainability. And debug-ability. This does not meet that requirement for me.
Does anyone else feel this way? I am feeling old and curmudgeonly about this, however I want some honest opinions.
|
|
|
|
|
Here's my take on this.
If you need a minute to think about what a code statement does, then it has to go.
Get rid of it.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
Thank you. My confidence is bolstered.
|
|
|
|
|
No, and this is really not the place.
|
|
|
|
|
Sorry I bothered you. Please educate me: Where would you have posed the question?
|
|
|
|
|
The Lounge, or Weird & Wonderful. It's not a C/C++ question.
|
|
|
|
|
Quote: (systems[index].name, "XYZname") ?!?
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
I know!
The line does not even do what the coder intends it to do. Too bad the compiler did not complain.
That alone is reason enough to 86 it, of course.
This program is rife with this kind of stuff. Some of it may even work, but as Superman says, I should not have to spend more than a moment understand it..
|
|
|
|
|
The result of that part of the condition would be the same as
static_cast<bool>(system[index].name)
The string literal will be evaluated but the result of the comma operator is always the leftmost argument. (You probably know that, but I thought I should offer an explanation for less experienced readers)
My guess is this was supposed to be a string comparison. Not that it makes the condition look any better...
Oh, and btw., I know that '??! ' is the trigraph for '| ', but I'm not familiar with '?!? '. Typo?
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
It's like a long paragraph with no commas or punctuation.
cheers
Chris Maunder
|
|
|
|
|
I have made a program with Outlookbar Class and a clistview class now, i'd like when i click in the Outlookbar automatically the view will take the focus. I have tried with SetFocus(). but nothing.
Can you indicate me the correct procedure?
i start with this line to geto pointer to the view
CView* pView = (CView*)GetActiveView();
It will not take you many time, so thanks in advance.
Giovanni
|
|
|
|
|
Hi everyone;
can someone help me with the program im doing..
1. i need to add and save student record without using database or text file.
2. view/search record.. that can be sort by category
3. edit record.
4. delete record
how am i suppose to do it???
hope someone could help..
|
|
|
|
|
Robin Percival Vibar wrote: how am i suppose to do it??? Yes, that's a good question: if you don't want to loose your changes every time your program exits then you have to use permanent storage, that is the hard disk (or another persistent medium like, for instance, flash memory of pen drives). Since you don't want to use a text file, I suppose a binary file is OK for you. You could design your own protocol or use object serialization. If you are using MFC , then you are lucky, since such framework provides good support to serialization, see "Serialization in MFC"[^].
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Hello Everybody,
I'm working on a simple C++ Project in VS 2013 Express. I'm trying to implement a TLS Callback function into a simple prog. What I want to do in future is to check for any present debuggers before the main (entrypoint) is called (...I know that most debuggers can handle TLS).
Here is my code so far and it works:
#include <windows.h>
#include <stdio.h>
using namespace std;
void WINAPI TLSCallback(PVOID DllHandle, DWORD dwReason, PVOID Reserved)
{
MessageBox(0, L"TLS Callback before main.", L"TLS CallBack", 0);
}
#ifdef _M_IX86
#pragma comment (linker, "/INCLUDE:__tls_used")
#pragma comment (linker, "/INCLUDE:__xl_b")
#else
#pragma comment (linker, "/INCLUDE:_tls_used")
#pragma comment (linker, "/INCLUDE:_xl_b")
#endif
#ifdef _WIN64
#pragma const_seg (".CRT$XLB")
const
#else
#pragma data_seg (".CRT$XLB")
#endif
EXTERN_C
{
PIMAGE_TLS_CALLBACK _xl_b = TLSCallback;
#pragma data_seg ()
#pragma const_seg ()
}
int main(int argc, char* argv[])
{
printf("Hello World from main()!");
getchar();
return 0;
}
However, the really strange thing (at least to me) is, that if I switch in VS 2013 Express from Debug Configuration to Release Configuration and compile the project, AntiVir pops up with a message like "TR/Crypt.XPACK.Gen" found in compiled EXE. O.k. since TLS is also used by maleware I can basically understand that AntiVir doesn't like such things, but why does it not happen in Debug Configuration? Is there any way that it also would work in Release Configuration (Linker Options etc.?) ?
modified 4-Oct-14 5:22am.
|
|
|
|
|
hey guys, can I ask for help.
can you guys help me with the algorithm/code for quine mccluskey method on C/C++.
i kinda having trouble with the algorithm and I need to provide the code on Oct 9 for my CS class.
please do help me with my machine problem
thank you and God bless.
|
|
|
|
|
Reuben Cabrera wrote: i kinda having trouble with the algorithm... And that trouble would be?
Reuben Cabrera wrote: please do help me with my machine problem Help is a two way street. What have you done thus far?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
im already at converting the decimal # to binary. but the problem is the output should be like as a whole. i saw other programs converting decimal to binary and they just printed the remainder in reverse. my plan is to multiply the first digit to 10^0 then the next is by powers of 10 so when I add it i will have a whole number.
|
|
|
|
|
and quine mccluskey method would require grouping the minterms according to the # of 1's in their binary form. how do you do that?
then printing the final output as wxyz w'x' etc.
|
|
|
|
|
Reuben Cabrera wrote: I need to provide the code on Oct 9 for my CS class. And you think submitting someone else's code and claiming it as your own is a good idea?
|
|
|
|
|
Dear, you are sooooooooooooo old school...
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Oh you.
|
|
|
|
|
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int convert(int);
main()
{
int var,x,y,number,number2;
int minterms[x],minterm[y];
printf("=========QUINE MCCLUSKEY METHOD========");
printf("\nHOW MANY VARIABLES DOES THE FUNCTION HAVE:?");
scanf("%d",&var);
printf("\nHOW MANY MINTERMS?:");
scanf("%d",&number);
number2=number;
for(x=0;number2!=0;number2--)
{
printf("\nENTER MINTERM:");
scanf("%d",&minterms[x]);
x++;
}
x=0;
y=0;
while(number!=0)
{
minterm[y]=convert(minterm[x]);
x++;
y++;
}
y=0;
while(number!=0)
{
printf("\n %d",minterm[y]);
number--;
y++;
}
}
int convert(int a)
{
int quot,binarynumber[100],i=1,sum=0;
int multi;
quot=a;
while(quot!=0)
{
binarynumber[i++]=quot%2;
quot= quot/2;
if(i==1)
{
sum=sum + (binarynumber[i++] * 1);
}
else
sum = sum + (binarynumber[i++] * multiplier);
}
return sum;
}
|
|
|
|
|
im not submitting someone else's code. i just need help. that's all.
|
|
|
|