« first day (2028 days earlier)      last day (2121 days later) » 

10:59 AM
Hi all
 
11:14 AM
Just tried SQL Ops Studio... the cross platform, less powerful cousin of SSMS
Looks promising, but I'll stick w/ SSMS for now
 
11:33 AM
Looks like VS Code?
 
Yup. Has that feel to it
Probably built on same engine
 
Someone needs to tell MS that Electron isn't the way forward
 
They want to use one codebase to target all platforms
Not crazy about that. I like native Win apps
Hopefully they're not going to eliminate SSMS in favor of this
 
 
1 hour later…
12:41 PM
They could have picked up QT and built on top to have cross-platform.. but they chose the easy way out
and yes this is 100% VSCode code base skinned & plugin focused on sql
> Fortunately, our upstream platform, Visual Studio Code, is also optimizing this same scenario.

^ it even says that in article :)
 
12:59 PM
Hi
 
1:17 PM
hiya @LutaayaHuzaifahIdris
 
morning all
 
hi biggi
 
1:54 PM
Elo people
 
oi
 
whoa, kevin's here
 
soooo, i call a command line command, that call ends up creating another process which opens a new command line window and all of the output is written to that command line window instead of the original one... is there a way I can redirect that 2nd process output to the original window, or maybe a file?
 
yes - redirect the stream?
 
isn't that just a > filename.txt?
 
2:02 PM
yea but that's just stdout stream
you may want stderror too
unless have access to process itself somehow before it starts spitting things out - in which case .net methods are there to directly handle it
 
well > filename.txt is attempted to be parsed and i'm getting a "invalid argument"
naw, calling third party EXE that's a POS
an eclipse based ide lol
ahh, i think i have to redirect using python
(that's what calling the EXE in the first place)
 
2:25 PM
probably yes then - might wanna ask in python room :P
 
 
1 hour later…
3:32 PM
If you have a list of AD groups, how do you remove the domain from them? Such changing this: NETWORK\\someGroup --> to someGroup
I know how to do that w/ individual list items... using IndexOf + Substring. But how do you do it on a list?
 
Select?
 
After I typed it, I realized...
list.Select(x => x.Substring(x.LastIndexOf(@"\")+1)).ToList();
That did it
 
-1 for ToList
 
What's the better way?
Cast to list of string?
Also, can that do a check for null for the last index?
 
The better way is to leave it as IEnumerable until the last second
Casting to a list of string won't work
You have an anonymous method; just write it out
alternatively; check the LastIndexOf documentation
 
3:43 PM
Going to do it as a foreach instead
 
can you not just inject into original list already filtered?
 
That's just as bad as ToList...
 
btw instead of index hack - i generally prefer split hack
"NETWORK\\Stuff".Split('\\').Skip(1).Single() <- is how I prefer it
(much easier to skip more than one index instead of calculating indices and then repeating until you reach desired element)
your substring will work on garbage - but linq will choke - IMHO a desirable trait in parsing
 
Thanks, guys
 
this comes even more handy in nested situations
for example: Link header that gives you next / previous / last / first links for pagination on requests
 
3:50 PM
Nice
Would substring choke on -1, which is what is returned from lastindexof if it doesn't find the string?
 
not sure
some implementations treat it as len -1 - some don't - can't recall which version is .net
i think it'll choke
 
That's what I'm thinking
 
ok this is completely off topic but general information that we shuold know - somebody did a really nice round up of USB 3 revisions in a comment:
Each new version of USB is a superset of all previous versions. USB 3.1g1 was 3.0 plus support for Type C. 3.1g2 added new lanes exclusive to Type C, and 3.2 doubled them which is why it’s Type C only.
seen text about 3.1g1 being a rename of 3.0 - but this guys comment makes far more sense... it's not a rename - it was a hardware level revision which is why us consumers with existing usb 3 devices didn't see any change
 
I have a (C) USB 3.1 port off my mobo
I think it's BS
 
you very likely have a 3.1 gen 1 :)
 
4:03 PM
yup
 
unless you got it in last 6 months
and unless you have usb-c port - you really just have usb 3.0 port :)
but technically for marketing they can label it as 3.1 gen 1
its something thats been bothering me on amazon - its hard to find gen 2 stuff because of this mess
 
4:17 PM
Off topic: my new laptop's bottom screen bezel has become somewhat detached from the screen itself such that there's a gap
It's not affecting the perf. Wondering if I should take it in
The laptop gets very hot toward the top of the keyboard. When you close the lid, that heat transfers to the bottom of the bezel. Thinking that caused this
 
it's a brand new laptop - you should definitely have it looked at while its in warranty - that's just bad design
(i'd even consider returning it if its an option)
 
Yeah, they have 90 day return. Just hate to go through the hassle
I've only installed some games on there from Steam so nothing's on there that I need to keep
 
i'd wipe it and return it asap
the msi laptop i ordered for something like £2500 had wrong layout for its numeric keyboard and i returned it for that alone
having heat affecting your screen panel is a huge deal breaker
 
Yeah. Need to return, get another
Well, I like the machine. What I didn't realize is that I shouldn't close the lid after playing Doom for an hour!
 
Metal laptops = Win
 
4:22 PM
this G751 I'm on also has the ability to boil water but the vents never let the keyboard / screen area get hot - all the hot hair pumps out from the actual vents at the back meant for purpose and laptop stays warm at most when in my lap
 
Maverik, you'll shoot me, but it's this one: m.costco.com/…
 
no no closing lid has no issue - it's a design flaw and you don't want to keep that kinda thing
return + refund - change machine model
thats really bad - its newer model of my machine using the same vents .. not sure why it's like that but don't take chance with them
they're really bad once you're out of refund window
 
It's got like 3 years of warranty
 
by they i mean Asus
nah its useless
Costco will tell you to talk to vendor and vendor will tell you to take it to the shop you purchased it from and you'll be stuck in middle
 
MSI is better, but then some folks say they're not stable... keep crashing
 
4:25 PM
that's the exact thing that happened to me with Asus router from Amazon but amazon eventually took it back after 6 months of back and forth
i wouldn't generally listen to such people
 
So you have an MSI?
 
unless they can tell you specifically why its crashing.. they're more likely just idiots
i had MSI .. the one i bought for myself
 
Yeah, this is my home PC
 
if it wasn't the numeric keypad layout issue .. i would have considered keeping it
(its ssd performance was really underwhelming compared to my samsung 850 pro and that was a major turn off when i turned the machine on for first time)
 
This one has 512GB SSD Raid 0
 
4:27 PM
and i had specifically bought the RAID0 SSD package and it couldn't compete with my years old single 850 pro
so yea.. there were issues but i could have worked through them if the keyboard wasn't deal breaker
just use your distance purchase rights.. buy a machine and if you don't like it.. return it
 
I can just walk to the local Costco and return this, I think
I'm really enjoying playing Doom on it, though
Got to grab some lunch. Back shortly
 
5:02 PM
Hello
 
Hi Sakthivel
 
Hey Alex, Can i ask a question on Xamarin here ? not really wpf things
 
Go for it
 
In a cross platform shared app, i created a class. created a object in mainpage.xaml, assigned values to the properties. builds successfully but runtime error 'Are you missing a type ? Contact(class) cannot be found
Project.Android somehow not recognizing a class from Project.
so basic it screws my head
 
Errr, have you built it?
I've never seen that be an issue
Is it Shared, or .NET Standard?
 
5:11 PM
Its shared
 
user9145305
I might be missing something -but if I am replacing an element in an ObservableCollection, I am seeing the correct data when I set breakpoints but the View doesn't reflect the replace. It shows that index being empty but the debugger shows it has data at the index.
 
I haven't seen that issue either Sakthivel
How are you replacing Cuphead?
If you just do [x]=someVar it won't work
 
user9145305
Yeah, that's what I was doing. It was the first suggestion in StackOverflow when searching.
 
That won't fire any events. I would suggest add/remove or populate with empty objects that you can update and have those fire INPC
 
user9145305
5:28 PM
ok, thanks
 
5:53 PM
@Sakthivel for a cross platform app, you have multiple projects. one for each device, and one that is shared between them all
i am assuming you have placed your Contact class in shared project?
 
@Julien yes.
'and in the shared project's MAinpage.xaml, I created a Public property and an instance
 
did you manually add the android project to the solution?
 
assigned hard coded values to the properties and built the project. Build successful but gets a runtime error.
@Julien No, I created a Cross Platform App
 
try deleting bin/obj folders from both shared project and android project
 
when i hover mouse at the new keyword here, 'TestContact = new Contact();' , it says not available on Android
 
5:57 PM
where is that line of code located?
 
public Contact Contacts { get; set; }

public MainPage()
{
Contacts = new Contact
{
FirstName = "Sakthivel",
LastName = "Chand",
Email = "test@gmail.com"
};
InitializeComponent();

}
 
ew
Why is that not in a VM to start with...
 
I am just beginning to create something very simple with xamarin lol
 
the shared project shouldnt have any knowledge of device-specific projects
if you are seeing messages containing the word android in your shared project, you are doing something bizarre
my guess is that you have not created the project you think you have
 
Hold on. I have updated to xamarin forms 3.0 and the VS 2017 latest. It has Intellisense to XaML. kinda got smarter
 
6:09 PM
shared project could be used by mac desktop, ios, android, uwp, even TV
it doesn't know anything about how its being used
upload a screenshot of your solution explorer
 
maybe dont do it before InitializeComponent
generally you shouldnt be doing anything before that
but i dont think it would cause this kind of issue?
definitely some fancy new intellisense. havent seen that before
 
@Julien Exactly. Its not the issue.Contact.Contact() is not available for android. i am researching on this
VS2017 usually sucks. its like beta but youre forced to use it.
 
? i had the exact opposite experience
vs gets better and better each update, at least for me
XF on the other hand is hit or miss
 
2017 is not your problem
 
6:20 PM
It gets better with each update. But 2017 is still not stable if you ask me.
 
Haven't had it crash once
 
@BradleyDotNET The problem is it wont crash
 
did you try asking on the XF forums
 
you and I have a very different definition of problem
 
post there and let me know when you get it fixed hehe
 
6:22 PM
I am gonna try the same in VS2015 and come back here for updates in 10 minutes
 
meh. i'd be very surprised if that made any difference
especially considering the fact that its a runtime error
 
6:38 PM
did you use "Shared Project" option or ".NET Standard" option?
i think it has to be .NET Standard since you are doing gui stuff right
 
He said shared already
shared is probably more buggy; but the presence of GUI shouldn't make a difference
 
6:55 PM
pretty sure shared projects dont have a gui level
you are supposed to do native ui when using a shared
maybe not. i dunno anymore. lol
 
Uggggg
 
either way, especially as a first project, you should be using .net standard
that replaced PCL
shared project is fancier and more complex
 
@Julien The Most basic native UI elements are all abstracted for shared UI
 
yes im aware, i made several xf apps
use .net standard
 
whats the difference in choosing .Net standard over shared ?
 
7:02 PM
a lot. you can google it
you need a good reason to want to use shared
 
I got a six month subscription in plural sight. so i kicked off with xamarin and I was shot dead in the first video of the course. FML
 
7:38 PM
Xamarin is not the easiest tech to get started with fair warning
If you are new to XAML you may want to start with UWP or WPF
 
8:07 PM
well, it worked
 
:D
 
Sorry I vanished earlier - @Sakthivel I've never used Shared project, but like Julien said, I'd go .NET Standard without hesitation
Shared lets you do XAML of course, the code just gets compiled in to the resulting binaries, but its always been weird
 
8:28 PM
@RudiVisser Hey, Long time ! I guess its weird yeah. Thanks
 
Good day/ evening everyone!
Fast question: If there's a way to notify viewmodel from model (aka a sqlite database) so that the viewmodel in its turn notifies the view, how is the best way to go on about that?
My initial thought was to implement INotifyPropertyChanged in Model and ViewModel. Also to have ObservableCollection in Model and ViewModel.
 
Manually subscribing to INPC or INCC is not fun
I would recommend custom events for model->view model
it reacts by setting whatever properties or modifying whatever OCs
 
Hi Bradley. Thank you for the fast reply.
I see. But those commands in the Model will just be called upon like normal functions? Since my understanding of commands is that they are useful for when binding, and I don't see how one can bind with a ViewModel.
 
what is changing the values in your database ?
 
I never said anything about commands
And yes; the model layer is composed of normal classes
 
8:42 PM
Through the View I intend to change the database (inserting, deleting, updating etc.).
Once the change is done, I want for a different View to reflect the update on the databse through its interface.
Oh, my mistake. I hastily assumed that events and commands were the same.
I realized my mistake after re-reading. My apologies.
 
there's no one way to do it
you can use pub/sub messaging to alert the target vm that it needs to refresh
you can forego messaging by getting a reference to the view model in question and calling a refresh on it
 
@Julien @BradleyDotNET The issue was my android project was targetting Anroid 8.0, but the latest Emulator i had was 7.1
 
i found using the windows iphone emulator to be the best dev experience
but you need vs enterprise i think to get it
 
I'm not a big fan of Julien's second option there as it implies the model knows about specific VMs
 
8:47 PM
thats not true. yassin said he is making changes to the database through a view, which implies a view model
 
Whether you do straight events or pub/sub keeping the flow of knowledge View -> ViewModel -> Model is useful
 
so viewmodel would know about other viewmodels, potentially, yes
but i am imagining a more abstracted system of some sort
 
I would think the message is View -> View Model -> Model -> View Model2 -> View2
that's the usual flow you go for in this situation anyways
but maybe I have it wrong
 
view -> view model makes changes in the model, alerts other view models -> model
 
right
I just don't like the idea of Model knowing about ViewModel2 (even through an interface)
 
8:48 PM
yeah i agree that would be bad
 
though a common interface with registration and what not would be... ok I guess
 
off the top of my head i'd go with some static class that vms could subscribe to that propagated changes
no minor task, though
 
why not just do the model class itself?
it should be already injected into any applicable VMs
 
because its harder for a model to notify its parent view model? not sure what you are asking
model feeds data into vm, vm is initialized, changing underlying model wont affect vm
 
View -> View Model -> Model -> View Model2 -> View2 sounds reasonable for me as I can simply understand it.
 
8:50 PM
I'm just saying instead of a static arbiter just throw an event on the model class itself
the view model shouldn't be owning the model
 
sure, thats reasonable
 
Just trying to keep people from relying on static stuff as much as possible
since they aren't as likely to understand and account for the pitfalls
 
i feel like a change watcher is a good use case for a static class
no need to be afraid :D
 
not really; events are actually a terrible use case for static classes
memory leak city if you aren't careful about de-registration
 
So, an event that fires every time there's a new change in the database.
When the event is fired, it somehow notifies the vm and from there I can have a function that updates the ObservableCollection that I am feeding the View?! Sounds reasonable?
 
8:52 PM
disagree bradley. hehe
 
From very painful experience; I know it can happen
 
yeah
 
Yes, that is what I'm talking about
the "somehow notifies" is via a C# event or pub/sub or whatever
Plus an event static class violates the "no state" principle :)
though its not nearly as bad as static state on an instanced class
 
@A.Yassin Sounds somewhat parallel to c++
 
ideally the function that updates the oc that is feeding the view is the same function that populated it in the first place
 
8:57 PM
Um... what on earth are you talkinga bout sakthivel
 
Oh, about that Julien, I just assign (returned OC of a function) an OC that I populated from Model to another OC in ViewModel. Is it alright to do so?
Then, my next idea would be to reassign the returned OC for every change in DB.
 
no don't do that if you can avoid it
you are forcing it to recreate all items in that case
 
no. reassigning OC's is bad practice in general
 
actually add and remove the changes
 
you want to update existing OC in place
 
8:58 PM
Exactly Julien. That's what I want.
 
public ObservableCollection<MyClass> MyClasses { get; } = new ObservableCollection<MyClass>();
OC's should be declared like so, it will prevent you from shooting yourself in the foot
 
Bradley, I knew about that fact of recreating all items, but back then I didn't come by any other way to do what I intended to do.
...At least for the delete part, I used the OC.Remove(SelectedItem).
 
It ends up being specific to your domain; but lets say you added a car to a garage. Your model/service files a "CarAdded" event
and then you can just add it to the OC
 
9:16 PM
Sorry for stepping away. Was fixing a gist.
Please check it, this is from my previous work.
It's on how I implemented INPC into ViewModel.
I just wonder if this looks good enough to continue with implementing events into my model later.
 
classObj isn't shown; I assume that is your model?
and to Juliens point making your OC property readonly can help avoid some problems
 
Indeed it is. Here, it's just an instance.
An instance in order to invoke Insert and Delete function inside the Model.
Readonly?! i.e. by only using get and omitting set?
 
right
 
Aha, I see.
Thank you so much! :)
One last thing.
I can't seem to be able to bind the delete command to a keyboard button (obviously, Delete button).
that forced me to have the delete method public and invoke it in the View via a click button.
Is there a way to bind a command to a keyboard button?
 
Yes
Using InputBindings on whatever should have focus at the time
KeyBinding should be the child
 
9:31 PM
"whatever should have focus", like DataGrid and TextBox for example?
 
right
typically I'll just do it on the usercontrol/window
 
I see.
Once again Bradley, thank you very much for your time and patience.
I also want to extend my thanks to Julien.
I'll now dive into event handling with my model. :)
 

« first day (2028 days earlier)      last day (2121 days later) »