« first day (1725 days earlier)      last day (2424 days later) » 
00:00 - 18:0018:00 - 00:00

00:20
guys
i want to text container with fixed height and scroll bar.
any ideas
?
you can apply a scrollbar anywhere you want with a ScrollViewer
and you can apply a height to any element you want
i tried but not working
lol ok guess its impossible then
00:36
this is the code for the item <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="170"/>
                        </Grid.ColumnDefinitions>
                        <Image Width="145" Source="{Binding medium_cover_image}"/>
                        <Grid Grid.Column="1" Background="#FF283142">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
you aren't defining a height anywhere
so the textbox will fill all available space
because i do not want make it fixed
i want it dynamic because of the title
you need to define the height of the entire item
00:40
titles may take multiple line
not something inside your template
woooooooooow
that worked
Thank you bro
but what about scrolling
scrollviewer?
i want the full text scrolled if available i tried auto
should j ust be able to put one around the description textblock
have you tried your UI when there are a few thousand items?
00:44
i should nest them
nop it's not available cuz yts give movies with pages with max of 50 movies per page
ok :D
well what is your guess if that's happened ?
it's so easy with yts to make an application like netfelix
why people does not do something like that for free
because it's not so easy after all?
yeah you are right
but with some people like you guys
i think it's very easy.
ah, the classic "it's so simple you should do this for free"
well, no, you still have to account for people here working already and earning quite a large pay
00:57
for me it comes down to the 80-20 rule
where 80% of the work takes you 20% of the time
if they were implementing an application like netflix for free, they wouldn't spend their time doing their job, IOW they would lose money
you are right .
also note that with the scale Netflix manages, they have to create their own infrastructure from scratch
which is very, very, very time/money consuming
00:59
i will give you your first feature request
show me a random movie
aha
got it
i want to show you how i implemented the mvvm
and please tell me my mistakes
it's working but i mean is it the right way ?!
 public class Data_Movie
    {


        public Data_Movie()
        {

        }


        /// <summary>
        /// Get Movies List without ID
        /// </summary>
        /// <returns></returns>
        public static  MovieList_Object Get_All_Movies(string API)
        {

            string json;

            using (WebClient wc = new WebClient())
            {

                json = wc.DownloadString(API);
                MovieList_Object MovieList = JsonConvert.DeserializeObject<MovieList_Object>(json);
that is the datalayer for gathering json data
it's on separate folder called Data.
you have already seen the view. and the model is the classes from json to c# converter
the view model now is this
public class MoviesListViewModel
    {
        private static string myAPI;

        public ObservableCollection<Movie> My_Movies { get; }
        //Data_Movie my_data;
        public MoviesListViewModel()
        {
            myAPI = "https://yts.ag/api/v2/list_movies.json?limit=50";
            My_Movies = Data_Movie.Get_All_Movies(myAPI).data.movies;


        }


    }
01:15
code style nag: avoid large vertical space, IOW don't put more than one return between the lines
            My_Movies = Data_Movie.Get_All_Movies(myAPI).data.movies;
            // <---- questionable
            // <---- waay too many
        }
well
what else ?
I think the Names_With_Underscores naming convention was already questioned by someone else, but I'll repeat this: given the style commonly used by C# programmers, your Data_Movie would be rather named DataMovie
and so the method name Get_All_Movies would be GetAllMovies instead
i did not used inotify cuz i do not need it on my app
your Data_Movie class basically only contains static methods, but there are common parameters that you pass to every method (that is, the address of the API), which means it's likely to contain shared state, so they would rather be contained in the class as private fields, which you can access from the non-static methods
and the instance of the class would be crated in the MoviesListViewModel
still, if you're going with the "all static methods" approach, you could make your class static and remove that useless constructor
i did not understand the first thing you said
i am sorry i know i am idiot. but can you explain it more easy
01:27
Have you read this?
4 hours ago, by milleniumbug
https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/classes-and-object‌​s
still
i started to learn OOP from scratch.
again.
i know that you are refearing to the func/methods . do you want me to set the page id to private parameter on the class
your Get_All_Movies and Get_Movie accept string page_num and string Movie_ID respectively (let's set aside that the proper naming convention would be pageNum and movieId), but they're numeric parameters
aha
got you.
they are ints but the json return them as string
and i did not want to use .toString() for each one so i thought that was better
yeah no
it doesn't return them as string
I've ran a query just now
"id":6621 <--- seems to be a number
for a movie id
01:35
that said, don't concatenate strings to get a HTTP query string
use the programmatic interface for creating HTTP queries, HttpClient definitely supports that, not sure if WebClient does
but the former one seems to be recommended over the latter for HTTP
aha
a little question
let's assume that my application is the admin panel for yts ok ? if i want to make a realtime instant change for example changing the name of the movie from x to y like InotifyProp...
in general, don't concatenate strings to make a string in some language (like: don't concatenate strings to get a SQL query, or else you'll have SQL injections, don't concatenate strings to get a HTML page, or else you'll have XSS vulnerability, don't concatenate strings to get a HTTP query, there's probably a vulnerability for that too)
wow this my first time to know this
what is the best programatic interface for that ?
about my previous question . how to make InotifyProp change the DB and the UI in the same time ?
BrB it's Fajr Praying time. i will perform my prayer and back to you master.
01:59
wow .NET support for such things isn't obvious, that's bad
? an http query is a string
why not use string operations to create it
if you are worried about vulnerabilities or whatever, it's not string operators that you need to be concerned with
sql query is also "a string"
also, this is the client side we are talking about
the server should be the one worrying about that sort of thing primarily
normally a http client class would support get query building out of the box, so you wouldn't even think about creating a string manually, oh well
I guess you need to worry about URL encoding your strings
yes, that is the main concern
for eg, i use restsharp with my XF project
you can even see on the example page that a query request is just a string
if you are making any kind of serious app, you would wrap the actual making of the requests in some kind of class that builds out your requests for you
but in the end, its just strings
02:11
well .
you should be using HttpClient, that is the standard
and you should only create one HttpClient and use it everywhere throughout your app
for my level as a very beginner what should i learn next ?
I'd take DOM tree building over concatenating strings for creating a HTML response any day
paging/sorting/filtering
HttpClient is like a class that contain all method for doing th loading stuff but with protected ways right ?
02:13
i dont remember the difference exactly, just that its the one you are supposed to use
ok.
about the question i asked before
OnPropertyChanged with realtime changes between database and my UI
@milleniumbug a dom tree is an actual complex structure
a url string is just a dictionary<string, string>
@A.Hussainy i use github.com/Fody/PropertyChanged, i create a method like OnMyPropertyChanged(), and trigger a database update when it is called
ok.
for moving to web apps is it better to learn asp.net MVC 5 before Asp core
or just look for asp core tuts ?
i only know web api stuff
cant make a website to save my ass
does Xamarin development like UWP and WPF ?
02:25
i havent done UWP but it is like WPF
i learned UWP before WPF actually from bob tabur series
i learned there the basics of xaml and containers.
@Julien And yet I won't be able to be 100% sure if I have done it correctly (seeing the answers on that page, I imagine these people haven't either). Sure, given a lack of programmatic interface, I'll urlencode my strings manually, but I see no reason not to use one if it exists.
And given that I don't see a simple one that's builtin and gets it correct, I'm slightly disappointed, but I'll accept that and move on with my life
02:57
guys is it possible to use api like what i used from yts
but from Onion site ?
 
4 hours later…
06:35
Morning.
06:59
morning
07:33
morning
07:58
morning
 
2 hours later…
10:05
morning guys
morning, is that possible to pass static resource as an x:Arguments to the constructor?
 
2 hours later…
11:52
Hi all
Morning Alex
Afternoon to earlier birds :)
12:14
'morning
'afternoon Europe & Asia
Morning
12:29
waves it's going to be a monday, that's for sure!
yep, but I brought donuts to ward off the evil spirits
Oh, and the coffee's done dripping!
those sound good...however the whole trying to lose weight + eating donuts thing don't go well together. Especially since i didn't bring a lunch and i'll be eating lunch out today :(
 
2 hours later…
14:23
So if I have a hex string "ff 00 05 06 BB AC AD" and I want just the "05 06 BB AC" portion (and the rest can be a random number of "trash" at the beginning" how can I do that?
Can't really use substring since i don't know the number of bytes before and after
find the position of the bytes you're interested in, extract what you need
@biggidvs could also use linq... bytes[].SkipUntil(x => x.IsStartingByte).TakeUntil(x => x.IsEndingByte)
never used linq before. do i need anything special for it? i'm game for learning today
erm.. linq is.. just IEnumerable Extension methods from c# 3.0 era
also keep in mind, this is in a string for now, i can convert to a byte array if i need to
14:29
namespace System.Linq
if you really have no idea, you're missing out on hugely powerful collection of extension methods
yup i got it, and honestly nope, i had not used it before
linq is generic -- i assumed you have bytes.. it'll work just as well on string
(its collection of characters after all)
tbh tho, this is my first major software project i've done that wasn't embedded
i've done little winforms things here and there, but nothing on this scale
linq101 - is samples.. may not be as helpful
you can probably skip through a lot of that getting started stuff
only thing is i can't find the skipuntil in the linq namespace
14:35
it might be coming from System.Interactive nuget
it was originally part of System.Reactive - and was then backported
gotcha, i'll take a look into it
yea that's what i saw
it still shows the system.reactive.linq namespace on msdn
SkipWhile.. that's the IEnumerable one
SkipUntil is reactive version
TakeWhile as well for IEnumerable
Reference set of extensions: msdn.microsoft.com/en-us/library/…
user8265110
14:48
What do you guys use to create setup installer for your apps ?
Hi guys
Below is my sql query :
select * from Table where col1=@param1 and col2=@param2
Now i want to remove all @ parameters from this sql query
So final query should be like below :
select * from Table
So instead of splitting my query from where and then having 2 string
Is there any better way to do this?
15:13
When you say "splitting"... do you mean reusing the same string?
I'd just make two strings...
concat together for the one that needs the latter half.
I don't really get the question.. but perhaps IN sql operator can help
How did the expression thing turn out?
i'm stuck on it
I cannot figure out how to deal with child "table"
Persons.SelectMany(x => x.Children) -- that kinda thing, except children can't be accessed without a parent id
i was literally just thinking about how to do this
15:24
@SteveHémond SetupBuilder
did you mean SelectMany?
yea many - thanks
@Maverik How would you access it in raw sql?
access what?
it'd translate to htp://site/api/People/{ParentId}/Children
is it the same thing?
15:29
yea the one i started several weeks ago
That looks more like people[id].Children
i then got stuck and some other stuff came up
yea you could index this stuff technically via rest api
but you won't do that in linq
16:28
you need some sort of relationship between a column property in Persons and Children, no ?
yea.. but i already have it (though one way Parent->Children)
the problem is getting hold of it in Expression parsing
if i have a string and want to divide it into say an 8 byte and a remaining section substrings, how would one do that?
string.split won't do what i want. I have a specific byte count to split at, not a delimiter
.take ?
"Expression".Take(5) -> "Expre"
erm actually Substring(5) will do too
take(5) won't do exactly what you want (it'll return a collection that'll need to be collated back)
one char is 2 bytes
first 4 chars = 8 bytes?
16:31
that depends on what hes dealing with
gotta remember hes doing this stuff over raw com ports
i have an 8 byte section i want to pull off as a packet header
i strongly doubt he's getting unicode there
then i want the rest of the message (can vary) into another
ah. yeah. probably.
i'm getting binary thats converted to hex
but all that's already working
16:32
biggi this is sounding like like something you could use binaryserializer for
do you have fixed packet length?
of course not :D
i have like 10 different 'types' of messages
each varies in length
i'd really handle all of this in streaming mode and compose chunks as i go
StreamedBytes.Take(8) -> figure out what we have.. pull more from stream accordingly
i just use a datareceived handler, get it to hex and then start chopping away
well
16:34
whats the event arg in there?
datareceivedhandler -> temp buffer -> check to see if it's good (all there) -> take more if we need it -> start chopping
private async void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
I wish you were doing reactive extensions
you have such a typical case for it
i don't know what that means
(and it could use DataRecieved event to feed you data)
yea i know..
nor has anyone told me about them before
16:35
its got its own learning curve so i won't suggest you dig into it
again...degree is in electrical engineering ;)
probably because of what i just said
again: wrong person for the job :P
i'm not disagreeing at all
i know :)
but it's what they gave me to do, so i'm going to do the best i possibly can
16:36
your current level of exposure limits our suggestions
if lynn had been doing this, i'd have told him to just .Buffer and go from there
so the only problem with substring is the whole "varying length" thing. So i know my header size, but that's it, the rest could be anywhere from like 6 to 32 bytes
but of course that won't make any real sense to you since you don't have foundation in RX yet (which requires a solid grasp of LINQ first)
ok so yes back to problem
umm let me see what you're getting in event
16:38
i need to see msdn
hes manually buffering it already
int numberBytes = sp.BytesToRead;
                byte[] buffer = new byte[numberBytes];
                sp.Read(buffer, 0, numberBytes);
                string[] buffer_str = Array.ConvertAll<byte, string>(buffer, holdByte => holdByte.ToString("X2"));
                string fullResult = string.Join(" ", buffer_str);
reading in the buffer length, reading buffer and storing it, converting to hex, joining the array into a string
then parsing
if you have 8 byte header - why not just preprocess that? I'm assuming your length is at a fixed spot?
What is the question again? How to get the first N "bytes" of the string (so x2 for characters)? Doing all that via string manipulation is a little odd anyways...
becuase in my datareceived i'm just bringing data in. i wanted to do all the parsing (and splitting the header off) in the parse function to keep it clean
16:42
i'd disagree with that
but i'll let Bradley take the lead here
biggi, did you run across the scenario where that event may be fired multiple times for a single "receive"
disagree with parsing binary via strings?
kevin: no
that too biggi - but just processing whole thing in one go then chopping
a system can call "Send" once, and it may trigger multiple events on your end.
16:44
it's really one way communication
i'm always receiving, never sending
not sure if it'll happen to you, but i've seen it before. so if you start getting weird behavior, look into it
and even if i receive the same thing twice, it wont' matter on my end
i know, receiving is the issue
not sure i get what you're saying.
I think he is just saying that a single packet may require multiple event handles
16:44
oh yes
i've accounted for that
ight, good
i have another buffer in my parse function that checks to see if it's a "full message" or not
if it's not, then it waits for datareceived to hit again, appends it to the second buffer, then parses
or even if it takes 5 events, that's fine too
...that's what you meant right?
i think lol
but ultimately your call
if something seems broken, it may be a place to look, thats all i'm saying
so bradley, the question i had is, i have a return message "AA AB FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 DD" where AA AB is my start of message, the FF's are the header and the 00's can be any byte count then DD is the end of transmission
yup, and i have a comment in code reminding me of that ;) thank you for the input
so i want to pull the header out into one substring (there's info there i need) then the 00's into another string so i can see more
There's a byte that shows the message type, so then i can see what data i need to pull from where
I would use Take, like Mav suggested
or switch(msg[3]) with cases
16:49
thats gonna get pretty ugly i'd say
since he's dealing with variable lengths
well with message types you know what kinda message it is
if message type 0 is always 14 bytes, and message type 1 is always 50 bytes
i did ask this question too: is the length of message in some fixed spot in header?
yes and theoretically i know how long each would be, but i have to be worried with drop packets
CRC check first
i'd love to fiddle with this.. is there a way to mock serialport input?
16:51
yes the payload byte count is in a fixed spot in the header
yup, i'm trying that. bad thing is (and it doesn't much matter for the help i'm needing) but this is also wireless...
or length or whatever... check integrity before you parse it
so the checksum is very importatn for me
yup
i already have that taken care of
Skip and Take biggi
Take(x) to get header
extract byte count
Skip(x).Take(count) to get payload
that should work
damn @Maverik do you remember that site where we did LINQ challeneges.
16:55
yea if this was hardwired, i'd be so much happier...
I feel biggi would love that site
sort of rings a bell
was that the microsoft's code challenge one?
could be...
biggi needs to get comfortable with basic linq operators before he can go to that site - at this point he'll hate it :D
that site is kinda how i learned. you get the challenges and are basically forced to learn the operators lol
16:59
:)
Of course there's a way to mock serial input :)
you have to interface out the serial port and build a mock or use something like NSubstitute
but I agree with the comments above.
I would say that you should deal with binary until the string representation actually matters
writing `test == "FF" is pretty silly
yup, i'm actually having docklight send packets that are the same as what i'm expecting
;)
Not exactly the same; you can't run unit tests against a true simulator
...i liked sijulator better
made me laugh
        IEnumerable<char> headerMessage = ParsedMessage.Take(16);
        Debug.Print(headerMessage.ToString("X2");
so it wont' let me do this to debug print...any idea why? Says "No overload for method 'ToString' takes 1 arg"
i have a Slider with ToolTipService.Placement="Mouse"
i'd like the slider to show the value the mouse cursor is representing in the tooltip
how can i do this?
17:12
hint: return type of Take I think.
yeah
you're trying to ToString an entire collection biggi
String.Join(" ", headerMessage.Select(o => o.ToString("X2")))
gotcha, i had just looked up above, had that issue before. going binary -> hex then manipulating isn't a lot of fun
hmm Kevin, that throws an error too "cannot convert from 'string' to 'System.IFormatProvider"
That should have worked
what is the type of headerMessage?
oh; IEnumerable<char>
why is it not IEnumerable<byte>?
This is why parsing into hex strings is a bad idea...
yea i'm working on somethign different, this is going to get heavy quick
17:27
I'm guessing your thing is breaking because "X2" is not a valid format string for a char
so in my data recevied handler, i have a string array
i think i'm going to try to use that
Also pretty odd.... considering you seem to be using a binary protocol
not really, it's super confusing
on the target end, it does everything in hex, converts to binary then sends out
dunno why
That... is exceptionally odd
i agree
the guy that did that isn't here anymore...so i'm trying to figure out the best way to work with what i have
17:30
my manager wrote a protocol spec like that -_-
so i can read in the binary easily
then i convert the binary array to a string array so i can see the hex
now just trying to parse the hex string array
>.<
see now you're starting to understand...as mav said, wrong person for the job (i was told to do it unfortunately) then i'm working with very (very) odd stuff
If it were me I would parse the original message into something sane (not a hex string) and unit test the hell out of the class doing the conversion
then you can treat it like a normal protocol and stop dealing with all the string manipulation
17:50
^ thats exactly how i'd do it too
when you have shit input - only bring it into minimum sane area to work with it.. don't do more than that or you end up with what you have right now.. the back and forth
00:00 - 18:0018:00 - 00:00

« first day (1725 days earlier)      last day (2424 days later) »