deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Spire.Barcode appears to only have a .NET build, so yes, that's a reasonable assumption concerning mobile devices.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You're going to get a cellclick event if a click is registered within the cell. That's at a higher level than focus of the internal control, so you can't avoid it. Your best bet would be to determine the mouse position for the click and cancel the cellclick if it's not within the checkbox bounds.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

he only reason that I find python, html, css, javascript easy is becuase I have learned them.

Fair enough. To answer your question, I'd suggest Code::Blocks for C++, which has a Mac build.

Thank you (hopefully it wasn't rude)

It wasn't rude at all. Hopefully you'll not take the following as rudeness as well. :) Our terms of service require members to be at least 13 years of age. This is a hard legal requirement, and therefore I'll kindly ask that you do not post again until you're of age. As an act of good faith, I won't ban your account, on the assumption that you'll honor our legal limitations concerning membership.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

So if you dont declare protection it is default set to private?

Enumerations and interfaces are public by default when nested in a class. Top level types default to internal. Everything else is private by default.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Reuben (12 years old, wanting to be a programmer when older) - please don't take my age into a beignner like you should learn python, it is a simple programming language you can do alot with it...

Just verifying, you're 12 years old? Also, note that Python isn't some toy language for n00bs, it's a powerful language that also happens to be clean and simple. That's why it's often recommended as a first language.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Provided the DLL references appropriate assemblies for your presentation (WinForms or WPF), displaying a form and returning the result is a no-brainer. The key will be deciding how you want your application to call into the DLL. It can be as simple as exposing a public dialog form and doing this:

Using dlg As New MyDialog(initStr)
    If dlg.ShowDialog = DialogResult.OK Then
        TextBox1.Text = dlg.Result
    End If
End Using

That's actually how I'd do it, and how I've usually chosen to do it before (I've done this a lot since extensions and customizations through plugin DLLs are something I do often) because it cleanly separates responsibility.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I love barcodes. In my line of work (image processing and document imaging), barcodes play an integral part in high quality automation. As such, I've developed code from the lowest level of encoding and decoding barcodes up to using a number of libraries for working with barcodes.

The biggest problem with libraries is cost versus functionality. Most of the commercial libraries tend to be expensive and also separate their licenses between 1D and 2D barcodes such that obtaining full functionality is even more expensive. Free barcode libraries rarely support 2D barcodes, which is a deal breaking 9 times out of 10 for me, and when they do the symbology support is weak at best. This is understandable because 2D barcodes typically involve terribly complex encoding and decoding logic, but it's still frustrating to drop thousands of dollars for a commercial library that often includes awkward licensing limitations.

In my endless search for the best library, I found Spire.Barcode. This is a freely available encoding and decoding library that supports both 1D and 2D barcodes. Further, the recognition quality is surprisingly good. That said, there is one huge con:

  • Barcode recognition returns an array of strings.

Why is this a con? Well, there are two questions which are common in barcode recognition that are not directly supported:

  1. What barcode symbology was used to detected the value?
  2. Where is the zone from which the barcode was detected?

As far as I can tell, #2 is impossible with Spire.Barcode as it …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

As soon as i open the program back up the data disappears.

That sounds like you're doing something to truncate the table(s) when the application loads. I'd start by tracing what happens as the application loads in the debugger and keep an eye on the database to narrow down when exactly this data loss occurs.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

This is untested, but off the top of my head seems reasonable:

rowCount = dgv.SelectedCells.OfType(Of DataGridViewCell)().Select(Function(x) x.RowIndex).Distinct().Count()

Essentially, each of the selected cells has a RowIndex property. You can use that to determine the count of rows and also any of the selected cell row indices if needed (which is probable).

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The error says your Button class is missing a default constructor yet an object of that class is being created as such.

Can you post the lines in particular from Chest.cs that are mentioned in the error?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Why don't you think it's correct?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

If you don't want to use any .NET languages, then ASP.NET won't be useful to you. There's a little bit of a dependency there. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I don't understand the question. Are you looking for a grayscale conversion and edge detection algorithm? Are you looking for some undefined range of image processing that includes those? Please clarify.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Why can a private variable be accessed by a get and set modifier if its supposed to be private? Isnt a private variable supposed to be protected from modification from outside its class?

A private member is supposed to be protected from uncontrolled modification. A property or method that exposes a private member typically does so in a controlled manner in well designed code.

I suspect in asking the question you're thinking of this:

private int foo;

public int Foo
{
    get { return foo; }
    set { foo = value; }
}

And that's not best practice because it's not much better than making foo public. The most you'll get out of it is future proofing for if you decide to tighten up access to foo (ie. the property is already there and only the set needs modification).

Of course, rather than making the private member public, an autoproperty is the better choice when you don't need controlled public access:

public int Foo { get; set; }

Though I've found more often that I favor this in the general case:

public int Foo { get; private set; }

Wherein Foo is set internally through another component of the public interface like a constructor or method.

Ketsuekiame commented: +1 for the very first line of your post. Not many people understand this +11
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Your problem is known and common. Take a look at this thread for details and resolutions.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You can program and do not need to understand what algorithm/data structure is

Actually you do, even if it's informally. Algorithms and data structures are the core of programming. Any time you process data somehow, that's an algorithm. Any time you collect data in storage, that's a data structure.

int[] stuff; // Hey, a data structure!

...

// Oh my, an algorithm!
for (int i = 0; i < n; i++)
{
    sum += stuff[i];
}

Algorithms and data structures aren't limited to the "offical" or "standard" ones that books will describe, though you can learn a ton about how to design your own by studying them.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

getline also gets input from the user...and from the same place (cin), which is the root of your problem.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

cin>>x reads the first word in the stream. getline(cin,x) reads the rest of the line. If there's nothing else on the line, getline won't read anything.

It seems like you're expecting these two operations to not remove what they read from the stream, which isn't the case.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster
cin>>in;

This reads the first word in the stream.

getline(cin,in);

This reads the rest of the line in the stream. Remove the cin>>in; line and getline should include all of the user's input rather than a part of it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

that would be ok if it doesn't have a spam signature?

Not really, but it's far more of a judgment call than obvious signature spam. For a first offense I'd likely leave it be. If posts like that are common, I'd be more inclined to delete flat out due to lack of substance and send a PM (but refrain from issuing infractions unless the PM is ignored). If it's all the member posts, I have no sympathy.

One thing to keep in mind about spammy posts without a signature is that a signature can be added at any time. A not uncommon tactic is to create umpteen borderline spam posts and then add a signature link. So I'm somewhat hesitant about letting borderline spam slide when there's a good possibility for it to become full blown spam.

My general recommendation would be to bring in at least one other mod to help make the call so that we don't end up subjectively deciding what constitutes substance on a whim. It's a fine line, to be sure.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

They re both alot alike, so which one would be better to learn?

There you go. They're similar languages, and thus this makes it easier to learn both. So learn both. :)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster
  1. Adding arguments inline is faster, but more dangerous due to the ease of SQL injection attacks. Using parameters is safer, but a smidge less efficient. In this case your first example is better.

  2. Transactions have overhead, so you shouldn't use them if they're not needed. In this case, I'd question the need for the transaction. However, it's not clear just from the code if you want to remove it or not. It would depend on the contents of the basicInsert stored procedure.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'll answer your question with another question: what does string.compare return and what does that value represent?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The library user would never - ever include any of these files.

Provided you can guarantee this, then it's only a question of transparency for maintenance programmers. All in all, I see no problem with breaking internal headers down like you've suggested. An important lesson is that best practice is not always practice. But care must be taken when deviating from best practice, and it looks like you're taking great care in doing that. :)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What if i put in the password is "8Aa9$" and i want it to be viewed as a strong password ?

Even though it's not a strong password at all? ;3

Anyway, I'd probably go with something like this for your specified requirement:

Private Function PasswordStrength(ByVal password As String) As Integer
    Dim strength As Integer = 0

    If password.Any(Function(x) Char.IsLetter(x))
        strength += 1
    End If

    If password.Any(Function(x) Char.IsDigit(x))
        strength += 1
    End If

    If password.Any(Function(x) Char.IsPunctuation(x) Or Char.IsSymbol(x))
        strength += 1
    End If

    Return strength
End Function

Then in the event:

Select Case PasswordStrength(TextBox1.Text)
    Case 0
        Label1.Text = "Invalid Password"
    Case 1
        Label1.Text = "Weak"
    Case 2
        Label1.Text = "Medium"
    Case 3
        Label1.Text = "Strong"
End Select
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

While I agree in concept, in practice that would be too much to ask of the thread owner. Even the way things are we have problems getting thread owners to mark the thread as solved. Making the process harder by asking them to go through the thread and pick out the most helpful answers would likely result in a marked drop in solved threads. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Yes. There are a number of APIs out there, including one that comes with Office, that will support this functionality.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

How does your database store slots? If the first available slot simply isn't present in the table, a simpler approach would be to query for used slots:

select slot from inventory order by slot;

Then figure out the first unused one in code:

int next_slot = 1;

for (auto it : slots) 
{
    if (*it != next_slot)
    {
        break;
    }

    ++next_slot;
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Most likely your code is wrong in one or more places and needs to be fixed. You can expand the Errors tab or the Output tab to view errors and warnings during build.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Yes, but this is in C#. Don't know if it can be done in VB. Just as C# does not have all the possibilities of VB.

That's in terms of language syntax, and the gap is shrinking with each new version. In terms of framework support, anything you can do in C# you can do in VB.NET.

Helas, only one road: WPF.

Agreed. Shiny prettiness is WPF's bread and butter. Presentation tricks that are a bear to accomplish in WinForms can often be completed with a one-liner in WPF.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'm reasonably sure (please correct me if I'm wrong) that VB6 isn't freely availably legally. As such, any discussion of acquiring a pirated copy is against Daniweb rules.

Likewise with the packaged hardcopy documentation, though that's more of a gray area.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I don't have the code readily available at the moment, but I could have sworn that source file types were allowed, including .txt and .java.

What browser are you using? We've noticed issues before with different browsers as concerns file upload.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Looks like the void main stuff has been fixed, but there's no exposition at all. Throwing code at beginners with no explanation won't accomplish much. While it's good to be exposed to examples, the examples must be high quality and carefully explained such that readers understand why they're high quality and why they do what they do.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

However, for the short term, the idea was to split this monster up into functionally related groups using the include mechanism. What I hope to learn here is if there are any hidden dangers in this technique.

Provided the "modules" are independent enough to justify breaking them down, or the breakdown is internal and not exposed to users of the library, it's all good. The key with organizing a library is transparency. A user of the library must be able to figure out what headers to include for which functionality with relative ease.

If users end up asking "what the heck do I include to do XYZ?", your library is poorly organized.

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

What does Input accomplish when the variable is an array?

FOR K = 1 Add 1 to Average Then

Average is 0 at this point, so your loop would never execute. If the goal is to populate the arrays, it should be either this:

FOR K = 1 Add 1 to 100 Then

Or something else that takes advantage of the Input Employees result. I'd suggest a separate count variable for the number of employees to use in your for loop. Note that your code doesn't validate any input. What happens if I type 0 or 101 for the number of employees?

Set Average=Sum/Average

Average is still 0, so you're dividing by 0 here. To get an average you need to divide the sum by the count of items. In this case, K. Also note that Average is an integer, which mathematically means you don't get sub-zero precision.

If K = Add 1 to Average Then

Is this a loop? If not, why are you adding to your average? Won't that skew the results?

If Salaries=[K] < Average Then

This strikes me as a syntax error, you have a rogue = in your array index.

Minor nitpick, your code doesn't output anything, so how would you know that the code accomplishes anything?

Otherwise, looks fine. The pseudocode is reasonably clean and the logic is sensible in that I understand what you were going for.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

To elaborate a little bit, the if keyword and condition doesn't constitute a statement. To be described as a statement the body must be included. If the condition ends with a semicolon, you have an empty body that does nothing at all:

// An if statement
if (condition) body

// An incomplete if statement
if (condition)

// A pointless if statement that does nothing
if (condition);

// Equivalent to the above
if (condition)
{
    ;
}

The body can be either a single line statement in which a semicolon terminates it, or a compound statement surrounded by braces (and not terminated with a semicolon:

// Single line body if statement
if (condition) ...;

// Compound body if statement
if (condition) { ... }

Should your body only contains one statement, you can eschew braces, otherwise braces are required to make it a compound body.

General best practice is to always use braces though, because it avoids this fun little error where the second line is not part of the if body yet appears to be due to poor indentation:

if (condition)
    statement;
    statement;

It also makes it more convenient to add statements to a body (which happens often) and not worry about adding braces too. Minor yes, but frustrating nonetheless. :)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

It somewhat depends on how much you do exactly with those tools and if you run them all at once. For example, Photoshop alone can be a massive resource hog. One of my buddies is a photographer, and for several years he used Mac exclusively because of the higher RAM threshold available to Photoshop. IIRC, his photo processing machine had 64GB of RAM and was pegged often.

Your best bet would be to audit your resource needs as you work. Log how much RAM is being used at any given time, how much you dip into virtual memory, and CPU usage. That will give you a good idea of what your needs are for a new machine.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Daniweb is not a homework service. We expect you to write the code you need, but will assist with specific problems or questions you might have.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Every job asked for a Bachelors plus a large handfull of other programming skills I was lacking.

That's normal, unfortunately. HR departments are usually the first gatekeeper and will demand between reasonable and unreasonable credentials. This is where knowing someone on the inside is a good thing.

The reason for my question here is that I've heard it may possibly be a difficult environment for women and older programmers

As always, it depends. I have yet to see any significant difficulties for women in general, provided we're talking about real difficulties rather than petty ones. ;) A larger issue would be older folks. It's unfortunately not uncommon to perceive older people as technological dinosaurs who are set in their ways and refuse to learn new things. You may find yourself having to defend against that mindset in competition for a job with younger people.

as a newbie 50+ woman when graduating will I be a guppy in a pool of sharks LOL?

That's the case as a newbie in general. However, as a 50+ woman, you probably have quite a bit of education and experience in other fields that can be leveraged to give you an advantage over your ~20 year old peers fresh out of high school and college. Exploit that as much as you can. :)

A woman friend of mine works in IT and has found it pretty tough.

IT is a tough field, period. Usually when people ask …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You may want to post in our viruses and malware forum, because it sounds like you've got something unsavory going down on the machine.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Very close, and conceptually you've got it perfect. The only problem is a mismatch of new[] and delete when releasing a. This is what you want:

int **a;

a = new int *[bin->height];

for (int i=0;i<bin->height;i++)
    a[i] = new int [bin->width];

for (int i=0;i<bin->height;i++)
            delete [] a[i];

delete [] a;

When using new, you should have a corresponding delete. When using new[], you should have a corresponding delete[].

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

At this point the only benefit of a built-in array would be slightly more concise declaration syntax. But the functional benefits of std::array blow that out of the water.

As a rule of thumb, I'd say prefer std::array until you have a good reason to pick a built-in array.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster
  1. 15, for 18 years.
  2. C#, C++, and C, presently.
  3. Of course.
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'll let you know right now that "programming" courses and computer science tracks won't teach you jack diddly about being a software developer. However, a bachelor's or master's in computer science is your best bet to keep HR departments from throwing your resume out without looking at it.

More important than a degree though is solid evidence that you know what you're about. Typically this means experience, either in profession or open source work. A programmer fresh out of college with an impressive open source portfolio is vastly more likely to get the job than one without a portfolio.

As far as schools, they don't matter as much provided they're accredited.

My biggest piece of advice is don't expect a degree to get you a great career, because that path only leads to disappointment.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Flexera has a version called Install Shield LE which is free for Visual Studio owners.

I heard a lot of whining about InstallShield LE and thought they were overreacting until I tried to use it and immediately ran into limitations that jacked me up. For the most basic of installers it's fine, but anything more than that and you're required to buy the full version.

My personal preference is WiX, though the learning curve is significant. InnoSetup is another common one. Ultimately, nothing I've used beats the now defunct setup project that came with Visual Studio 2010 and earlier in terms of ease of use versus capabilities. It's a shame Microsoft decided to partner with Flexera and throw developers under the bus.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

They should be forced to pick a relevant forum -unless their question doesn't include any of the sub forums

I'm having trouble thinking of a way to do this that isn't terribly intrusive for the average case of knowing which sub forum is most appropriate. Barring, of course, the full tag approach, which Dani wants to move closer to than separation by forums.

Suggestions are welcome, of course. I'd be surprised if I could think of every possible clever way to structure things that would work effectively and still be user friendly.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Far be it from me to put forth a logical fallacy (which guarantees that what follows will be exactly that, I'm well aware), but can you point out a forum that implements a voting system which requires some form of comment?

You have forums that support a reputation system with comments, and forums that offer only non-anonymous voting, but I've yet to see one that has both a reputation system (or a commenting system) and a non-anonymous voting system. In fact, voting from what I've seen has been overwhelmingly anonymous.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Possible? Yes. Off the top of my head, I'd probably approach it as storing the settings in an embedded resource, then replacing that resource when settings change.

However, this strikes me as an unnnecessary complication. I don't see any good reason why you can't distribute a config file along with your executable and use the usual settings methods. The password can (and should) of course be encrypted when stored in a user-accessible location, but that's trivial to do.

In terms of an executable modifying itself, there's a hard limitation of the file being locked while loaded in memory. So any solution would need to work around this limitation. Therein lies the rub, because now you're either using tricks like the resource replacement I mentioned, or actively disassembling and reassembling the IL from the client side (not a good idea in general).

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Overly simplified, but first the language is designed, a grammar is devised, and then a compiler is written in another language.

A common way to test a new language is to write a bootstrapping compiler (ie. a compiler written in the language itself). But the first compiler basically must be written in another language.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster
"{\b Wenisday}"

RTF is a formatting language, so you'd do well to look up the specification for what's possible and how to do it.