« first day (2433 days earlier)      last day (2517 days later) » 

9:00 PM
So if a user visits its own profile
it should be true
 
In camel I would recommend doesVisit
 
IsUserVisitingHisOwnProfile?
 
or doesVisitProfile
 
HasVisited
 
no its not about visit
 
9:00 PM
Profile
 
its about permission
bool SelfProfile
 
CanVisitProfile
 
^
though thats not camel fomr
form
 
Its still valid
 
right i was wondering the name
 
9:01 PM
Drop the first cap I you want
 
is that pascal?
 
I think
I met him
He approved
 
hi
 
High
 
CanEditOwnProfile?
 
9:04 PM
how do you manage having too many development projects assigned to you?
 
its in my model, so will keep first capital
 
as a developer
 
The class its in should make the context obviously own profile
 
how would i print out a variable based on the object
 
@BrianJ Prioritization is critical.
 
9:04 PM
Caffeine
 
like if i have Point P1
how would i be able to print out something like {0}
where the {0} refers to P1
 
Being the only developer where I work, I eternally exist in that state, but you've got to be willing to aggressively determine what needs to get done first and tackle everything one item at a time.
 
Look up overriding tostring
 
its happening in another function tho
Point P1 = new Point();
Point P2 = new Point(3,4);

P1.Show();
P2.Show();
inside show i want to print the object im on
 
Im not going to do all your homework for you
If you typed your current code you'll be ablr to figure I out
 
9:08 PM
that is not a hw question im asking you
 
You just said this was homework
 
yes it is
but printing out the object isnt
i could just easily only print out the coordinates
 
@hilli_micha yeah I really need to get priorities on some of my stuff with management.
Feels like I'm constantly jumping between projects rushing stuff
 
Well
 
anyways bit of a rant
 
9:09 PM
fine
 
Googlw will show you
 
ill figure it out
 
Yeah
@BrianJ its going to b okay
I promise
 
@BrianJ Yup, that rushing ultimately comes to bite you in the ass later.. I've felt that sting plenty of times.
 
@hilli_micha yeah but if stuff isn't done within deadline you look bad
 
9:12 PM
forget it with my current knowledge of the class theres no way i can print out an object
 
or maybe the case should be made that you have too many projects assigned
 
without using knowledge we havent learned
since its just a test I can just use console
and say the point im on
 
@BrianJ Well, yeah, a person can only get so much done so quickly.. I'd much rather someone wait for something that's right than waste time retracting steps to fix something I've put out and have someone use that unfinished product and waste their time..
Things are rarely as urgent as they let on, that's not to say I won't push a critical issue forward, but I'm not going to rush and band-aid shit, especially if I can avoid it.
 
I'm kinda trying to preempt being asked to fix stuff too, because there is an project where data isn't loading for a view but hasn't been flagged yet.
guess it comes with experience being able to put your foot down on deadlines
 
I like to do that as well, I often like to fix things when they are targets of opportunity, just to polish the software a bit.
 
9:19 PM
yeah but if it's not priority don't do it right? That is something I need to define tomorrow
 
I would say that's an on-the-fly decision to make each time, how long will it take and will you enter a rabbit hole? If it's something real quick that I think a user a notice, I'll take it on, if its large though, i'll bundle it with a future project.
 
@Brogrammer What are you trying to do? Maybe I can help
 
no worries @Sometowngeek what I was trying to do was beyond what we learned
and I used a much easy way
thank you though!
 
That's okay, and that is a good thing! :)
No worries
@Brogrammer As @JABFreeware said, you could look up overriding ToString. IMO, This article makes it straightforward.
It's an useful method to override, especially when you create custom models :)
 
9:36 PM
@hilli_micha kinda my take on things also, today was just a busy day
 
@Sometowngeek he is right but its definately not something we learned in class
@Sometowngeek I do have a question for you if you dont mind me asking
 
Ok, sure.
 
I have a static function inside class Point
called Distance
it takes the distance between two objects
and i want to call that function
should i use one of my already existing object
to call it
example
if i did
Point P1, P2;(simplicity)
assume thats right
i want to take the distance of them
Distance(P1,P2)
should i do P1.Distance(P1,P2)
 
or P2.Distance(P1,P2)
or just create another object to call that function
 
9:42 PM
I would suggest not creating the function with static.
 
hi friends
 
my assignemnt says: "Public static member DistanceBetweenPoints that receives 2 Point objects and
// returns the distance between them as its computation"
 
Meh ok.
 
hi @Jeremy
 
Your assignment trumps it.
It's up to you. You could create an extension method that will return the difference.
 
9:44 PM
someone tell me things about how smart modern DBMSs are about location of physical data
 
like public static member DistanceBetweenPoints(this Point p1, Point p2)
 
public static double DistanceBetweenPoints(Point obj1, Point obj2)
{
double xCoordPoint = obj1.xcoord - obj2.xcoord;
double yCoordPoint = obj1.ycoord - obj2.ycoord;

return Math.Sqrt(Math.Pow(xCoordPoint,2) + Math.Pow(yCoordPoint,2));
}
the issue isnt writing it out
 
which will allow you to do something like p1.DistanceBetweenPoints(p2)
 
its how to call it
 
Hrmm... hang on
minimizes FFXV
Let me run this in my testing environment
 
9:46 PM
@Brogrammer Your assignment says a static function that accepts two points.
Your assignment wording is god in this case.
 
yes
but my issue isnt creating it
its calling it
I have these objects created:
Point P1 = new Point();
Point P2 = new Point(3,4);
 
Wouldn't it just be something like Point.DistanceBetweenPoints(new Point(blabla), new Point(blublu)); ?
Or P1 and P2 in your case?
 
ok so ur right
but why is it Point.
as opposed to using an object.DistanceBetweenPoints
why use the class name now
 
@Brogrammer Because that's the point of a static method
It's a "method" that's not related to any specific instance
Instead, it's tied to the class.
 
i see hence the name static
 
9:50 PM
You'll also notice that there can't be a this inside of a static method, because there's no this.
 
in my code i haven't used this to initalize my variables
is that bad
i use value
and i was wondering whats the difference
 
Example?
 
private double xcoord
		{
			set
			{
				xcoorVal = value;
			}

			get
			{
				return xcoorVal;
			}
		}
 
@Brogrammer I think your static method works. As @MadaraUchiha said, you should use it as Point.DistanceBetweenPoints(p1, p2)
 
but i think i could do this.xcoorVal = xcoorVal ;
 
9:52 PM
Yes, that would probably be more readable
Although doesn't C# have a shorthand for that?
 
No
well... yes
{ get; set; }
 
lol
 
And that absolves you from setting it in the constructor?
 
I'll be quiet.
 
as expected of the uchiha
 
9:53 PM
(I'm not a C# developer, so I truely don't know)
 
oh.
I can pitch in to help educate Brogrammer if you'd like, @MadaraUchiha
 
Sure thing
 
It's a chatroom and a multi-user discussion, you don't need my permission to jump in :)
 
@MadaraUchiha You can get by without creating a constructor if you want to be able to create an empty instance of the model.
Hang on.
Ok
Like so in this pastebin
It has no constructor, but you can get by with Point x1 = new Point(); and the compiler won't complain.
but Point x1 = new Point(3, 4); will not work.
anyway.
 
9:56 PM
right i shud of mention i already have that
 
But you can't pass arguments that way, yeah?
 
lol
 
Correct
 
yeah
u would need to do this:
public Point(double x, double y)
{
xcoord = x;
ycoord = y;
}
 
But if you do create a constructor with some parameters (not an empty one), Point x1 = new Point(); will not work.
 
9:57 PM
If I wanted to pass arguments, the only way is to create a constructor and set this., like in Java?
 
in java yes
 
Eh... You could.
But you don't have to.
If they were static members, you can't.
Usually VS will mark this. as unnecessary and suggest removing them.
 
@Sometowngeek What do you mean?
You mean naming the parameters to the constructor differently from the names of the members?
 
Then you omit this.?
 
10:00 PM
No. I'll give an example of that in a moment.
This is an example of when VS suggest to omit this.
I'll give an example when it won't.
Hrmm... I couldn't make it happen.
I thought it would work if I use a different model that uses the same member variables.
But yeah, VS tends to dim the this. if it thinks it's unnecessary.
 
probably if your field/member was named the same as the variable name
 
I'm not sure :(

I think you might find answers about this in [The heap chat room](https://chat.stackexchange.com/rooms/179/the-heap--consultancy-)
 
e.g. if your parameters there in that constructor were called xcoord and ycoord
though i guess your members should be PascalCase rather than camelCase to avoid this problem altogether
but it's up to you, anyway
i'm sure you can configure where it shows up and in which situations, at least a bit
 
can someone check if my code follows these directions:
All data provided to and returned by the class members is a double type.
ï‚· All data displayed, whether by class or test code, must be displayed to 5 significant
places (F5 format).
ï‚· Static member DistanceBetweenPoints MUST use the properties to get the x and y
coordinates used in its computation of distance.
ï‚· The constructors MUST set the coordinates using the properties
ï‚· Method Show MUST use the properties to get the x and y coordinates to display the
coordinates.
ï‚· Except for method Show, no printing can be done from anywhere other than your test
 
To me, it doesn't matter. I am just trying to think of examples because Java requires this in constructors and C# doesn't.
 
wait, Java requires this in constructors?
 
@Sometowngeek No it doesn't
 
I don't think so
 
Oh? I thought it does. whoops
 
if you have a private field x and a ctor parameter that is also x you would need this.x = x;
 
10:09 PM
If the members are named differently from the constructor parameters, this is redundant.
 
well, duh
 
yup
 
yup
 
It's just that in Java, the convention is to name them the same
And use this. anyway
 
most of the time this isnt necessary
unless youre in javascript, and then it's used bloody everywhere
 
10:10 PM
I might have misunderstood your message.
13 mins ago, by Madara Uchiha
If I wanted to pass arguments, the only way is to create a constructor and set this., like in Java?
 
@hsimah The problem with this in JavaScript is that it's essentially an extra, hidden, argument
Rather than a bound context.
 
JavaScript seems "fun"
may try it someday
learn it in depth
 
TypeScript is fun
It's like JavaScript but sane
 
there are too many frameworks/libraries in js
 
But yes, JavaScript is, in my opinion, a fun language, with lots of good ideas and expressiveness behind it.
 
10:12 PM
i am so overwhelmed when i use it lol
 
@hsimah The trick is to know JavaScript
If you know JavaScript, learning the frameworks and their use cases isn't hard.
 
wonder how different js and python feel now
 
it's the deciding which to use thats hard
 
Except people keep looking to learn the latest trendy framework, rather than the language it's written in
 
you need a wheel and there are 30 different wheels
 
10:12 PM
imo, Python is a bit easier than JS
 
looking at PEP acceptances and so on it feels like they're converging a bit as languages in terms of features
 
@hsimah You normally find that you can implement the wheel in 10 lines or less
At least that's how it is in JS
 
i had so much fun picking up python from python 3.6 again
so expressive
 
@MadaraUchiha a noob question: AFAIK TypeScript introduces static typing, but it needs to interact with all the JS libraries and framework, which aren't typed. what happens then?
 
@milleniumbug That's a great question
 
10:14 PM
is it not transpilation?
 
There's a repository of type definition files
So you install npm install jquery @types/jquery, and TypeScript can tell
It's not perfect, but it works for 90% of the cases, which is pretty amazing considering the state of the ecosystem
TypeScript has a system called definition files, which are files that end with .d.ts, and they describe only the types of a JavaScript module that has no types on its own
So libraries like jQuery and React which were not written with TypeScript and so whose type we cannot infer, have people maintaining a type definition file under the DefinitelyTyped repository, which closely follows the API and keeps the versions in sync
Normally, if you npm install library@x.y.z, you can generally npm install @types/library@x.y.z
 
i'm guessing when you say 90% of the cases, you mean 90% of the npm packages you've actually been interested in
 
@Jeremy That, plus the accuracy
 
those maintainers are the real silent heroes
 
oh, that's cool, so basically you can provide the missing type information, even for third-party code
 
10:17 PM
Since the types and the actual code are defined in two different places, discrepancies are possible.
@milleniumbug Exactly
@Jeremy Absolutely
And they do a terrific job at it too.
 
so for that remaining 10% if you want to use the library, your only real choice is to contribute maintaining the types
i guess that's why the ecosystem survives like that
 
@Jeremy Yes, or use the backdoor
 
and here backdoor is... transpilation or something similar?
 
type any
 
ah
 
10:19 PM
Which means "I don't know how to describe this type, don't type check anything about it please"
What I like about TypeScript is that its type system is clearly well thought-out and tailored to JavaScript
So you see things like members in interfaces, because most JavaScript objects are just members
And type any to bail you out without a fuss
And strong type inference so that typing doesn't get in the way
With the --strict flag (which means that the compiler throws if it can't infer something, or if you try to unsafely access a possibly null value), TypeScript's type safety is actually very strong
As in, much better than Java's, and arguably stronger than C#'s in some ways
 
i can believe it
 
We've been using it in production for a while now, and we're enjoying the experience very much.
 
the more ambitious visions in C# seem to be hampered by dealings with the CLR
 
It's worth it just for the intellisense.
 
I'm curious, in what way could TS's type safety be better than C#?
 
10:24 PM
> if you try to unsafely access a possibly null value
probably this one
 
i haven't kept up with C#7, wasn't that on the list at least?
or did they end up with something weaker
 
Does C# have union/intersection types? Especially with Generics?
 
Not that I know of.
 
TypeScript has that
Also some fun things you can do with TS:
 
I don't work closely with Generics
Ouch...
That's a mean trick.
Tenebraen Berry Opera makes brutes weak.
 
10:27 PM
@MadaraUchiha yeah it doesn't, which makes for some "fun" situations like this one: chat.stackoverflow.com/transcript/message/37275716#37275716
 
const myObj = {
  foo: 'bar',
  baz: 42,
  bar: true
}

function getValue<T, K extends keyof T>(obj: T, key: K): T[K] {
  return obj[key];
}

const val = getValue(myObj, 'foo'); // typeof val is string
I can do some crazy things without losing type information
Also, mapped types:
type AllNumbers<T> = {
  [K in keyof T]: number;
}

function numberify<T>(obj: T): AllNumbers<T> {
  // snip
}

const myNums = numberify(myObj);

// typeof myNums.foo will be number
 
K in keyof T - TS has native support for music composition
hurr hurr
but that's pretty neat
 
@Sometowngeek If it included typeclasses, that would be a big bonus (idk if it does, i just love typeclasses)
 
something something haskell
for great good
 
@Sometowngeek can you see if my code follows my prof guidelines:
All data provided to and returned by the class members is a double type.
ï‚· All data displayed, whether by class or test code, must be displayed to 5 significant
places (F5 format).
ï‚· Static member DistanceBetweenPoints MUST use the properties to get the x and y
coordinates used in its computation of distance.
ï‚· The constructors MUST set the coordinates using the properties
ï‚· Method Show MUST use the properties to get the x and y coordinates to display the
coordinates.
ï‚· Except for method Show, no printing can be done from anywhere other than your test
 
10:42 PM
seems like if you're capable of writing the code you should be at least capable of figuring out what those questions mean, if you don't understand, and answering them yourself
failing that, there's always code review, too
not trying to be cold, it's just the truth... you'll learn the most if you just try it yourself
 
i just didnt get the part where it says properits
properties
 
what are the properties in your code
 
have you tried reading a book
 
xcoord
ycoord
yeah ur right
my code does follow directions
 
Your static member DistanceBetweenPoints doesn't it seems
unless i'm mistaken (been awhile since in school) and member now means method/function
 
10:47 PM
@RyanTernier I know it seems a little odd, but that's what his assignment dictates.
 
his assignments have been a bit odd imo
 
@Brogrammer From a quick run/test, it seems to work.
 
it works, but my comment was on his guidelines:
 
but maybe mine were too, back in the day
 
Although I agree with @Jeremy, you should be able to test it out on your own as this is your assignment, not ours. :-\
 
10:49 PM
But wow, whoever wrote this needs to spend some time in the development world
 
I'm not saying we won't help you. But you should still be able to do most of the work and testing yourself.

When you are really stuck and you have exhausted your resources (Google, textbook, etc.), then you can ask for help :)
 
Never have a method on a class write to console :\, what if you're running this on a web server, or on a windows app
 
@RyanTernier I tutor my friend with Java and his professor's expectations for the class is an iota of what the real programming class expectations are.
 
But whatevs, i'll just yell at my jr's if they do that :P
 
His final project was to finish the conditions in the if/else statements.
 
10:50 PM
My COBOL prof spent 30 years coding COBOL. he was an amazing teacher
My fainal project was to code a banking system
 
I like that! :)
I like that idea.
But anyway...
 
8.2 KLOC's
Yea, have fun in school :) Come here with issues on coding, as for homework, carry your own backpack while we make fun of your assignments (helps build character)
 
the so profile image uploader doesnt work
 
Hrmm?
Which one? the SO?
 
yeah
ill try in internet explorer
 
10:52 PM
@hsimah That's a taboo name!
:P
 
well, i find sometimes I can't enter a line break in asking a question on SO in chrome
it's weird
 
Then use firefox :P
 
i dont like firefox
i find if i open it it uses too much memory
i dont like ie either mind yu
but it opens and closes quickly, and i have to use it to get on the intranet at work, so its pinned to my task bar
and it appears to let me upload a picture
so right now it's better than chrome!
 
lol... point taken
 
@Sometowngeek my english is not perfect
 
10:55 PM
Yeah. Chrome is a little goofy sometimes.
 
i did test my code already
and it did work
and i knew that
but i wanted to make sure i understood the question
 
why does IE work and chrome not?!
is it 1999 again
 
because of garbage web developers
 
@Brogrammer Gotcha...
@hsimah What @milleniumbug said.
I think the browsers are partially to blame.
@Brogrammer Just curious... What's your native language?
You don't have to share if you don't want to :)
 
english is
 
10:59 PM
lol
 
but i had trouble speaking it as a kid
 
Ah gotcha :)
 
and sometimes i dont properly understand questions
 
hello
 
although i speak more than one language
 
10:59 PM
Hablas espanol, no? :D
Hoy Tony! :D
 
no lol
 

« first day (2433 days earlier)      last day (2517 days later) »