deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Did you ever do any reverse engineering for your code?

Yup. I was doing it today. :) One of the best things about .NET is being able to decompile assemblies and learn how they work.

Concerning ethics, it's wrong to take something as a whole and claim it as your own. It's not wrong to investigate and learn from something, and it's not wrong to adapt what you learn in your own code.

As far as the artist mentality goes, I've seen both my libraries and raw code posted elsewhere online by others (programming style is very individual, and at a certain point you can identify your own code). It makes me happy that people found it useful enough to use it. I'm less happy when they say "I wrote this" when they clearly didn't, but that happens when you post stuff to the public domain.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What, no comment on the changes? :)

It's jacked up to the point of being useless now. :( The times are all jumbled rather than in order, and it's difficult to tell what's current. Also, the update is too fast to properly investigate what's happening in realtime.

iamthwee commented: Was thinking the same +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Also when you would creat a project, did you use a flowchart and any pseudocode?

Nope. For complex projects I'll draw out my idea of how it should all work together on a whiteboard, but for the most part I iterate the design as I go. After years of experience, I only rarely have to scrap large portions of code and start over anymore.

In team projects we have an initial design phase, then move into agile iteration from there.

I have things in my head that I'd love to start doing, but knowing if I should hold off due to it's complexity.

It never hurts to try. You'll learn quickly whether it's so far beyond your capability to manage, and the benefit of pushing your limits is that your limits increase with the experience.

What were some of your very first applications/tools you created?

The first useful ones were report filters and password generators. Everything else was just whatever came to mind as practice, and barring saved snippets for later use, most of what I wrote is lost to time. Though stuff I've posted online remains over a decade afterward. Some of it is embarrassingly bad to my current eye. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

As a first language I think c++ could be easier and faster to learn then C#. If you have never learned a programming language before there are lots of concepts that C# assumes you know.

Um...dafuq? How does C++ not have lots of concepts you're assumed to know? Further, no beginner should be expected to already know things, that's the whole point of learning. Regardless of which language one chooses, there will be a learning curve if one is new to programming.

I consider myself to be reasonably proficient with both C++ and C#. In terms of the languages, C# is friendlier and easier to learn. In terms of standard libraries, in general the C# libraries are easier to learn despite being more numerous. But one could argue that learning the .NET framework benefits C++ too if you're using C++/CLI.

If given the choice between only C++ and C# for a beginner to programming, I'd recommend C# as the first language.

Well I just spent 50$ on that book for C#, roughly how long should I spend on C or C++? Also what program should I use for C or C++? I get Visual Studio Pro since I am in school.

Honestly, it doesn't matter what language you start with. Just pick one and run with it. The lessons you'll learn will be valuable, and you can always switch to another language as you get a feel for your preferences and needs.

Since you already have …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

int len = strlen(z[i]);
for(j = 0; j < len; j++)

All strlen does is search for a '\0' character, so it's more efficient to simply do that yourself as in my example in a previous post. This is assuming the string is valid in the first, place, of course. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You're testing z[i], which is an array rather than a string. Try this instead:

for (i = 0; i < 3; i++)
{
    for (j = 0; z[i][j] != '\0'; j++)
    {
        if (z[i][j] == 'a')
        {
            ++count;
        }
    }
}

Note that the outer loop only goes through the number of strings you actually input, this is important if you don't initialize all of the strings to be blank. The inner loop only searches the contents of the string (which ends with a '\0' character in a valid string). Finally, the condition checks the characters in each string as you're using an array of arrays of char.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Because Daniweb has rules. Specifically: "Do provide evidence of having done some work yourself if posting questions from school or work assignments"

Your problem is clearly a basic exercise intended for learning, and thus constitutes homework. Therefore we expect a certain measure of effort on your part before offering help. If we did the work for you, you'd learn nothing.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'd be of a mind that if somebody was prepared to pay for a service and the task was not unreasonable for the amount offered, then why not? Money loosens morals :)

My concern is destroying the integrity of Daniweb and potentially introducing legal issues from schools or students who have suffered punishment for cheating. If the homework rule needs to be modified such that there's less ambiguity in what constitutes homework, so be it, but a feature that essentially turns us into rent-a-coder would be the kiss of death, in my opinion.

If the payment is a pool for future questions then it's a non-issue. The pool simply doesn't apply for cheating on one's homework. Perhaps place bounty threads in a moderation queue for approval? That would slow down the process, but ensure that the bounty question meets requirements.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Yes, the vast majority of us can help. But we won't do it for you.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I like the idea in concept, of course the details need to be hammered down carefully if money is involved. In particular I'd like to see a handful of things in particular:

  1. The bounty amount can be set from the asker's available pool. This benefits higher priority questions or questions of greater difficulty.

  2. The asker chooses one or more answers manually and the bounty is split between those who answered. Automating the process does nothing but introduce opportunity for abuse.

  3. Allow high profile members to exclude themselves from the auto-selection process. Some of us don't do this for money, and adding the pressure of performing for a fee tends to take the fun out of it. ;)

  4. The homework rule should apply regardless of bounty. In fact, for violations of that rule, the bounty should be null and void even if someone answers before moderators can get to it. This will discourage people from doing people's homework for the bounty.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

IIRC, provided it meets the size restriction, animated avatars are not a problem. However, the size restriction is pretty low, so it may be difficult finding a suitable animated avatar.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Got some more help from a friend and he talked about "unlink technique"

Sounds like non-standard terminology. Did he go into detail about what that means?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Not if they want a job, a lot of the answers on skillgun are wrong, and the questions are barely in english.

Actually, that's perfect for the majority of interviews. ;) Typically even the "advanced" questions I get are stuff like this:

Them: What does the internal keyword do?
Me: <perfect answer>
Them: Wow, I just learned about that the other day and I've been coding for years.
Me: Seriously?

If you're even remotely proficient with C#, you'll seem like a god.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The second is more correct. When you say new[], you should use delete[], when you say new, you should use delete. They can't be mixed and matched.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

There already is one, provided the member has submitted an approved tutorial.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The first function returns a pointer to char, the second function returns a char. The function itself isn't a pointer in this case, the return value is.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Can Java be used for systems programming? Yes. Is it the best choice? That somewhat depends on the system, but I'd lean toward it not being the best choice.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I think that warning labels advising against standing on the very top step of a ladder are completely unnecessary.

Or the warning that the package may contain nuts on a bag of nuts. Sadly, the presence of those warnings means there was a lawsuit at some point to justify the warning. So people really are that stupid.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

my problem: is that the values are showing up in the file after excution

What behavior were you expecting?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Your interface methods don't match the implemented methods of the same name. The implementations have three arguments, the interface states that those methods should take no arguments. Therefore, these are unrelated methods to those declared in the interface.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The method belongs to the class and not any single instance of the class.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

At the end of the first loop, ptrBr points to a memory location before br[0]. You need to either increment ptrBr or reset it:

#include <stdio.h>

int main(void)
{
    int i, j;
    float ar[5] = {12.75, 18.34, 9.85, 23.78, 16.96}, br[5];
    float *ptrAr, *ptrBr;
    ptrAr = ar;
    ptrBr = &br[4];
    for ( i = 0; i < 5; i++) {
        *ptrBr = *ptrAr;
        ptrAr++;
        ptrBr--;
    }
    ptrBr = br;
    for ( i = 0; i < 5; i++) {
        printf("%5.2f\n", *ptrBr);
        ptrBr++;
    }
    return 0;
}

And if your goal is simply to print the array in reverse, no copying is necessary:

#include <stdio.h>

int main(void)
{
    float ar[5] = {12.75, 18.34, 9.85, 23.78, 16.96};
    float *ptrAr = &ar[4];
    int i;

    for (i = 0; i < 5; i++)
    {
        printf("%5.2f\n", *ptrAr--);
    }

    return 0;
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Agreed that homeopathy is largely crap. If you take the stuff that's been proven both through the ages and through science to be effective (honey, garlic, etc...), the collection of "remedies" drops to a fraction and only covers what we'd consider to be minor illnesses and traumas.

Better yet, a number of homeopathic remedies have been shown to have worse side effects and complications than the corresponding pharmeceudicals while also being less effective (if effective at all).

I'm very cautious when someone recommends a "natural" remedy.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Your pointer doesn't point anywhere meaningful. Allocate some memory to it first. Also, there's a different getline for C-style strings that's a member function of cin.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

See my original post -- it doesn't likeImports System.Numerics

Imports only opens up the namespace for you so that you don't need a fully qualified name every time. You still need to reference the assemby, otherwise the namespace simply doesn't exist in the project.

And as you can see from my second post .NET 4.5 is installed, which meets the requiremenet of 4.0 or higher.

Installed and targeted are two completely different things. I have 4.5 installed, but if I only target 2.0, I can't use anything in the 4.5 framework. Look at your project properties.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The target framework for the project needs to be 4.0 or higher. With Visual Studio 2013, unless you changed the framework when creating the project, it'll be 4.5. Also, be sure to reference System.Numerics.dll in your project as well, since it's not a default reference.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The point is that Micosoft originally tried to force the Metro screen as the default and I believe that this was a boneheaded decision which they have been steadily retreating from.

Because any mistake cannot be tolerated? Sometimes I think that the Microsoft hate is taken a little too far. Innovation involves risk of mistakes, and an iterative approach as real feedback comes in (not just focus groups) is totally expected. Everyone loves XP now, but when it first came out there were similar complaints that were corrected in service packs.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Assuming the code is a snippet and not complete, there are only two direct errors (braces instead of brackets on line 6 and endline instead of endl on line 12).

If there are supposed to be 10 errors, you can't make the assumption that headers were included properly, namespace std was opened, that the functions exist, or that the functions are called correctly.

If that's all the code you were given, that should give you a hint. Otherwise, please post the full code.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

num3 isn't a float, try using the correct specifier in printf.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What do you mean by "multiple linked"?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Why couldn't they have made the improvements under the hood and left the interface alone?

Clearly because of Microsoft's new direction into tablets and consistency across platforms. If the only goal were backend improvements, I'd agree with you. I'm still not sure the consistency thing is even a good approach, but I've found it quite pleasant in my personal computing. At work I'm doubtful that it's of benefit at this point, in which case the UI change can be viewed as painful and unnecessary.

Supporting tablets probably isn't the only reason, but it's the most publicly touted one. In reality, they likely also wanted something new and shiny to justify selling a new OS rather than trying to get away with charging for a service pack.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Please read our rules concerning homework. We won't do it for you, and require some proof of effort before providing help.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

File operations are inherently slow, relative to in-memory operations. I'd probably go with writing smaller blocks than dumping all of the file contents to a line for a single WriteAllText call. The framework can handle its own buffering for performance and you can limit the amount of string processing you're doing in memory as well as how much memory you're using. A big hit to performance often involves crossing cache lines, which large strings are wont to do.

The absolute fastest you can get would probably force you to drop down to WriteFile using PInvoke, but WriteAllText is one of the fastest options from the framework from benchmarks I've seen.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Is the Windows 8/8.1 interface significantly better than Windows 7 or is it just different?

Therein lies the rub. "Better" is subjective. As a desktop OS, I would describe it as different, but not so different as to deserve the bad press. As an OS that runs on both my desktop and my tablet, the consistency is a big win, in my opinion. Since the goal seems to have been an OS that's suitable for tablets as well as desktops and servers, I don't think Microsoft missed the mark too much. And this is after having experience in all three arenas.

Much like moving from Windows to Linux or vice versa where the interface is different, there's a learning curve, but it's not a steep one.

And I feel that the improvements under the hood justify that learning curve, which is why I run Windows 8.1 on my personal machines.

Also note that Microsoft is listening to feedback and improving the interface. Barring the start button fiasco where the UI designers basically gave us the finger by adding a button that takes you to the start screen between 8 and 8.1, I'm seeing things moving in a positive direction. You really can't ask for much more given that the Windows 8 UI design is a step away from the tried and true OS interface. Novelty takes time to nail down the details.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I installed Windows 8 and it's interface is so unfamilier.

That seems to be the prevailing opinion. However, it strikes me as a little odd that people are so unwilling to learn something new and immediately run back to the familiar.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Since your items don't contain spaces, it's irrelevant, but I'd start with something simple and straightforward:

richTextBox1.AppendText(Environment.NewLine + "upgrade cottage " + listBox2.SelectedItem.ToString().Trim());
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Please read my previous post again. I did answer your question.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Add a space to the string literal:

"upgrade cottage " + listBox2.SelectedItem

Will the selected item ever have a leading space? If so, you can add a condition to work with that and avoid two adjacent spaces. However, that's probably not necessary as leading spaces in list boxes are rare.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I wonder if that rogue semicolon one line 1 has anything to do with it. ;) My recommendation in general is to always use braces around a compound statement to avoid this and the next related error you're sure to encounter just by deleting that semicolon.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

how can I quote a respose?

There a question mark button on the editor that will take you to this page describing our Markdown formatting. You can also use any of the other buttons for quick formatting without manually typing it yourself. Just clicking the button will give you a default output, and clicking the button with text already highlighted will format it for you.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Iterators were designed based off of pointers, so a pointer is a form of iterator, but an iterator isn't necessarily a pointer.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

That doesn't make it any less of a homework assignment according to our rules.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I don't see people use const this way, adding const everywhere they can, let alone const pointers. Is there a reason for it?

Probably best to ask the author of such code their reasoning. I can think of a few reasons ranging from not understanding best practice, to encountering errors when adding const and then removing it rather than fixing the errors, to outdated programming habits.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Please don't just post your assignment. Also post an honest attempt along with the difficulties you're having as proof of effort. Daniweb is not a homework service.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I've taught both ways, and high level to low level works better. Going the other way just results in an excessive amount of prerequisites to do anything meaningful, and the student either gets bored or frustrated. Starting higher level while making it clear that there are important things going on under the hood that need to be understood later seems to produce better results.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I tried for over a week to get office 2010 to work on win 8 and every attempt failed. Finally bought office 365.

That's seems odd, that a recent Microsoft application suite wouldn't run on a recent Microsoft OS. I actually use Kingsoft at home though, which works just peachy on Windows 8, and is free.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

If you're happy with Windows 7, there's no need to upgrade. It's really that simple. Even folks who are still on XP choose to stay despite it no longer being supported by Microsoft.

I'm also using a base install of Windows 8.1 for my home system and quite happy with it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

maybe @Dani could add a 'Please Mark as Solved' button that users could click to notify the owner of the thread that they should mark it as solved.

The chance of that notification reaching the thread starter doesn't justify adding that feature. As mentioned, the majority of threads are one-off where the one who started it never returns. If you feel a thread should be marked as solved, any moderator can do it. Just flag the first post to let us know.

However, note that to be solved doesn't mean the right answer was given, but that the creator of the thread clearly showed that his or her question was answered. That's one reason why moderators don't mark threads as solved all willy nilly just because we see the right answer in one of the replies.

Further, there's an argument in favor of not cleaning up unsolved threads, despite the feature being available. If the thread is solved, helpful people who have something to add may be less likely to respond. It's a tricky balance between notifying readers that the thread has an accepted answer and encouraging helpers to continue the discussion in a constructive manner.

I don't disagree with your feature suggestion, but I like to play devil's advocate. ;)

Doogledude123 commented: Definitely some good points here. +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

jj++++j*j-- i got the answer 400 but how it is ?help me

The answer you get is irrelevant since the entire expression is undefined due to modifying j multiple times between sequence points.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Isn't that why restaurants have only a single person seating diners at any given time? If there's only one gatekeeper, concurrency isn't at issue.