« first day (3315 days earlier)      last day (1619 days later) » 

2:00 PM
in Sandbox, Nov 8 at 4:05, by nyconing
!~>info
 
@Sakthivel probably not
Depends on the scope though
 
why not?
blazor was the SPA thing, right?
 
Blazor has only just been officially released so it may be a bit early
 
I'm sorry, but I'm looking at the kotlin website right now and the logo looks like a trans rights icon x.o
 
2:10 PM
blazor got released?
I liked the idea of sending my dlls to the client and let them run
and whatever
 
(its the brand of a piece of hardware I use for media channels)
 
thaaat is not the kotlin icon
 
the logo has the same shape
this is the kotlin logo
I suppose you can see why I think they look alike
and then there is kibana
 
from a distance, the orange stuff is drowned out by pink -- and pink+blue =trans
 
kotlin's website changed colours tho
the colours are much more "passive"
 
2:13 PM
they did? when was that?
 
iDunno
just realized
(logo didnt change tho)
(only website colours)
it used to be a bit orangy
now it is a lot darker and blue-er
 
fr though...pink/purple and orange do not go well together
want proof? look at vanilla ubuntu
 
yo, string replace on SQL or C# side. As far as I am aware SQL operations are more expensive right? And you want to keep SQL as simple as it is possible and let your other layers do work for it
 
what exactly are you replacing?
 
sometimes values are saved as NA n/a or Not available
this is address1 - address5
But I am thinking of more general rule
 
2:17 PM
usually I do that on the C# side, tbh
 
Same
I am just wondering is it true in general that you should avoid putting pressure on SQL
 
the only times I do any kind of string replace is when I have a key that combines two other variables together into one and I need to do a right (charindex) to split things up or a concat to put htings together.
 
and let C# do it
 
I only do it through SQL when necessary, since it's easier to debug with VS
if htere's an error in SQL and you run through VS, then VS isn't gonna tell you the whole problem
 
I guess if there are multiple sources that call that sp it makes sense to do it in sql
 
2:20 PM
sp?
 
stored procedure
I am not changing things in table itself, just modifying results of SELECT
 
it really depends on your architecture
you can't combine them 100% and there are some things that C# can do better (strings, ie replace, etc) and there are things that SQL can do better (getting data)
 
50 secs ago, by misha130
it really depends on your architecture
this tbh
 
How can I convert a string to an int inside a Linq to Sql function? It doesn't allow Convert.ToInt32() or int.parse().
 
...
what does it say when you try to do the convert?
 
2:23 PM
You can do that in a regular Linq function, but not in the query that actually gets sent to the Sql engine
 
that the entityframework is not going to do it
 
I mean it should let you do whatever you want unless it knows what type should something be
Why do you even need to convert it?
 
SqlFunctions doesn't seem to have anything that covers it either
I need to do a number comparison
 
inside sql?
 
Convert.ToInt32 usually transforms into CAST()
 
2:25 PM
Yes. The idiots who wrote the database decided to store the year as a string.
 
also StringConvert?
 
oh.....
 
like just year?
4 digits
 
so you're trying to convert the year to a date, as well?
 
alphabetical ordering = numeric ordering so long as the length of the string is always the same
you don't need to convert to a number
 
2:26 PM
Not sure how sql does string comparison but wont string number work like regular int
since sum of individual ord(char) be greater
 
I think I would need to convert it to a date. The month is in the same table. The day would just be 1.
 
SqlFunctions.StringConvert doesn't work?
 
@Neil explained what I meant better ;D
 
@Raimonds ;)
 
I mean if the format is consistent you can do with strings
since only thing that would change are numbers
 
2:27 PM
I'm positive I've converted from string to date before
 
though if there is a month, admittedly it may be more convenient to convert to a date and use that
 
wait....the month and year are separate entities?
 
Separate fields in the table, yes
 
Why not just use Datetime2 like normal people
 
though again, year + month can be ordered just fine as well, assuming month is always length 2
 
2:29 PM
euuughhh that's awful
 
order by year, month is fine
 
@CaptainObvious well like hyper here said: his coworkers are special
 
@CaptainObvious that would be too easy
@Neil yeah like 01 vs just 1 would mess everything
 
DateTime2?!?!?!
WHAT ARE YOU
AN ANIMAL?!
 
the sequel's never quite as good as the original
 
2:33 PM
What the fuck would you use
Don't say datetime
 
what's wrong with either of them?
I use datetime cause it's all I need
 
datetime2 is better in every way than datetime
datetime is only accurate to a third of a second IIRC
 
it just seems more complex to me and not in a bad way
 
Is there a function like .Select() that I can use on a single object? Something that lets me manipulate the properties and return something arbitrary?
Without having to create a new variable
 
@Hypersapien What exactly do you want it to do that simply writing a method won't do?
 
2:37 PM
What I want to manipulate is the output of a Linq function that only returns a single object (Min() in this case)
Just looking for a cleaner way to do it.
 
public static TInput Execute<TInput,TOutput>(this TInput input, Func<TInput,TOutput> func)
{
    return func(input);
}
Now you can do myList.Min(item => item.Length).Execute(length => Math.Max(length, 0));
Basically it lets you call any function that converts from T1 to T2 in a fluent manner.
You can call it Do() or Apply() or whatever.
I don't know if I'd necessarily call it "cleaner", though.
 
@AvnerShahar-Kashtan you have a "this" keyword which makes it act like it beongs to TInput class?
 
@Neil It's an extension method on anything, but still keeps you type-safe, so you don't define it on object without knowing if your func's input is the same type.
 
that's terrifying..
does it override behavior?
 
Also, I got the order wrong on Func's type parameter. Should be TOutput first.
@Neil I think C#'s method resolution will take a real method over an extension method.
So, overriding ToString in an extension method will never actually work.
 
2:45 PM
that's safer but still could kick you in the ass later just the same
method does what it does 99.9% except when it happens to have an Execute function already on the class
 
There, that's the cleaner one:
	public static TOutput Execute<TInput, TOutput>(this TInput input, Func<TInput, TOutput> func)
	{
		return func(input);
	}
@Neil Yup.
@Neil Execute function with the same signature.
 
"Operator '<' can not be applied to operands of type 'string' and 'string'"
 
Well, it can't.
 
Is there a name for a pattern which i can use to abstract away what database i'm using? For example i use nosql now but if i want to switch to sql, that i can easily plugin a new class which inherits some generic methods like add, delete etc..
i'm pretty sure there must be some design pattern for it
 
Sounds like you're looking for Entity Framework or similar
 
2:59 PM
you cant really nosql on ef
oh wait never mind you can
probably the pattern you most likely want is unit of work
 
I've always felt that "unit of work" was a terrible name for a pattern.
 
yea it doesn't really explain anything
 
Basically, Unit of Work is a transactional layer on top of the Repository pattern.
 
EF is not exactly what i'm looking for. However the pattern should be able to communicate with EF like code. I think unit of work is what i'm looking for.
 
@A1RStack You might be adding too many layers of abstraction here.
 
3:05 PM
EF is unit of work on its own
oh "EF like code"
 
@AvnerShahar-Kashtan how so?
what i'm trying to achieve is to be able to switch out the framework (ef, llbl, sql, mongo) while keeping the datamodel consistent
 
G K
@MikeTheLiar "do you have control of the schema or do you have to use the existing schema?" - I can create new schema as well if its required.
 
you would probably want a repository then
EF like is pretty relational based imho
 
@A1RStack EF is already an abstraction framework.
 
@AvnerShahar-Kashtan but its pretty relational tho
not much use for an object store or document store
 
3:15 PM
yea you need another abstraction layer between normal EF and mongo EF for instance
 
I can still recommend a repository like layer
 
What are you writing that you need to switch between, say, Mongo an SQL Server transparently? Because these are different tools for different jobs.
 
it's really not that complex, but the customer wants to be able to switch to different datastores
 
@CaptainObvious I have to admit... developing on a Lambda at work again... VPC cold starts have improved
> Original post from September 3, 2019:

We’re excited to announce a major improvement to how AWS Lambda functions work with your Amazon VPC networks. With today’s launch, you will see dramatic improvements to function startup performance and more efficient usage of elastic network interfaces. These improvements are rolling out to all existing and new VPC functions, at no additional cost. Roll out begins today and continues gradually over the next couple of months across all Regions.
I guess this was the difference between my home lambdas and work lambdas
 
I know what Loschkonzept is.
 
3:30 PM
I know what Boterkoek is.
 
Yeah but my insane word exists
 
mine too
 
Does it? Both sound like a monkey slapped the keyboard
 
because neither is english, used in an english sentence
 
@GK I feel like this might be easier with a different table structure but it's still an interesting problem
 
3:33 PM
@Wietlol You lie, every word is English if you believe it hard enough.
 
Every word is English if you wait long enough
 
Dothraki was originally Southern Scottish English.
 
@HéctorÁlvarez yes, but I dont believe it hard enough, so it isnt
 
@GK you're basically getting a list of child IDs and you need to find the parent row that matches that set of children exactly
 
@Wietlol Yeah but you believe Java is good so your beliefs count less than a pagan at the church.
 
3:35 PM
I dont believe Java is good
have you learned nothing?
no language ever released is good imo
 
Oh right
 
and the only reason for that is that Wietlang hasnt yet been released
 
yesterday, by Héctor Álvarez
Fun fact: Did you know that elephants are born at 100Kg? That makes them the 2nd biggest babies in the world, only after Wietlol arguing other languages. :)
 
again, I AM NOT A BLUE WHALE!
I AM A GREEN LION, DAMNIT
 
    in an extension method, for example:
    public static string ToQueryString(this ServerRestartRule serverRestartRule)

What does the this refer to? is it saying that I want to add the ToQueryString method to the ServerRestartRule being passed in?
 
3:41 PM
@JoJo It means you can call the extension method on an instance of ServerRestartRule like it was an instance method
 
Holy crap
Its just NOW occurred to me that @Wietlol's actual avatar is a green lion
 
@MikeTheLiar an instance method on that specific instance of the ServerRestartRule?
 
@CaptainSquirrel did you also notice that it is a majestic flaming green lion?
 
Oh it is because the extension method has the static keyword... I think
 
An extension method is a static method
 
3:44 PM
yep
 
If it helps, you can think of it as the same thing as a static method where the instances is passed in
 
@HéctorÁlvarez so you're also saying Wietlol is overweight?
 
@AlRey I didn't say that, but yes why not...
 
okay, so this keyword in extension method is just allowing me to pass in an instance of the object I am operating on
 
Close, it allows you to call it on an instance you are operating on
 
3:46 PM
I am just a little lost, cause it worked before I had the this keyword .. but I guess that made it not a true extension method
so the method works either with the this keyword or without it.
 
@Wietlol oh god
now that's all i can see
 
what did you see before?
a big green fart?
did you see an avatar at all?
or just a "could not load file" image
 
I just saw a wierd green square
Never really thought much of it
 
I just see weird rotated squirrels
Jack, shrug
 
¯\_(ツ)_/¯
 
3:51 PM
With GIT, how can I keep the changes I want in a project, but make sure they aren't ever sent to the remote repository?
 
@JoJo here's an example that might help
public static void Main(string[] args)
{

    var f = new Foo();

    f.InstanceMethod();
    Foo.StaticMethod(f);
    f.ExtensionMethod();

    Console.Read();
}

public class Foo
{
    public void InstanceMethod() { Console.WriteLine("This is an instance method"); }

    public static void StaticMethod(Foo foo) { Console.WriteLine("This is a static method"); }
}
}
static class Extensions
{
public static void ExtensionMethod(this Program.Foo foo) { Console.WriteLine("This is an extension method"); }
 
Specifically, this is about the connection strings in web/app.config
 
oh ffs
 
@MikeTheLiar thanks, will load up a console app
interesting the ExtensionMethod behaves the same was as an InstandMethod!!
    f.InstanceMethod();
    Foo.StaticMethod(f);
    f.ExtensionMethod();
this is helping!..
 
@JoJo yep, that's really all it is - it's a static method you can call as if it were an instance method
 
4:02 PM
I think I caught whatever Hans had...that's what I get for taking care of him
does anyone know how to use HtmlInputControl or something similar to get the ID of a dropdownlist?
 
4:21 PM
and now my favorite Kotlin feature: extension methods for multiple instance targets!
 
How can I delete a commit from git while keeping the changes?
 
it is galoreiaous
 
@Hypersapien why would you want to delete the commit if you also want to keep the changes?
 
@Hypersapien soft reset
 
Because I don't want the changes sent to the remote repository
 
4:23 PM
Unless you want to delete from the remote
 
They haven't been pushed
@MikeTheLiar git reset HEAD^ --soft?
 
That sounds right. I have to admit I usually only use the command line for reflog
 
I never use command line. I just copied that from a page I googled
That just uncommitted the changes
Brought back the red checkmarks in the Solution Explorer
What I want is to change something on the local machine and not have git recognize it as something that should be set to the remote repo.
 
what is a command line?
 
Jay
I have a bool in a table and I'm trying to figure out how to check or uncheck a checkbox on page load depending on that bool
 
4:40 PM
stash undoes the changes in the commit
 
4:58 PM
Found what I needed. git update-index --assume-unchanged some-file.txt
 
5:55 PM
Looking for some insight on github.com/microsoftgraph/msgraph-sdk-dotnet . For deleting messages, it seems like you can only use DeleteAsync(). Issue I'm running into is Hangfire doesnt seem to be the biggest fan of async background jobs. Is there a way to delete messages in a synchronous manner?
 
6:07 PM
Sara Chipps on November 13, 2019

In my very first blog post, I wrote about what a personal experience taught me about the Stack Overflow community. I said we were going to step back and re-evaluate how we deliver feedback, how we can improve content quality, and how we can reduce friction between people. I said that our goal is to have the question asking process be painless and beneficial for new people and Stack Overflow veterans alike.    

During this re-evaluation period, we noticed something in our reputation reward system. We give anyone who receives an upvote on an answer ten additional reputation points, but only give five reputation points to people who receive an upvote on a question.  …

 
6:19 PM
@MikeTheLiar thanks so much. appreciate the effort. I learned more about extension methods today. I am really challenging myself to fully understand what I code, and not just do it cause someone said to, or the website example code was that way.
 
7:11 PM
Happy to help
 
Jay
the checkbox is one of many columns in a repeater
and I have an ItemDataBound method that populates the repeater
and I'm pretty sure that's where I need to do it, I'm just not sure how
something along the lines of if the bool in the database is true, put a check in the box
 
 
1 hour later…
8:20 PM
@juanvan @juanvan how do I "select rawdata" from github?
Im just looking for a simply way to get the latest version exe file from my repository...
 
user47589
9:05 PM
What is up fellow nerds?
 
Jay
a chicken's butt when it's eating
 
my blood sugar keeps spiking and my goddamn pen is BROKEN!!
oh thank god...it finally leveled out at 375 -_-
I blame your rainbows
 
user47589
My rainbows are not to blame. They are innocent.
 
pfff please everyone knows you ponies cause diabetes
 
Jay
studies have shown that rainbows as well as ponies have been known to make everything better
 
user47589
9:11 PM
A lack of ponies in your life might be to blame.
 
user47589
I recommend getting more ponies.
 
Jay
I'm still struggling to get this bool to check a checkbox
 
user47589
Have you tried asking nicely?
 
Jay
right after I tried silently encouraging
 
user47589
Well, regardless, can you show us what you're trying to do?
 
9:13 PM
You just need to believe in yourself.
 
user47589
Oh, checkboxes hate silent encouragement
 
Jay
I've tried a few variations of this
<asp:CheckBox ID="MyCheckbox" runat="server"
	Checked='<%# DataBinder.Eval(Container.DataItem, "TheBoolColumn".ToString()) ? "true" : "false" %>'>
</asp:CheckBox>
as it sits right now it says it can't implicitly convert an object to a bool
but 1) it's a bool in the database and idk why it's coming through as an object
 
user47589
DataBinder.Eval returns an object
 
Jay
always?
 
user47589
Look at its signature.
 
Jay
9:21 PM
I've also tried wrapping it in a Convert.ToBoolean
how do I look at its signature?
 
user47589
Google "databinder.eval msdn" and find the overload you're calling in the documentation
 
Jay
but then it says it can't convert a string to a bool
okay
 
user47589
It's signature is public static object Eval(object container, string expression)
 
Jay
okay I see that
and if I take off the .ToString() I get an InvalidCastException
 
user47589
DataBinder.Eval(Container.DataItem, "TheBoolColumn") returns an object, which can probably be cast directly to a bool
 
Jay
9:26 PM
can't cast from DBnull to other types
 
user47589
Assuming it is returning a boxed boolean.
 
Jay
It does let me convert it to a bool, but then I think it doesn't like the ? "true" : "false" part
or can I skip the eval and do this in the code behind?
 
user47589
To be honest, it's been long enough since I last used webforms data binding that I'm really unsure
 
Jay
lucky!
 
user47589
Become a pony and you, too, can know freedom
 
Jay
9:30 PM
another 1.5 years of experience here and I might try that
 
user47589
Seriously though, I'm not sure how to properly code your data binding expression. My instinct tells me your ternary operator with true/false isn't necessary though.
 
Jay
that thought also crossed my mind and I've tried it with and without
but I do need the Checked parameter to be set equal to the word true or false, not a 1 or 0
I think
 
Fucking expanding project requirements
 
Jay
9:49 PM
okay I've tried every combination of casting to bools and strings and with and without ternary's I can think of
I'm gonna plan B and try a different approach
Eval's are weird yet strangely useful sometimes
 
user47589
I'd rather have expanding project requirements than one of those biscuits that expands in your mouth as you chew
 
Jay
one small bite
 
user47589
10:05 PM
That's all it takes.
 
Jay
this is one of those times where my coworkers are quietly wondering what's taking me so long
I'm doing a bad job of figuring this out
aka I'm totally stalled and staring
 
10:56 PM
Oh, sorry for pinging again @juanvan but i figured it out, rather than needing ANY JSON Deserialization... I just found a way to download the latest EXE from my package with some releases/latest/download/packageName.extension magic
So now I can literally just use a webclient with /skylerspark/Flashy-Flash-Emulator/releases/latest/download/Flashy.Emulator.exe to download the latest version from my releases
and overwrite the old version file in the directory :3
Oh.. hi amy
I havent seen you in a while... Sorry for when I was a toxic asshole a while back
 

« first day (3315 days earlier)      last day (1619 days later) »