« first day (3741 days earlier)      last day (1432 days later) » 

02:23
@Freerey wrong Alex.
Someone did this the other day too.
@default_noob_network ah it was you. Wrong Alex.
[Freerey] what?
[Freerey] my name's Scott
[Alex (Yaazarai / FatalSleep)] @Freerey you @ me instead of the other @Alex .
[Freerey] <:vivecgrin:644513406531010576>
[Freerey] well then
02:40
Any better than lns.Reverse().Take(128).Reverse().ToArray() ?
\[**[Not Li](https://discord.gg/PNMq3pBSUe)**] `lns.Skip(lns.Length - 128).ToArray();`

If you're looking at shortening your code there.
[Not Li] Instead of reversing and re-reversing you can just skip
 
2 hours later…
04:51
 
2 hours later…
07:37
@nyconing TakeLast(128) ?
morning dudes
08:13
posted on January 07, 2021 by Scott Hanselman

The Stream Deck! (amazon link) is a lovely little device with bright LCD buttons that you can program to do basically anything. I decided to finally add a few hotkeys for Microsoft Teams. I wanted pretty icons, so I used the same ones that Teams uses! The images in a Stream Deck are 144x144 so I used Ctrl-PLUS in Teams to scale the Teams interface up to a large size. The icons look great since

 
2 hours later…
10:18
[Captain Obvious] tumbleweed
10:34
Botler, tumbleweed
@Squirrelkiller Sorry, I don't know that one.
Damnit Botler
||tumbleweed
Botler, learn tumbleweed i.sstatic.net/3xqGt.jpg
Learned the command tumbleweed
10:35
Botler, tumbleweed
10:47
here
!~shiba
is
hans
"what is this sheet hooman"
"gimme some beef and french fries!"
fries for a doggo?
yes yes
nom nom nom
aww
11:20
Is veggie too
Must be healthy
11:30
" A frie a day keeps the veterinarian away"
11:42
That little thief :)
If you have a table TableA which has a column ColA with values 25;41;42;50;63;65;77;97;163;634, how can you split that into a list and search it in Entity Framework for a value? Let's say you wanted to find the value 63
I know you can use Contains but that can find 634 as well as 163
Is the type int or string?
String on the table column that EF hits
It's basically a CSV stored on a column
(await TableA.SelectAsync(t => t.ColA)).Where(value => int.Parse(value) == inputToFind)
Or figure out how to make the db parse to int inline
Thanks, this is for EF 6 on Framework, not Core
In that case strike the Async and await stuff, done
11:50
Is it possible to have that as part of a larger EF call that includes other columns?
Strike that. Yes, it'll work
Thanks, Squirrelkiller
BTW, that dog is so cute and sneaky
you could also do Where(it => $";{it};".Contains(";63;"))
it is a common workaround in sql
where ';' + col + ';' like '%;63;%'
Wow. Hadn't thought about that
Thanks, Wietlol
I do assume EF makes that sql tho
Yeah, it does.
This'll show you the sql if you put it above the EF call:
db.Database.Log = s => Debug.WriteLine(s);
Assuming db is your context object
Ha nice to know, might experiment with that a bit
 
1 hour later…
13:26
You can take the sql from that and paste it into SSMS
14:03
it's kind of a how to, so i am, learning about http clients
so rn i have a file hosted in this format https://domain.com/file.txt
opening the file will have some content in it, now in notepad you must have used the ctrl + F function, i am trying to make the same thing
but the text file is online and not stored locally, imagine this is the text data

```txt
Orange is a color
yello, hmm interesting
what a nice day!
how are you
color = orange
yo can you check this out
damn this is noice
c-sharp is amazing
C# can someone teach me
14:13
@Squirrelkiller That will need some tweaking, as each row in the column has a CSV. We can't call int.Parse on the value 25;41;42;50; and another row having 123;456;, etc. They're not int values directly but contain a semicolon separated string of ints
Ah I see, thought each cell in a column has just a number^^
@SupremeGangCertifiedMember You might have to download the whole file first
Id    Csv
------------
1      25;41;42;50
2      123;456;3350;11;55
^ sample data from table
So we want to find the row with the value 50
Of course, storing CSV in a column to me seems to violate rules of normalization; but that's another story
A CSV column violates 1NF
surround column data and search pattern didnt work?
Ryan Donovan on January 12, 2021
Like many of you, I am a coder with kids at home. What better time to start exposing our kids to the career we all think is amazing! You do think programming is amazing, right? 😀  Well, even if you don’t, coding teaches kids the fundamentals of logic and encourages them to think abstractly. Let’s…
14:31
@Wietlol Yes, that works. Just wanted to try both techniques :)
For my own learning. So not a biggie
you could try Where(it => it.Split(';').Contains(value))
Thanks, Wietlol
Been trying all these in unit tests with sample data
Just Regex match it to 45[^\d]? lol
You had to bring regex into it, didn't you :D
AH no dont find longer numbers
Of course, now you have two problems :P
14:33
Hah!
Actually, regex is cool when parsing strings. But a pain to get it right
@Squirrelkiller that wont work
still needs a starting barrier
or 145 would still match
:p
\b45\b would be a fine regex tho
but then the question is: can your database do proper regular expressions?
SQL Server has limited regex. Hate to say this and will have to wash my mouth w/ soap after: Oracle is better in this regard
 
5 hours later…
19:48
Hi all, I
I'm unable to find a search entry for a problem I'm in,
I'm posting to a controller from HTML form, as I understand every input field is being converted from razor syntax to HTML (for example; name="MainObject.Property") and that's how I can retrieve the value of MyObject in the controller. But I want to add another parameter from javascript along with MyObject, I thought I can do something like $('#myForm')["newName"] = dataAsJson;
the newName is the new parameter, and there's no HTML input for it, is this possible?
20:00
You'll need a property on the view model used by your view. You'll have this property in the view as a hidden field; then update it via JS. When you post, that field is also sent to the server
but do I have to set the value of that input to a string with JSON.stringify, and deserialize it in the controller?
No. It's another text field. If you're just submitting a form using MVC, it'll be fine. If you're using AJAX, then that's whole other ballgame
I will try this, thanks
 
3 hours later…
mr5
mr5
23:12
Where is @Neil?
I think this is Neil's last message:
He probably get swallowed by the Trash can room?
damn it's only wednesday

« first day (3741 days earlier)      last day (1432 days later) »