« first day (4546 days earlier)      last day (385 days later) » 

mr5
1:50 AM
  for(let i = y;i > 0; i /= 2) {
    value += x;
  }
how do you optimize this?
 
2:05 AM
cant, those value is not defined
 
 
3 hours later…
4:44 AM
@mr5 for(;;) there you go. By dividing in half, you'll never reach zero. At least mathematically. If you want to skip the loop, you can do value += y*2 and you get almost the correct answer. If you keep dividing and y is not an integers you'll end up with floating point inconsistency. So just straight up multiplying by two is not THAT far off.
 
 
2 hours later…
6:18 AM
Good moaning
 
 
1 hour later…
7:27 AM
Anyone know how to fix this
For .net development on ubuntu
 
does it work with elevated priviledges? add sudo in front
 
Thanks
It worked
Stupid me
 
You should be able to work as a regular user, imho
 
 
2 hours later…
9:13 AM
its linux tho, regular users have no power there
 
As it should be lmao
 
9:29 AM
still dotnet should work without sudo, I just wanna compile my application without potentially manipulating the machine I'm on.
 
 
2 hours later…
11:16 AM
Yeah, that's why I was about earlier
Unless requesting resources that require elevation, coding and compiling should be without sudo
 
11:46 AM
Yeah I messed it up
I installed using snap on Ubuntu
I fixed it by uninstalling the snap version
 
 
2 hours later…
1:20 PM
I've heard complaints on snap
Haven't used Ubuntu in ages tho
all I know is sudo apt cow
 
So I have a class Question. A question has a text/label, a type (bool/num) and OrderValue.
The type now has an enum: public enum Type { Bool, Num }
How do I not go public Type Type; now?
 
2:20 PM
I am trying really hard to understand this question @Squirrelkiller
 
public class Question
{
  public string Text;
  public Type Type;
  public int OrderValue;
}
I would like to avoid the repetition in Type Type
(Without creating two separate classes of course)
Your standard OOP tutorial will go "Well ok let's make a Question base class and a BoolQuestion and a NumQuestion here" but no.
 
2:39 PM
Type TheType ?
I've had a similar class in my old work
public class Question
{
    public string QuestionsText;
    public QuestionType QuestionsType;
    public int QuestionOrder
}
 
ipublic class Question
{
  public string Text;
  public Type type {get; private set;}
  public int OrderValue;

	public Question(Type inType)
	{
		this.type = inType.GetType();
	}
}
if this is wrong, please enlighten me as why
 
3:03 PM
what would the type of a type be?
 
mr5
type: Type
does a type instance have a GetType()?
 
everything has a GetType()
@Squirrelkiller what do you mean "repetition"?
 
4:01 PM
Type is an enum
 
Type is not an enum :D
 
 
1 hour later…
5:05 PM
would dynamic be any use in here ?
 

« first day (4546 days earlier)      last day (385 days later) »