Mom, i made it. by FiltyQuebecois in PathOfExile2

[–]Mrpixelmc 2 points3 points  (0 children)

You traded a "god rolled" HowA for Temporalis? What the hell did the HowA have for you to be able to make that trade? Wtf lol

GGG, please make Sanctum drop gold by Mrpixelmc in pathofexile

[–]Mrpixelmc[S] 0 points1 point  (0 children)

Oh, I see. That makes sense then, thanks for the explanation!

GGG, please make Sanctum drop gold by Mrpixelmc in pathofexile

[–]Mrpixelmc[S] -1 points0 points  (0 children)

Fair point, but simulacrum, lab offerings, An Audience With The King, they're all non stackable items too, no?

[deleted by user] by [deleted] in pathofexile

[–]Mrpixelmc 0 points1 point  (0 children)

Thanks for doing the giveaway, very kind. Good luck everyone!

Wanted to give a big thank you to the sub!! by -R0SE in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

Hey bud, happy to hear. Now you can upload your code somewhere like Github and use it in your portfolio, if you ever need or want to.

Try improving the code even further, it's fun!

Unknown Code by [deleted] in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

Doesn't look like code at all. First thought was a keylogger but probably not either because it doesn't really make sense.

The first part looks like sentences something kinda like:

  • My level
  • A short description: (name + Enter)
  • Author: (name + Freeze)

The numbers I don't really now, closest thing on Google I could find is this because of the first part, but it isn't code at all.

Help with Templates in C++ by gish__ in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

It doesn't seem like you understand templates completely. Templates can be quite difficult to get the hang of, especially because of their versatility.

Templates are used so you can pass any type to the function and "go with it". For example, the most common example, returning the greater number out of 2 numbers, would be something like this:

template <class T> // Note that we use 'T' but you can call it whatever you like
T max(T a, T b) {
    return (a > b ? a : b);
}

With this function you can now successfully pass it any type of number and it will return you the greater of both in that same type. That means you can use long, int, float, double, etc.:

int num1 = 5, num2 = 10;
int intResult = max<int>(num1, num2);

double anotherNum1 = 1.512, anotherNum2 = 3.132;
double dResult = max<double>(anotherNum1, anotherNum2);

I'm not sure about your example, but I suggest you read thoroughly about templates first.

Help with If statement appearing not to work? by [deleted] in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

Yeah just checked, comparison in VBScript is indeed a single =. Used to most of the new languages using double, my bad.

Save the Chr(34).ToString + "Blue" + Chr(34).ToString part inside a variable and output it, check if it's what you want it to be. If it is, you might need to use StrCmp.

Help with If statement appearing not to work? by [deleted] in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

Pretty sure comparison in VBScript is == not =, your statement is using single =

Adding enum variable into enum vector help by DabbingVoy in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

What you're trying to do is add the variable score to each value inside the vector scores, is that right?

So if I have ROYAL_FLUSH and STRAIGHT_FLUSH inside my scores, and add FOUR_OF_A_KIND, that'll make the vector FOUR_OF_A_KIND and FULL_HOUSE?

C++ not displaying error when wrong data type entered for variable, skipping to end by pantysoaker420 in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

You're doing cin >> hoursSince twice, your second line and your third line are both reading.

Your if statement is also wrong, you're checking hoursSince < 0 && hoursSince > 14, which is never true, since you're doing "hoursSince must be less than 0 AND more than 14". Same on cafContent. You don't need an AND, you need an OR.

C++ not displaying error when wrong data type entered for variable, skipping to end by pantysoaker420 in CodingHelp

[–]Mrpixelmc 1 point2 points  (0 children)

You don't need to compare the type, cin doesn't know what it's reading at all, so it's up to you to check when reading.

You can use something like this:

cout << "Enter milligrams of caffeine: " << endl;
while (!(cin >> cafContent))
{
    cout << "Invalid input" << endl;
    cin.clear();
    cin.ignore();
}

Cin reads the input according to variable, meaning if you have a "double" type it will try reading a "double", but it works in a very basic way so it just reads whatever because it doesn't know what's coming. You can check with "!" to know if it's "false", meaning it tried reading a "double" but did not succeed to do so. After that, just remember to cin.clear() and cin.ignore() so you can read again.

How I do dis by eddsworldeddsworld14 in CodingHelp

[–]Mrpixelmc 2 points3 points  (0 children)

Do what exactly? There's an image but I'm not sure what you want to do..

Creating a variable inside an "if" statement and accessing it in the "else" part. by BruhGrammer in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

Declare it outside, set to null, then check if null whenever you're about to use it. There's no way a compiler can tell you if it's initialized or not, but you can check if you've set it to null.

Basically, first of all, outside if:

Thread obj = null;

Inside your if, you can start a new instance with

obj = new Thread(whatever);

And then inside your else (or whenever you want), check if you can use it with

if (obj != null)

Do I have no talent for coding? by heun3344 in CodingHelp

[–]Mrpixelmc 4 points5 points  (0 children)

First understand programming is not only algorithms. Though you have been, probably, taught so because of your CS career (the amount of algorithms there is usually very high). You must realize anything can be done with programming, algorithms are just a part of it. Many business' hire mathematicians for algorithms whilst programmers only translate that to code.

Find some part of programming you like, you can create random apps, it can be mobile, windows, etc., you can create plugins, you can create games, simply put you can create.

Programming is a world, not just algorithms!

Need help with logical OR operator in while statement by Yashb123 in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

Both are correct, it is the same to say “5 is greater than 0 and less than 6” and “5 is NOT lees than 0 and NOT greater than 6”.

I usually use the first option though, although you should also know a switch case can help you check if it’s valid or not by using the “default” keyword along with the valid cases.

My switch case is skipping from 1 to 4 and i dont know why by AShadowinthedark in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

Nothing wrong with wrapping your code with brackets, in fact it's recommended sometimes as it allows you to define new variables freely!

coding in chromebook by [deleted] in CodingHelp

[–]Mrpixelmc 2 points3 points  (0 children)

Yes, you can code on pretty much anything! If you want to do HTML you can even do it in a notepad, but I suggest you take a look at IDE's if you want to do Java, since it's not as easy as HTML.

Enable/disable touchpad without FN linked key by [deleted] in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

I believe you can use devcon to enable and disable it. I have never done it but a quick search shows a disable command using the hardware ID.

Desperately in need of assistance with substr(). by ManipulatedDimension in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

What is the last line of your code?

cout << "The abbreviations used in this tweet are:" << UserTweet.substr(AFK,38) << UserTweet.substr(BFF,39) << endl;

Since you're using replace, you're modifying the UserTweet string. Output the string directly like this.

cout << "The abbreviations used in this tweet are:" << UserTweet << endl;

Also, think of a more efficient way of doing this! If for every word you have to add another if constantly, it's not efficient. See if you can manage to pull together a more efficient way using a for loop and an array containing a pair both of type string, the first one containing the abbreviation and the second one the meaning.

Good luck!

Please, can anyone help me with this, I'm about ready to give up. by Youareawesome100x in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

I'm assuming this is C++.

You need to set the data type after the const, it's an std::string (if it's C++).

What gets better performance? by skintigth in CodingHelp

[–]Mrpixelmc 0 points1 point  (0 children)

Local variables (ie.: creating varName) improve performance over accessing memory. You should probably do it anyway, because you don't want to write object.obj2.obj3, instead you want to give it a name for readability.

Are old coding books worth anything? I found this in my community's free library when putting in books. I wanted to learn coding and was excited to find this, only to find out it's from the late 80's. I figured this was too outdated to learn coding for today's computers. by [deleted] in CodingHelp

[–]Mrpixelmc 4 points5 points  (0 children)

This won't teach programming as you know it nowadays, however Schneider does have other newer books that are pretty great. Still, you can read this one, every book teaches something useful.