« first day (2615 days earlier)      last day (2332 days later) » 

12:07 PM
Any time I try to make java I'm again wondering why it wont let me build a simple List<T>
 
@KamilSolecki what's taking you so long? :P
 
@Nerdintraining wörk
moved now
 
Android... emulator... so... slow... must... have... newer... computer...
 
12:23 PM
Alright so after 3 days researching I eventually noticed randomly our client had MySQL 5.0 in the testing machine and MySQL 5.5 in production
How do I tell the head maintenance dude that this issue that has lasted for over a year can be solved by installing the correct tool instead of a random one?
 
Tool?
AFAIK the right approach here is to clone production into testing, including installing the same database as the one you have in production first.
Because you want to test for production, you need a representative clone of production.
 
Yeah, this is beyond tooling. Your choice of database is part of your application architecture.
 
They don't have the knowledge to do that, because monkeys
smacks plates
 
Hi, got a question. I have the following enum:
 public enum Rating
        {
            Horror = 16,
            Action = 12,
            Sports = 6,
            Drama = 12,
            Romance = 18,
            Comedy = 6
        }
I have a string called Genre. The string contains: Horror || Action || Sports etc.
 
@Nerdintraining you don focked up this tiem
 
12:36 PM
@Gigitex No, that won't work.
 
Aha
 
Oh, sorry, go on. You haven't actually asked your question yet.
 
So If the genre string is for example: "Horror"
I want the program to look in the enum for Horror
and return 16
I know that I can make if statements, but I am looking for an easier way
 
Enum.Parse(typeof(Genre), "Horror") should do it.
 
@KamilSolecki never
 
12:38 PM
I tried this:

int minimumAge = 0;
            if (Enum.TryParse(Genre, out minimumAge))
            {
                MinimumAge = minimumAge;
            }
ah just a parse, not a tryparse
 
Ah, I see the problem.
You're abusing the enum mechanism here.
 
Why?
 
Enums aren't a way to have a key/value tuple linking a string and a number.
Enums are simply a collection of numbered constants.
 
Yes
So what would you suggest?
 
if (Genre.Comedy == Genre.Sports)
{
   // true
}
This would return true because both are actually simply the value '6'.
 
12:41 PM
yes
The enum is called Rating btw
 
That doesn't make sense, though.
 
Genre is a string
 
Right, sorry.
 
Why not go Dictionary<string, int>
 
hmmm
 
12:41 PM
minimumAge = rating[Genre];
 
Never used a dictionary
 
Exactly. What you need is either a mapping between a genre and a minimum age - in which case, a Dictionary is the way to go - or a list of known ratings you can search.
 
I will google dictionary then
Thank you guys!
 
On the other hand - there are action movies that aren't ok for 12y/o kids
 
@Metallkiller Well, that's a bit out of scope for the question, though.
 
12:43 PM
haha yes I know but I am just a student
 
Jup, just something I saw
 
I can fill in 69 it doesnt mather :P
 
plz do :D
 
haha
 
ratings.add("CarribeanShipRomanceDrama", 69);
That wasn't a reference to Pirates of the carribean btw I just don't know how to call that genre with ppl having romance/drama on a cruise in the carribean or something
 
12:47 PM
@Metallkiller Is that a thing?
Probably a Netflix subcategory or something.
 
Saw that years ago in german public TV. Not sure how much that's a thing in other countries, but that's something my parent and grandparents would sometimes watch. Because cruise+sun = nice
 
@Nerdintraining after English opening >D
 
            #endregion

            Ratings = new Dictionary<string, int>();
            Ratings.Add("Horror", 16);
            Ratings.Add("Action", 12);
            Ratings.Add("Sports", 6);
            Ratings.Add("Drama", 12);
            Ratings.Add("Romance", 18);
            Ratings.Add("Comedy", 6);

public void GetMinimumAge()
        {
            MinimumAge = Ratings[Genre];
        }
so like this?
 
looks good
 
12:52 PM
Allright, thanks!
 
You'd best wrap the call with a check, though:
if (Ratings.ContainsKey(Genre))
    MinimumAge = Ratings[Genre];
 
Ahh I was about to google that haha
Otherwise my teacher would kill be
me*
Thanks :)
 
Also, GetMinimumAge should simply return the minimum age, rather than setting it to a field.
Or else rename it - the method doesn't "get" anything, as it is. It sets the minimum age field.
 
Or computes it. It doesn't take a parameter either.
 
It's from an interface
Let me change that real quick
 
12:55 PM
Punch the guy who wrote the interface then
oh ok
 
punching my self
 
good boy
 
Interface methods have to be public right?
I can not make it protected or private?
 
allright
 
12:58 PM
Wouldn't make sense otherwise. It's practically an API.
 
No I am just like
Im using that method only in the constructor
Now that it's public, every other class can use it
It doesn't need to
 
Usually you make an interface so another class can use an object of your class, with exposing which clss the object actually is. If the other isn't supposed to use a certain method, remove it from the interface.
 
@Gigitex In that case, it shouldn't be in the interface.
An interface is a contract, a set of methods and properties you that are known to consumers.
It's not like a header file in C/C++.
 
Yeah I am pretty like using it like headers.
mY teacher asked for an interface
The only common method between the two inherited classes is GetMinimumAge
Can't come up with another method to use in the interface
 
Don't force it.
What are the two classes?
 
1:03 PM
And what is the base class?
 
base Abstract class: Buyable
Inherited class: Reservation
inherited class: Consumable
Consumable = food/drinks
 
Does buyable have to be a class? Because if all the methods are abstract, you could make it an interface
 
I also need inheritance in the program
otherwise I won't have any inheritance anymore :S
it's f.. up I know
 
You're not really learning the right things if you're trying to add an interface and inheritance into a design that doesn't need them.
 
Could use something like IRestrictedBuyable, with name/price/minimumage
Or IBuyable
 
1:06 PM
@AvnerShahar-Kashtan tell my teacher :S He said that he would accept this
@Metallkiller I also thought about that but otherwise I am not using inheritance
 
Why? The two normal classes inherit from Buyable and implement IBuyable
 
huh
 
Or IRestrictedBuyable, so it's not too...similar
 
I don't like Buyable as a base class name. It doesn't represent an object, but a behavior. BuyableItem works better for me.
 
hmm
 
1:09 PM
Could make Buyable an Interface altogether (IBuyable), ignore the constructor, and make abstract Properties
 
These are the learning goals:

The Class Diagram
unit tests
Inheritance
Interfaces and abstract classes
Exceptions
File I / O
Simple algorithms, lists
The Use Case Diagram
I will try that then :)
 
Since you have COnsumable->food/drink anyway, there is your inheritance
 
interface IBuyable
{
     decimal Price {get;set;}
     int? AgeRestriction {get;set;}
     bool IsAvailable();
}

abstract class Item : IBuyable
{
     public decimal Price {get;set;}
     public int? AgeRestriction {get;set;}
     public abstract IsAvailable();
}

class Consumable : Item
{
      public override IsAvailable ()
       {
            // Check stock levels
       }
}
 
Why setters though
price is in the constructor
 
Think I can make them private right?
 
1:11 PM
You're right. The inteface doesn't need them.
 
ah
 
The abstract base class can keep them.
 
thanks!
 
The idea here is that IBuyable is the public face of your library. The external consumer (say, a shop website) gets a list of IBuyable from somewhere to display. It doesn't necessarily care if they're Consumables or Reservations.
When a user clicks on Buy Now, it checks if AgeRestriction isn't null, and if the current user's age matches it. Then it calls IsAvailable to see if it's in stock and/or not fully booked, depending on the implementation. It doesn't care - that's what polymorphism is for.
At no point does the shop care about the Item class. That's an internal implementation detail, useful if Consumable and Reservation share some code. If they don't you can skip it and have them implement IBuyable directly.
(My advice: don't skip it. You'll likely find need for shared code later on)
 
I will try it now :)
 
1:15 PM
Interface - public-facing contract/API.
Base class - private implementation detail for code sharing.
Concrete classes - the thing itself.
 
2:05 PM
I have stored excel data in msaccess database. Now i am displaying records in gridview. It shows data in single line, while text from excel i have transferred was in newline using Alt+Enter. How to resolve it?
 
Your GridView isn't showing the line breaks, but is probably treating them as just another character.
Since I don't know if you're talknig about Winforms, Webforms, WPF, ASP.NET MVC or something els entirely, I can't really help.
 
WebForm
 
Ah, so we're on the web. Chances are, we need something to replace textual lines breaks (\n) with <br> tags.
I haven't touched WebForms in over a decade. How does it render the text? Is there a <TextBlock> or something inside the gridview?
 
it is a label inside gridview
 
28
Q: Display label text with line breaks in c#

DotnetIs it possible to display the label text with line breaks exactly as per the image I need the text on the label to be printed exactly can some one help me, my desired text that has to be shown on the label will be stored in a string-builder

 
2:10 PM
when I put int i = 10; and then i(.)operator I get most of the methods of the Object class but I am also getting CompareTo() method which is not a method of the Object class
where is it coming from?
 
This has various solutions abot replacing \n with <br/> or wrapping the whole thing with <pre>. They're all ugly, but that's webforms.
:40433233 public struct Int32 : IComparable, IFormattable, IConvertible,
	IComparable<int>, IEquatable<int>
 
@AvnerShahar-Kashtan How do you check this?
reflector
reflection method?
 
When you hold up a mirror and realize how ugly you are.
 
Thanks....
 
2:13 PM
why we have both Int32 and Int64?
 
@Mr.J ...for 32bit and 64bit integers.
 
@Mr.J int32 requires less memory
int64 has a larger range
llvm has a nice feature
 
it has an int1
up to int8191 iirc
@AvnerShahar-Kashtan i dont need internet for it
i can just ask the stuff at the IDE
 
2:15 PM
@Wietlol Not really a good idea for general purpose numerical usage. There's a reason the default numeric types are integral sizes.
@Wietlol Yeah, decompiling is fun, but you need internet to paste a link. :)
 
apart from it not being a good idea, it has the option
ok, i made a mistake
 
int64 is like long
 
int8388607
@AvnerShahar-Kashtan take that as your nice big numeric value
the actual declaration is "i8388607" as it is "i" rather than "int"
@Mr.J int64 IS long
 
haha Thanks!
 
@Mr.J C#'s long is an alias for .NET's System.Int64, yes.
It's a shame that C, with its type modifiers (int -> long int -> unsigned long int) didn't have a repeatablevery modifier.
int a = 32bit;
long int b = 64bit;
very long int  c = 128bit;
very very long int c = 256bit;
 
2:21 PM
Oh, yay. Got to work this AM to "no boot device found." working now on a 5 year old optiplex while tech support contacts Dell. gah.
 
just i32 -> i64 -> i128 -> i256 -> ... -> i4194304
 
Anyone want to take bets on whether it's the SSD or the controller? Maybe a seating issue?
 
SSD ded
 
@AvnerShahar-Kashtan I thought long was 32, and long long was 64
 
I've never seen an SSD die before...
 
2:24 PM
@KendallFrey Could be. Haven't Ced in years. It might be undefined in the standard.
 
But I'm not admin at a large shop either
 
I heard the first SSDs worked for around 1.5 years so...
 
> The size of an int is really compiler dependent. Back in the day, when processors were 16 bit, an int was 2 bytes. Nowadays, it's most often 4 bytes on a 32-bit as well as 64-bit systems.
 
@AvnerShahar-Kashtan I think it's "at least" where in practice int is 32 and long and long long are 64
 
Can somebody tell me why I know the number 65535 so well? It's an int, but some game or something has to have used an int for something. Counterstrike? Doom? gmod? How do I know that number so exactly??
(Yes, 65536, but 65535 is int.max)
 
2:28 PM
@Nerdintraining nudge I'm back
 
"The CompareTo method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent"
WHy is that?
 
Maybe because == is easier
 
@Metallkiller 65536 is the total number of numbers in a 16bit integer.
 
yup but 15y/o didnt know that
 
For an unsigned 16 bit int (ushort), the range is from 0 to 65535 - it's one less than the total possible values because it starts with 0.
 
2:30 PM
he just knew gmod was awesome
 
Equals() is used to compare 2 Strings
 
Because compareto returns an integer, telling you whether something precedes, follows or is in the same position
 
isnt the == operator overridden for strings?
 
Remembering the value of powers of 2 is a well-known symptom of a geeky childhood.
@Metallkiller It is.
 
to it actually does value comparison
 
Calling .Equals for strings is a common ailment of Java developers. :)
 
user7480455
Hi all
 
@mr5 Oh, god, not the hats again. :(
 
mr5
hi james
 
user7480455
Hello M
 
jrh
2:32 PM
Just looking for advice on posting a question: I've been wondering for a while why VB.NET's late binding only works on public methods (even if the method is in the same assembly / same class), is asking "Why does the language do (this weird thing)?" a good question for SO, or is that going to be closed because it might only be answered by somebody on the .NET team? I see some similar "why" questions in the C# / language lawyers tag, but I figured I'd ask here first anyway.
 
mr5
how do you know I'm referring to you :)
 
@AvnerShahar-Kashtan I had no idea it was 2^16, until I learned those in school. I jsut remembered the number because I used it often. I was really proud when I could finally remember it.
 
user7480455
I ask the same question back at you
 
Hello Mr. Bond.
 
mr5
2:32 PM
I always wear the old style cap but it's not in the options :(
 
@Mr.J Because == works.
 
user7480455
Greetings Metallkiller
 
@jrh I think it's a fair question. You're not asking for opinions but for a technical explanation.
 
mr5
the numbers 007 unconsciously resembles to name of James Bond actually ^^
 
2:33 PM
@jrh You can only use public methods regardless of early or late binding
 
not very end... I meant caution
 
jrh
@KendallFrey I'm talking calls of the form SomeObject.SomeMethod, where SomeMethod is an Object and Option Strict is Off
 
To determine whether two strings are equivalent, call the Equals method.
 
user7480455
yeah that was the number assigned to me when I was granted access to this public site
 
@Mr.J A string comparison operation is fast. It's heavily optimized because it's one of the most common operations people do. String interning, immutability - all these features make it easy for the framework to tell if two strings are identical very quickly.
 
user7480455
2:34 PM
I did not ask for it it was made and I use it
 
@007 haha bullshit
 
jrh
@AvnerShahar-Kashtan one extra caveat just to make sure, on a very surface level, the "why" is that "because that's how they implemented it in the reference source", it would not get closed because of that, right?
 
@AvnerShahar-Kashtan Still, most of the time it involves iterating the string
 
user7480455
yes bulls do excrete waste Kendall
 
2:35 PM
CompareTo might ignore those optimizations. It doesn't check if two strings are equal, it checks which string is bigger, which is a different issue. There might be optimizations that check .Equals and return 0 if true, there might not be.
 
@AvnerShahar-Kashtan So What do you mean?
ah
 
mr5
>> Hero Of Time
ask a question when it is 7:00 pm in any time zone
 
@KamilSolecki nidge niudge motherpleeper
 
user7480455
that was never in dispute
 
mr5
I thought 007 is old as tree, how can he type?
how can you type 007?
 
2:36 PM
The reason not to use CompareTo to check equality is that CompareTo isn't an equality-checking function.
Use it to get a relative comparison. Use .Equals/== to check equality.
 
jrh
Sorry Kendall, I made a mistake in that last message, I meant "I'm talking calls of the form SomeObject.SomeMethod(), where SomeObject is an Object and Option Strict is Off"
 
@mr5 zero, zero, and seven
 
user7480455
I am old but I was asked not to talk about my age or I will be kicked so I dont
 
mr5
In the future, I hope they will make an interactive IDE that would yell at developers who misuse the function
 
user7480455
it offended some of the younger people I am guessing
 
2:38 PM
Maybe ReSharper
 
@007 Young people are easily offended by reminders of mortality.
 
user7480455
That is what I concluded by the hostile reaction to jokes about aging
 
mr5
and a live profiler ^^ that would be very exciting!
 
@007 No, it's just annoying and not funny
 
user7480455
the poor chap just booted me out of his room so
 
2:39 PM
@007 Whereas at my age, I have accepted - nay, embraced - my deterioration into dotage.
 
user7480455
yes kendall but talking about moms and cursing bad words is not
 
user7480455
this is a place of science after all
 
@007 I also contribute productive discussion, so they let me stay
 
user7480455
not the jocular locker rooms of some primary school
 
mr5
if I was you, I wanna be me too, 007
 
user7480455
2:41 PM
its fine... I dont work in the langauage all that much so I cant really help there so they are right to ask to me to exit\
 
@Nerdintraining mwahahahahha im comming
 
@007 That's where you're wrong

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
@KamilSolecki dude tmi
 
user7480455
well I will not speak bad of people just to fit in
 
mr5
y do 007 always have a quarrel with someone?
 
!!urban tmi
 
2:43 PM
@KamilSolecki TMI Too Much Information - way more than you need/want to know about someone.
 
user7480455
I come here because sometimes you all have good chats related to science and your personal belief systems... I find that interesting
 
@KendallFrey oh trust me that is too few
 
user7480455
I have never done that <r5
 
How come every time I see @007 there's some kind of argument going on, whose point I don't really care about but seems to be something trivial every time?
 
user7480455
it was kendall that told me bull have to release waste
 
user7480455
2:44 PM
I just typed hello to the room
 
mr5
yeah I noticed that too ^^
perhaps Kendal is his mortal enemy?
I'm loling right now :D
 
user7480455
please guys not here too
 
user7480455
I say hi some guys gets rude what should I do not type?
 
user7480455
If that is the rule I will ignore him
 
No one's being rude
 
mr5
2:45 PM
maybe you should start responding sarcastically?
 
user7480455
I just want a stable place to chat
 
oh, you're a horse?
 
user7480455
no that is not what I do
 
i should hope not
unless you're a horse
 
user7480455
I just roll with it for the fun then some guy jumps in thatI am the cause of the trouble
 
2:46 PM
then by all means
 
mr5
@007 don't be too serious ^^
how come they said my browser supports <input type="tel" /> but it's not working for me
 
<3 asdf
 
@mr5 use twitter bootstrap, seriously.
 
mr5
I do
but it's still not working :/
 
2:49 PM
oh well then why aren't you using the arcane arts of copy-pasting
oh jeezus maybe you forgot webkit or something like that
I've had some instances where stuff doesn't work because some styling is missing
 
mr5
<input type="tel" /> <-- this should without adding any css
 
try CTRL+F5
if it still doesn't work, try <input type="tel" > </input>
 
mr5
I have tried visited 3+ sites with those input type but it doesn't work still
 
what browser?
please don't say Edge or I'll slay you
 
Say IE! Please say IE.
 
mr5
2:52 PM
I'm using the latest Chrome
 
he's taking some time, he might have been caught in an entropy and needs to travel through the moebius strip
oh well no entropy for @mr5 I guess
for me it's just a textbox
 
So..whats supposed to happen? There's an input field. So?
 
@HéctorÁlvarez Sean Carroll would kill you
 
with a placeholder saying to input my (having sexual intercourse in the name of the king) telephone
 
<-On FF
 
mr5
2:55 PM
it suppose to filter non numeric characters but it doesn't
or I might be wrong
 
where does it say that?
 
mr5
just my guess ^^
 
it doesn't for me either
dude
input type text
max length whatever
 
mr5
well, <input type="tel" /> doesn't seem to be any different with <input type="text" />
why the hell did they created it for
 
onchange (if value char at length-1 isnan --> cut it out)
 
2:57 PM
the input value is not automatically validated to a particular format before the form can be submitted, because formats for telephone numbers vary so much around the world.
For phones to show the number keyboard
 
@Metallkiller kennste dich mit DTD aus?
 
mr5
21
A: Is it okay to use <input type="tel"/> now?

el.pescadoBrowsers will fall back to type="text" when they encounter unsupported input type. So I think it's OK to use type="tel".

 
@Nerd nie gehört
 
mr5
well, it falls back to type="text" for browsers. it works on mobile only
 
XML Schema?
 
2:59 PM
Nov 16 at 7:02, by Héctor Álvarez
@Nerdintraining 50 4c 45 41 53 45 20 53 50 45 41 4b 20 49 4e 20 45 4e 47 4c 49 53 48
 
@HéctorÁlvarez crud you
 
mr5
PLEASE SPEAK IN ENGLISH
 
nein, senor cinq
 
mr5
I have used asciitohex dot com
67 6f 20 66 75 63 6b 20 79 6f 75 72 73 65 6c 66
 
3:05 PM
I do my conversions on the fly. She's gotten big enough through the years.
 
3:15 PM
@KendallFrey what's that supposed to mean? In what language?
 
no, mister 5
 
so it's german/pseudo-spanish/french
 
despancais
 
mr5
cyka anjing kontol baka
 
3:19 PM
Señor* for the record
 
I don't have one of those on my keyboard
 
4:00 PM
oh scheiße
I don't have ß for the record
it's alt 225 btw
 
I'm off, cya tomorrow!
 
arrivederci
I'm leaving too, au revoir
 
4:28 PM
im off too, reservoir
 
mr5
I'm not off yet, abrevoir
 
@Metallkiller cya lazyass
@HéctorÁlvarez cya hardworker
 

« first day (2615 days earlier)      last day (2332 days later) »