deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I apologize on behalf of everyone for worrying that you might make a dangerous legal decision. :rolleyes:

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Are you doing this in Windows Forms or WPF?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

In Ketsu's example, Library 3 only needs to reference Library 2 and not Library 1. Library 2 references Library 1.

You have to reference what you use by name. If you don't use something by name because it's hidden in another library, you don't need to reference it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What goober wrote those questions? Question 95 is especially entertaining given the acronym vomit of its multiple choice answers, but most of the questions are amusing.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Wow. Just...wow.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I just know that my client has a 12-man strong in-house legal team; so I'm sure they'll figure out the rest and make it happen.

12 lawyers weren't able to come up with air tight wording for this and asked a non-lawyer to get the opinions of other non-lawyers? Hmm.

<M/> commented: lol +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'd start with something like "Applicants must be of legal age in their country of citizenship". But this is definitely something that should be written with the consultation of a lawyer.

mmcdonald commented: Exactly what I was after +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Consider a linking table. Remove tecnico from agendamento_diario then add a new table for linking the two together:

agenda_link:
    agenda_id, tecnico_id
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

When you're storing a list of entities in a column, that suggests you have shared data which can be normalized. Let's take your names example and make up something to show the setup.

Denormalized

business_unit:
    bu_id, managers, address

-- Separating the manager names is a chore
select managers from business_unit where bu_id = @bu_id;

Normalized

business_unit:
    bu_id, address

employee:
    emp_id, bu_id, name, is_manager

-- Names are separated naturally
select name from employee where bu_id = @bu_id and is_manager;

One obvious benefit of this is the managers can be abstracted into employees and share the same table.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What does your data represent?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

if u dont have an answer to my post>>>>>>>>>>>>>>>>>>>>just SHUT up .

Last I checked, this was a public forum. AD makes a good point. Your writing style makes a strong first impression, and it's not a good one.

That said, I have an answer to your post. Discussion of writing exploits is against Daniweb's rules. Please find help cracking into systems elsewhere.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

res would have 20,000*20,000 elements & space needed=400000000 * sizeof(long long)

Assuming the minimum size of long long, you're trying to allocate about 3GB of consecutive memory at one time. Chances are good the allocation will fail.

So does C support long long res[10^9];

No, the ^ operator represents binary XOR, not exponentiation. Static allocation of this amount of memory is even less likely to succeed due to stack size limits.

If you absolutely must sort that much data, I'd recommend looking into an external sorting algorithm rather than an in-memory algorithm. Or break down your data set into something manageable.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You're not assigning the text with correct formatting. Try this instead:

textBox1.Text = string.Format("{0}-{1:00000000}", pcount.Substring(0, 4), pcountAdd);
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The error seems straightforward to me. String and DBNull are incompatible types, so you need to handle them separately:

If dataview(0)("name") = DBNull.Value Then
    ' Handle a null name
Else
    ' Handle a non-null name
End If

How you handle the name depends on what your "..." part does.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You can also simply click on the NEW icon next to the forum name (on the home page) to mark it as read.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Until you really know what you're doing, it's a good idea to compile code you want to show off before posting it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Stack overflow is when you put too much stuff on the stack. It's usually triggered by excessive recursion. Access violation to 0x0 is when you try to write to a null pointer. Stack corruption is a little more subtle. It happens when you do someting like write beyond the bounds of an array and mess up bookkeeping information stored on the stack.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I didn't make any claims, so there's nothing to prove.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Are you using a debugger? Please post a sample of the input that consistently fails.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

To clarify, is this VB.NET? Because there's quite a difference between that and VB 4/5/6.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

A segmentation fault means you accessed memory you don't own. The two most common causes are a pointer that's not properly initialized an an index outside the bounds of an array. Trace through your code and ensure that all of your pointers point to enough memory, then make sure all of your indexes are within those bounds.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Keep a frequency table:

int numbers[] = {1, 4, 5, 5, 5, 6, 6, 3, 2, 1};
int freq[10] = {0};

for (int i = 0; i < sizeof numbers / sizeof *numbers; i++) {
    if (numbers[i] >= 0 && numbers[i] < 10) {
        ++freq[numbers[i]];
    }
    else {
        printf("Invalid digit: %d\n", numbers[i]);
    }
}

for (int i = 0; i < 10; i++) {
    printf("%d has occured %d time(s)\n", i, freq[i]);
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

That's simple enough: args is an uninitialized pointer, not a pointer to infinite memory. To simulate a 2D array you need to first allocate room for the number of pointers you want, then allocate memory to each pointer. Same thing with pipe_args.

The pattern is this:

char **args = malloc(10 * sizeof *args); // Allocate 10 pointers to char

for (int i = 0; i < 10; i++) {
    args[i] = malloc(255 * sizeof *args[i]); // Allocate a string of 254

    // Populate args[i] with a string and terminate it with '\0'
}

// Use args in your program's logic

// Clean up your mess
for (int i = 0; i < 10; i++) {
    free(args[i]);
}

free(args);

The long and short of it is that if you have a pointer, it must point somewhere. If you don't tell it where to point, your code is broken and will probably segfault.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

And I have become confused on what this thread is about...

I'd wager it's about the OP boosting his post count with pointless posts.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Your question is nonsensical, please rephrase it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

So it is an ibiscus, an istory and a hibiscus, a history But I still don't know what the general writing rule is.

I'd write it the way I speak it, and recognize those cases where speech may vary when reading how others write. So in writing, "an LED" and "a LED" are equally correct because both pronunciations are equally correct.

The key to understand is that rules of writing aren't chiseled in stone; good writers will follow them in general, but break them without apology when doing so is justified. However, the difference between that and poor writing is an understanding of the rule and having a good reason for not following it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Many experts program with a plain text editor most of the time.

Professionals will use any tools necessary to speed up the process, but as it's sometimes said, the tools don't make the programmer. A good developer shouldn't be handicapped if you take away his IDE, he'll just switch gears without pause. That's why it's so important to understand what the IDE does for you and how to get by without it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

1.if .net is a wrapper around win32 api it means we are able to do everything with .net that we used to do with win32 api. then why we still need the p/invoke to the win32 api?

Because there's not a .NET interface to all of the Win32 API. For some things you still need to call into the Win32 API through PInvoke. Accessing the message loop directly or "low level" windowing features, for example.

2.what are the limitations (in terms of programming) of .net compared to win32 api ?

Due to the abstraction of .NET, there can be performance issues. In such cases optimization techniques include dropping to a lower level with PInvoke or writing high performance pieces in something like C++.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Acronyms are interesting because sometimes you might spell them and sometimes you might say them as a word. The guideline for indefinite articles is "a" for words starting with a consonant and "an" for words starting with a vowel.

LED when spoken is usually spelled out as ell ee dee, so you'd use "an" because the pronunciation begins with a vowel. A more varied example would be SQL. I say seekwool ("a SQL database" because the pronunciation starts with a consonant), but others might say ess kyoo ell ("an SQL database" due to the starting vowel sound).

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Agreed. "Performant" is a non-word, but it's descriptive and useful in software development and IT. As such, I have no problem at all using it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Being in IT, I also hear a lot of words that have been invented.

A lot of fields have their own jargon. If doh can make it into the official lexicon, I have no business discouraging word inventing when it improves communication. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Try increasing the z-index or just BringToFront on the control if you want it at the top level.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You aren't casting the results of malloc() and realloc() to the appropriate type. They return a void* and that should be cast as needed.

The cast is unnecessary in C, and including it (on top of being a potential maintenance issue) will hide the legitimate error of failing to include stdlib.h. One of the benefits of how C handles conversions to and from void* is you can do this to not even mention the type except in the pointer declaration:

p = malloc(sizeof *p); // Yay, no mention of p's type needed

The bigger issue in the ninja-edited code is using create as both the first argument and return of realloc. If realloc fails and returns NULL, you've lost your only reference to the memory. A temporary pointer is recommended. Some variation of this, for example:

T *temp = realloc(p, new_size);

if (temp != NULL) {
    p = temp;
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Without seeing the code, it's hard to tell. malloc and realloc will return NULL on failure, but there are gotchas that could appear to work yet still be subtly broken.

Can you post a small sample of how you're allocating, using, and releasing your memory?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Are you doing anything with the characters after counting them? If not, storing them is a waste of memory and also inflexible because you're shoehorned into the 100 character upper limit (using arrays at least).

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'd use the homepage more if Fred and the new discussion panels didn't take up so much room. Perhaps you could add a way to collapse those and store the preference in a cookie?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

To clarify my own understanding:

  • The grid contains agents
  • All displayed agents are bound by a single parent
  • The text box contains a total amount tied to the parent
  • Agents must be shared a part of the total amount based on their commission percentage

If all of that is true, where does the amount given to each agent get stored? Is there a column in their record in the database or is it in another table?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Note that the process which has the file open could be your process, if you've opened it before and failed to close it or try to open it again before disposal completes.

I'd strongly recommend downloading and learning how to use Process Monitor to troubleshoot these types of errors. That tool has saved me so many times in both development and IT support.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What's the difference among them all?

First and foremost what I look for is what barcode symbologies are supported by a library. The usual 1D suspects are generally supported because they're super easy to write. I could write my own code39 barcode reader and writer in less than a day.

2D barcodes are harder because they nearly always include an encoding step that can be pretty involved. Those are where having a good third party library is invaluable. From there the cost of the library, support from the vendor, and robustness of recognition/generation are key points.

I've worked with a lot of these libraries (usually the commercial ones), and it's surprisingly difficult to find one that has good support of barcoding with a good licensing model. Free libraries thusfar have always fallen short in terms of my needs, unfortunately.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'm here to ask a help because I am not a Expert like you I'm a newbie on C# program.

I'm happy to help, as evidenced by my posts in this thread. However, the purpose of helping is for you to learn. Eventually you should learn enough to not need to ask for help. As an example, I rarely ask others for help because I'm able to do research and think through my problems on my own.

When it seems like I'm being asked to do all of the work and thinking for you (such as fixing simple syntactic and semantic errors), I get the strong impression that you're not learning anything, and thus my help is pointless. If you can't do that much, you'll be right back here in no time asking for more "help".

I want a simple query to catering my needs.

At this point I'd question why you haven't managed to come up with something workable, or even something different from what you had originally. I've given you a lot of code, and plenty of ideas for moving forward. Barring doing it all for you including a sample database schema and complete working code, what more can I do for you?

Ketsuekiame commented: You can lead a horse to water... +10
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Of course, the well-educated person will avoid these situations if possible.

Best practice is to avoid such situations in formal writing, not because the faux rules are in any way "better" to follow, but because "well-educated" people tend to crucify a writer for breaking them. In other words, best practice is best practice for the sole purpose of publishing writings with a minimal amount of bullshit from the target audience. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Hah, I read too fast and didn't even see that, diafol.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I didn't understand the thing about "splitting infinities". I still don't get it. Is that an expression or something? Or is it some clever joke that I'm too stupid to understand?

An example would be "to not be" instead of "not to be". "to be" is the infinitive, and the faux rule is that you shouldn't have descriptive words in the middle that "split" the infinitive. But consider Star Trek's "to boldly go", which hits harder than "boldly to go" or "to go boldly". English offers the flexibility of splitting infinitives in an effective manner, and avoiding that flexibility is silly when it works well.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I got my Hypocrite Medal during a battle of words on the C++ forum

It's not easy to be consistent. Also, one's opinions may change over time, which can smell like hypocrisy but is really just adjusting to new experiences and knowledge.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

First and foremost, your code exhibits undefined behavior because you only ever initialize the first character of the string. The actual problem you're seeing though, is that you only store one character at a time in string[0], and it gets replaced with each iteration of the file reading loop.

The counter will only increment if the last character in the file is 'a', or the random memory used by string happens to have an 'a' in it.

A better approach would be to read a character, then check it:

int ch;

while ((ch = fgetc(f)) != EOF) {
    if (ch == 'a') {
        ++counter;
    }
}

fclose(f);
castajiz_2 commented: tnx! +3
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Based on your codes I am going to send the whole packet rite.

My example parses only the request line defined here.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

And no tutorials on here, James? :)

I just added one yesterday, O ye of little faith. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Walk over the source once. Keep a reference to the first match and as long as the source matches the pattern, walk over the pattern too. If the pattern reaches the end of the string, you have a complete match. Otherwise, reset the pattern and start over.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Can you suggest some ways so that I cam improve my writing and speaking skills ?

There's no quick and easy solution. Read and listen to people with the skills you want, and try to emulate them in your own writing and speech.

I have seen that prit and deceptikon English is really very good.

I don't know about priteas, but linguistics is a hobby of mine. I've also invested a not insignificant amount of time writing novels, novellas, short stories, and technical documentation. The key to fluency is and always has been practice.