« first day (3266 days earlier)      last day (1692 days later) » 

12:39 AM
Can I use reflection to get the values of string literals in code...or do I need something else?

I have a line of code like:

public static readonly MyClass Class1 = new MyClass("This is the value I want to get at");
 
 
4 hours later…
4:27 AM
Hello,
I moved my wpf .net 4.8 project to core 3, wpf designer crashes "System.IO.DirectoryNotFoundException, Could not find a part of the path ..."
but when I run the app everything works fine, also no errors in VS, how can I fix it?
 
 
2 hours later…
5:58 AM
Buenos dias
 
@RobP. you shouldnt need reflection
your MyClass should simply allow other code to read the string value
perhaps make it a public property?
 
6:53 AM
morning ;-)
 
gninrom.
@Mr.Noob Can you tell which directory it can't find?
 
@RobP. It depends on what does the class do with that string, if it stores the value in a property, you could access the property. If the property were private or protected, you could either change its scope to public (easiest thing) or as a last resource you could use reflection
 
7:13 AM
I just made IntelliJ about 75% more usable by halving the time it takes for tooltips to appear.
 
In android studio, the actual popup comes up really fast. Just the text within takes forever to load for some reason.
 
Here it seems it defaults to 1.2 seconds, which is about, oh, 0.6 seconds more than I expect it to be. When you're just familiarizing yourself with an IDE, that's a LOT of time wasted.
 
Avner uses IJ?
is avner converted to Jaba?
did we succeed?
 
Pretty sure somewhere in the Avnerium it says something about language being a tool, just as the IDE
 
aw
 
7:23 AM
@Wietlol Scala, actually.
 
ooh
 
Since our new project will have at least some of the data pipeline running on Spark.
And Visual Studio Code's Scala experience is still far from ideal.
 
Scala is the only major JVM language I havent really explored
 
It's... interesting. Its design philosophy seems pretty diametrically opposed to Java's conservative "let's not add it in unless it's been proven to be useful for half a decade".
 
I tried using VSCode for Kotlin... it didnt even have autocompletion for properties... I know I should blame the plugins, but that isnt making the application any better
 
7:25 AM
It's more of a kitchen sink language. Want to write expressive functional code that looks like an algebraic notation? Sure, you can do that. Want to write Java-style code with meaningful method names? Sure, you can do that too.
 
@AvnerShahar-Kashtan ye, I dont really like such "slow" progress
 
So learning scala can occasionally be confusing because there are several ways of doing common things, sometimes very different ways, but once you wrap your head around some core concepts, it's very nice.
 
such as?
I can do stuff in C# in many different ways too
 
Yeah, C# grew into that as well over the years, and I can certainly see how it can be confusing to a newbie.
Scala did the same, only much faster.
Let's say you have method that returns Option[Boolean]. Now you want to do things based on that value. How do you do it? There are many ways.
 
1, you extract the boolean value out of the option
2, you pass behavior into the option
 
7:29 AM
You can do classic imperative if/else checks to see ifDefined, then use get to extract the value and check that.
You can use map and getOrElse to build an expression out of it.
You can do pattern matching on None/Some(actualValue).
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
hmm... pattern matching?
 
mr5
who needs 200% screen
 
optionalBool match {
    case None => "Undecided"
    case Some(actual) => if (actual) { "Yes!" } else { "No!"}
}
 
hmm...
 
7:32 AM
That's usually considered an anti-pattern from what I've read, but if you're learning scala and getting excited about pattern matching (one of Scala's touted strengths, certainly), you might go that way.
 
oh, have you tried traits?
 
An alternative using map would be optionalBool.map(if (_) { "Yes!"} else {"No!"}).getOrElse("Undecided").
(Contrived example, sure)
 
@AvnerShahar-Kashtan or use filter
 
@Wietlol Not really yet, no. I've yet to fully explore scala's OO-side.
 
@AvnerShahar-Kashtan what is this sorcery
 
7:33 AM
@Squirrelintraining Scala.
 
@mr5 Actually it's only 180% screen
 
@mr5 Is that, like, Samsung's Edge phones, which no-one wanted, extended into the truly pointless realms?
 
@mr5 what if you want to see the back-end of the mobile apps you use?
you need to think in possibilities mr5
 
Extended into the realm of actually kinda interesting for the meme features
 
@AvnerShahar-Kashtan having worked with Groovy (which has similar traits) I miss them a lot now I write quite some decorators in C#
 
mr5
7:38 AM
@AvnerShahar-Kashtan it's meant to become test devices. we have many of them :D
@Wietlol lol. you can see SQL codes in the back of your phone
@CaptainObvious I always forgot my adjectives. Should be "nearly 200%"
 
Meh. We switched from sbt to maven because sbt wasn't playing nice with our build servers. Now I can't get my tests to run in IJ.
 
7:55 AM
why not?
a few months ago, I demo'ed unit testing in Java with a permutation of languages that the tests are written in and that the code to be testesd was written in
 
becasue it's IntelliJ and it's a dodgy IDE
 
languages that were used were Java, Groovy, Scala and Kotlin
build tool was maven
 
@Wietlol languages that were used were Java, "Java", Anti-Java and Java
FTFY
 
ty
I am happy I didnt had to use clojure
then it would be Java, "Java", Anti-Java, Java and ‏avaJ
 
@Wietlol Not sure yet. If I run the tests through Maven they do run, but don't integrate well with the IDE. If I run them directly via the IDE, I get an error that seems to indicate some dependencies are colliding with different versions.
> java.lang.NoSuchMethodError: scala.Predef$.refArrayOps
 
7:59 AM
how are you running the tests?
through the terminal, maven toolbox or test run configurations?
 
Using scalatest, and test run configurations.
Maven tests run but don't show results in the test output windows.
 
Slightely NSFW but I think you might like this mousepad @RoelvanUden sc01.alicdn.com/kf/HTB1lX2heBDH8KJjSspnq6zNAVXaR/…
 
scalatest?
 
@Squirrelintraining Would want for the office. Also, the girl looks like Makoto Sawatari.
 
The unit test framework. From the stack trace, it looks like it's using some feature from Scala's standard library that isn't available, which leads me to guess there's a version mismatch somewhere.
 
8:04 AM
did you specify the scala stuff in the pom file?
 
Morning
 
Sure. Also, it does build, and also runs via maven.
 
I can't find any good tutorial on implementing api calls with OAuth2 within mvc project. I've been reading anything I find for about 2 days
 
Morning
 
note to self... stop using a sandbox project that is larger than the entire codebase I have ever written (except in the sandbox project)
 
8:09 AM
Maven: It may be slow, but it's hard to use.
 
Let's say your creating a MVC/MVVM program, the M... "should" it only be a data holder object? with very little logic?
 
Input logic only, like "no you cant be -1 years old"
 
I only code for about 3 months. I manage to implement basic authorization within my project - but I was requested to use OAuth2.0
 
@Markus The Model is, basically, everything that isn't your UI layer. Don't forget that MVC/MVVM are patterns for building presentation layers. As far as MVC/MVVM concerned, the model is the data holder objects, the data services you call, and anything "back" of the UI layer.
 
o/
hey guys
 
8:13 AM
so I want to fill this object I have with some data (read from a file), for that I really should use a service to fill the model, like: ReadDataFromFile(string path, MyModel model)
I'm converting an old winforms to wpf mvvm, and in the old program the model is also responsible for fetching data from the file. And one benifit was that I could have some properties as {get; private set}. But now I guess I will have to make all properties public?
 
@RoelvanUden ^^ Those cushions are probebely comfortable AF
 
Depending on your scope. If this is a medium app or higher, I'd start separating things. Your user clicks a button (view) which is bound to a command (VM), which calls a service (FileSystemService, or something like that) and returns either a File object, or simply the file contents, it depends on what you need to do with it.
 
@Markus can you make the function MyModel ReadDataFromFile(String path) ?
 
I mean, is the file contents actually part of your model, meaning part of your business domain? Or maybe it's just a file. For instance, your app might allow a user to add an attachment to an entity. You click a button, let the user choose a file, then you show a preview of the file (say, a text file or an image), and when the user approves, it creates an Attachment model object with the filename and contents, and sends it to the server to store.
This Attachment is your model, not the file contents themselves. If your VM needs to show the file preview, it needs a service to get the file contents from disk, but it might return just that - a byte[] of the contents, no more.
 
the content is part of the model. I read the version from an AssemblyInformation file
 
8:20 AM
!!squirrels
 
And I want to be able to change the version on in the file, but then I will have to update the model. But I don't want to be able to change the model without changing the file...
 
.net core 3 has Assembly Unloadability. This makes me happy
 
Where is this code running? The VM? As far as your VM is concerned, there is no file. It shouldn't know or care about it. Wrap the version reading/updating logic in an AssemblyInformationService, which you use to read the version (to display to the user) and to update the version. As far as the VM is concerned, a GetVersion() call gets the latest, and UpdateVersion() updates the latest.
The important thing is that your VM isn't responsible for the model. It gets it from the service layer, uses it, possibly updates it and send it back up the chain, but it's not the owner of the model data, it can't assume it has the source of truth for the model data.
 
@CaptainObvious What is this and why does it make you happy?
 
8:36 AM
I keep forgetting that for all its many, many sins, Outlook still has so many more features than Gmail.
 
outlook is the only office tool I would consider using
 
Even basic ones. I wanted to forward ~30 emails to someone from my gmail right now, and the only halfway sane way to do it was connect my Outlook via IMAP to my gmail account and forward them all in one click there. They all come through as .EML attachments which, yes, Gmail can also open quite well.
 
8:53 AM
\o
 
Assign repository item
to its column
 
I have assigned
@nyconing
 
9:09 AM
sorry it was a private ticket, your link is inaccessible
 
hey fish
hows it going ?
heard about any of the old guys from discord chat ?
 
who is fish?
 
you is fish
 
we are all human not animal
 
wot?
you dareth defy my nature?
 
9:12 AM
building a bot but micheal dont like it? this is the last information i get
 
fish knows who fish is
thats all that matters
@nyconing I see
 
cat also knows who fish is
that is more important
 
yup
im rarely in the discord chat these days, its basically dead
most ppl left it
 
Discord chat?
[confused gandalf]
 
yeah we had a discord group
me and some other ppl
 
9:32 AM
Human is a specific species of animal though
Wait..there's a discord chat?
 
    public interface IDecorator
    {
        Object DecoratedObject { get; }
    }

    public interface IDecorator<out T> : IDecorator
    {
        new T DecoratedObject { get; }
    }
oh hey, I found a case where default interface members actually made sense
every single damn generic interface where a non-generic counterpart exists
aka, every single damn generic interface
 
@Squirrelintraining You can unload assemblies at runtime
 
9:48 AM
Anyone partake in bf4?
Am do not like playing on my lonesome
 
Fucking google again
I updated something yesterday so it works on newer versions of android
Except now it's broken on older versions
Now I have to test shit on 2 different versions
 
what service of google do you use?
or just android?
 
@CaptainObvious expando pls
 
No google services
@Squirrelintraining What is there to expand on? You can unload and reload assemblies while your application is running. So you can update parts of your application while it's running
As well as other useful shit probably
 
@CaptainObvious what if you load, create some objects, then unload?
 
9:51 AM
@CaptainObvious Thanks for expandoing
 
In theory the objects have to be disposed first, or at least not used while it's unloaded
 
hmm...
im not hyped
 
Apparently you can do it "forever, without memory leaks"
 
I suppose I have no use for this feature anyway
 
I mean it's great for plugin type scenarios, maybe noit for core application features
 
9:53 AM
I dont even know where my .dll files are
I dont even know if they even exist
I dont even know if my code runs in CLR
 
stop fucking google
!!Does google like it ?
 
@Hans1984 Not a chance
 
poor google
 
*twitch*
 
oldie but goodie:
 
10:16 AM
someone helps me this is two days iam busy with it
private void gridViewGeneralTest_InitNewRow(object sender, InitNewRowEventArgs e)
        {
            gridViewGeneralTest.SetFocusedRowCellValue("id", tileViewGeneralTestList.GetFocusedRowCellValue("id").ToString());
            gridViewGeneralTest.SetFocusedRowCellValue("name", tileViewGeneralTestList.GetFocusedRowCellValue("name").ToString());
            gridViewGeneralTest.SetFocusedRowCellValue("price", tileViewGeneralTestList.GetFocusedRowCellValue("price").ToString());

            GridView view = sender as GridView;
i have a grid view id,name,price,result
that result is a repository item combobox
same question here
 
we can not see that link, you need to be loged in
 
sorry
this is the question there
 
also your question is rather unclear. I have no idea what you are asking
 
I have a gridview with 5 columns, one of the columns is combobox

I want to add rows to the gridview with a button

When I press the button
I know I can done it for the normal columns by this

gridview.AddNewRow();
gridView.SetFocusedRowCellValue("price","500");

But what about the combobox column?
How do I add a number of items for the combobox in that row?
How to add a number of Items for a combobox Inside a gridview, while adding new row programatically.
thats the question
 
just add it to combobox?
haha combobox. funny.
 
10:21 AM
you mean .items.Add?
 
hahahah
 
that dosnt work
 
how do you add initial items to combo box?
 
dont mind me
!!Will you get me some food now ?
 
@Hans1984 But of course
 
10:21 AM
great
 
combo.AddRange(new string[]{"item","item"})
that doesn't work
it is in place editor
 
how did you add initial items to your combo box?
 
combo.AddRange(new string[]{"item","item"})
that line of code
 
ok
 
in that way
 
10:23 AM
just add your new item.
do the same again
 
I did bro
iam not a fool like that
 
hm
 
can someone give me an example for that, by using XtraGrid Devexpress
:d
 
10:48 AM
!!Was it a vampire ?
 
@Hans1984 That didn't make much sense. Use the !!/help command to learn more.
 
Also, ReSharper has much better refactorings and suggestions than scala on IntelliJ, I'm afraid. They need to step up their Scala game.
I mean, if I go to a method call and add a new argument, it should ask me if I want to add that argument to the method definition, right? Not that hard.
But I'm guessing Scala isn't their top priority.
I'm guessing they're focusing on Java (the big player) and Kotlin (1st party)
 
kotlin is probably their #1 priority now
 
Kotlin should be nobody's priority
 
Kotlin should be everyone's priority
 
10:58 AM
wrong
 
wrong
 
This is why I come here. The witty repartee. The insightful debate. The sheer amount of learning I glean from each measured exchange of well-researched claim.
8
 
Well you are all wrong
vb4 should be everyone's priority
inb4 kick
 
The only real way is the way of TypeScript.
 
11:14 AM
Interesting. I was trying to order takeaway via a local restaurant's website and was blocked by Cloudflare. Apparently because my work internet traffic is routed through the UK. Seems that some enterprising soul denied all out-of-country traffic to the ordering site, which makes sense, actually. The chances of an out-of-country request being a legitimate request for a local take-out order are slim, and this blocks most DDOS attacks automatically.
 
VB4 from like 1995? :P
 
why is your internet being routed to the uk?
Seems like quite the leap
 
*shrug*. Multinational megacorps, go figure.
 
I mean I got a call yesterday from someone claiming to be part of Red Hat, yet the call was coming in from Japan
 
@AvnerShahar-Kashtan Noice :D
 
11:25 AM
@AvnerShahar-Kashtan i.imgur.com/e0u37lt.jpg .
so do I
 
@Hans1984 lel
!!tell Hans1984 meow
 
@Hans1984 meow
 
:3
 
yaay
 
11:29 AM
The face of that cat
after being attacked
 
lmao
"attacked"
hehe
user image
2
I want a burrito now
 
@AvnerShahar-Kashtan that is why we are here, to distribute our non-biased, fully reasonable recommendations on everything that you could possibly do wrong
 
Finally realized that it's not that some of IntelliJ's icons have a couple of annoying pixels that look like a yellow smudge, it's that I have a small yellow smudge on my monitor.
 
@AvnerShahar-Kashtan you still live in Israel?
 
"who put this yellow smudge here?!"
 
11:44 AM
"don't eat the yellow smudge"
 
don't eat the yellow snow
 
mr5
@AvnerShahar-Kashtan I heard there are rocket launching to be held in your place Kazakhstan
 
@Wietlol Yup.
 
Has BuildUrlFromExpression been deprecated or somethin?
 
God dammit
now i want a burrito
@Hans1984 THIS IS ALL YOUR FAULT
 
11:52 AM
@CaptainSquirrel just order at your local food delivery service :)
 
meow?
 
@AlRey If it's part of ASP.NET MVC than yes, as far as I know, it's deprecated.
 
mhhhh
 
That doggo has a burrito
i want a burrito
 
great all i have left is a damn apple
 
11:53 AM
@CaptainObvious can you bring me a burrito instead of a sammich?
 
@CaptainSquirrel It's even worse here. There are about 3 places to order a burrito within a 100km radius, and none get here.
 
screw this
 
Technically i could order a burrito
@AvnerShahar-Kashtan oof
 
@AvnerShahar-Kashtan hmmm....do you know what its successor is?
 
Not using ASP.NET MVC. :)
ASP.NET Core.
 
11:55 AM
Yeah, i want a burrito but i'm not paying a tenner for it
sorry not sorry
 
Nope I'm in maccies
 
@Hans1984 tacocat spelled backwards is tacocat
 
No deal Brexit is here
 

« first day (3266 days earlier)      last day (1692 days later) »