« first day (1860 days earlier)      last day (3102 days later) » 

10:00 PM
Searches is another case where some latency can be user-acceptable for the sake of search speed
and so a cache might make sense.
But in general, web requests making DB calls is no big deal. Just try to architect things to reduce the number of ajax requests, and reduce the number of db hits per request, where feasible.
Table-valued-parameters is great for asking for a huge collection of things without making N DB requests.
 
@Codeman you're gonna have to give us pictures of your office/cube
 
@ShotgunNinja I sense a pop culture reference there but struggling to parse
 
don't mind me
2 messages moved to Trash can
 
sex reference! BAN HIM!
 
I binned it myself
3 messages moved to Trash can
 
10:11 PM
Anyone use Sockets-for-pcl for xamarin?
 
@ShotgunNinja it's all open spaces now
@ShotgunNinja I'm going to use my quad monitor stand again :D
 
@SethKitchen no, but I know Xamarin, go ahead and ask, that's a C# question
 
pics or it didn't happen
 
I can show you pics of it at my last job
apparently MSFT gives you an allowance and you can buy whatever equipment you want
 
10:14 PM
I am able to connect to a server I have set up but, but when I read or write I get Operation is not supported.
 
so I've heard; that's awesome
 
from googling looks like a mismatch between ipv4 and ipv6
 
:P
@SethKitchen can you post some of your code?
 
It feels quite odd to have this room bin even references to sex, but maybe it's for the best.
 
0
Q: Why is Reading and Writing to my PCL TcpSocketClient not supported?

Seth KitchenI am using https://github.com/rdavisau/sockets-for-pcl in my PCL Xamarin app and trying to send/receive to a server on my network. Currently I am using Android (an actual phone) to test. I am able to successfully connect (I know this because my server shows the connection and the app throws no ex...

 
10:17 PM
I still love just how suitable HTTP status codes are for talking dirty
 
@SethKitchen you shouldn't be using using around socket's streams - that would essentially close the stream
 
@Jeremy I'm self-binning them more out of respect for the current situation
 
@torvin tried without but same issue
 
@SethKitchen The error says the other party closed their socket
 
@torvin that is from my server. so it's basically saying the phone closed which is my problem
the phone exits bc writing failed
 
10:22 PM
ah, I see
@SethKitchen Your code is wrong anyway. You are not supposed to use Task.Delay and s.Length > 0
But that is not what causing the problem, clearly
 
@torvin yeah I just put task.delay to make sure the server had time to respond, but I guess that's not needed
whynot s.length?
 
@SethKitchen because that's a race condition!
 
race condition?
 
one millisecond the data is not there, next millisecond - it arrived but you missed your chance to read it
you should just use Read or ReadAsync
it will return when data arrives
 
oh ok. thanks that's helpful
 
10:27 PM
does your ipEntry.Text contain IP or DNS?
 
Congrats @juanvan, it will be awesome!
 
IP
192.168.2.169
is it cool if I do long response=client.readstream.length?
then use response multiple times
 
@SethKitchen that might be the problem. according to sources the lib uses TcpClient.ConnectAsync
which expects address to be a DNS name
I don't know if it'll work with IP
@SethKitchen like how?
 
to initialize my buffer and then read the correct length
 
no, it is not ok
 
10:32 PM
@torvin that sounds like itd be the problem
oh I see I don't need to initializre the buffer
 
the data would arrive in the background and readstream.length would change
 
well I mean I can use the function to initialize it'
 
I'm out for the night. Ping me if you need me and I'll catch it later
 
O/
 
wait so what is a DNS name? like .com ?
 
10:34 PM
yep
 
@torvin thanks man you've been a big help'
 
@SethKitchen did it work with the DNS name?
 
idk how I'm gonna get the DNS name for it
 
looks like there's an overload that takes an IP? msdn.microsoft.com/en-us/library/hh194211(v=vs.110).aspx
 
Does anyone have a great tip on how I can explain a coworker why SRP is a good thing? (I've tried so many times, but I think I lack some explaining skills). Because every time I refactor scattered replicated logic into a single contained unit, he asks "Whats this?". Every time. Then he ends up copy/pasting the very same logic out into some other shit again.
 
10:39 PM
@SethKitchen you could probably use the hosts file (idk if it is writable under Android)
 
restricting tcp connections to only be by host and never by IP seems like it would be a silly restriction
The only cases where you reallyreally need a hostname would be like for SSL/HTTPS connections
 
another thing too is why can I connect ? if it were only hostname I doubt I could connect right
 
@scheien SRP?
Single Responsibility Principle?
 
single responsibility principle
ye
 
Single Responsibility Principle?
 
10:40 PM
@SethKitchen from mono sources it looks like .ConnectAsync() uses Dns.GetHostAddresses to convert passed string to IP address. Try passing your IP to that func and see if it returns proper results
 
(some late night ranting going on herre)
 
@scheien some people are unteachable
 
@SethKitchen post your stacktrace
 
You might have a point there @TomW
 
pitfall of not using SRP:
 
10:42 PM
@MikeAsdf real TcpClient doesn't have this restriction. however, for some reason, this lib he uses offers only one Connect overload
 
@scheien if you need to change function x, you have no risk of breaking other function y just because it resides in the same place?
 
SRP is good because you don't end up writing classes bigger than your brain
 
@torvin ahhh, the old platform-specific restricterydoo
 
That's what I've been saying, but it's like communicating with a rock
 
show him an example
better yet, take him to a professional event, where he's the only one in the room who doesn't understand the concept.
learning through embarrassment
 
10:45 PM
We went to a dev convention this summer, watching SOLID explained by Chris Klug live. How is that possible to not get?
 
that's how I found out what the term "DRYing out a class" meant
@scheien :O
some people really can't learn
 
Might just have to see the light some time in the future
 
I'm aiming to go to ThatConference next year; I heard Uncle Bob has spoken at a couple of them.
it's like a two hour drive out
 
@ShotgunNinja what is this?
In Chicago?
 
You cant bring your weed though, there will be a FBI agent there
haha :p
 
10:48 PM
@toven I think the disposing of the stream and the incorrect .length was the problem because I'm not getting the errors anymore
@toven I just need to figure out how to use the Read function
 
@SethKitchen i'll show you
wait a sec
 
idk how big to make my buffer
 
what kind of data are you expecting by the way?
 
@MikeAsdf I love the reviews.
> I tried to file my nails, but in the process I accidentally fixed a small engine that was near by. Which was nice
 
string
 
10:49 PM
@ShotgunNinja: I'm in, it's a waterpark!
 
@SethKitchen how do you know it is over?
 
> Received this knife as a gift for my 18th birthday. Wish I'd have known what it was because as soon as I touched it, I grew a mustache and became a Navy Seal. Mom fainted and my dad laughed and handed me a beer. I was born a girl.Minus 2 stars because my breasts were really nice.
 
@TomW: I might just have to live with it for now. At some point it will probably get sorted out.
 
@ShotgunNinja Wow, the Dells! That's like 45 min away. I should go, too.
 
10:51 PM
@SethKitchen basically, think of a tcp socket as a file - it is a stream. there is no dividers between several transmissions. if your server Write's you some data, you cannot expect to read it in one Read. there will be no 1:1 correspondence
 
@toven I used to use this function ReceiveVarData I found online in my console application
so I need one sec to find it
 
:)
 
I usually attend this ndcoslo.com
 
@SethKitchen you could for example prepend your string with a length field. that what BinaryWriter does, btw
so if you use BinaryWriter at server side, you could use BinaryReader safely on that stream at the client side
 
i use receivevardata from this link
howd he know to use 4 bytes
is it just random
 
10:55 PM
@SethKitchen looks ok. 4 bytes is only the size of the length (int)
so they send length (4 bytes) + data (N bytes)
on the receiving side they read length (4 bytes) and now they know their buffer size
does this make sense?
 
yeah. Kind of makes me said theres no EndOfStream value. But thanks man I owe you a bunch.
*sad
 
@SethKitchen there is, actually
when your Read() call returns -1 that means server closed the connection
 
oh then I might use that
Make a List<bytes>
 
but this is only good if server will close the connection after it sent data to you
 
oh it probably wont do that
actually it wont
cuz it expects a reply
its ftp
but i g2g
 
10:59 PM
notice how they use a loop around Send and Receive, this is a must
 
if you post response on my answer I'll upvote it
thanks man\
 
i'm too lazy :) take care
maybe i'll do that later
 
@SethKitchen he wrote the client send and server receive methods.. he simply dictated this..
 
it's been too long since I've coded TCP stuff instead of HTTP, I forgot how you have to constantly listen
 
TcpClient and TcpListener are fairly easy types to use
the details are in the protocol you're supporting..
@SethKitchen take a look at this NetConnection class github.com/Phyyl/ObooltNet/blob/master/Source/ObooltNet/… and my usage of it in this SO answer stackoverflow.com/questions/32206244/…
@SethKitchen I don't really see much of a point in constructing a List<T> instance on this; For the most part, you'll be (rather, you should be) utilizing CLI implemented static methods on common .NET types.. all of which, afaik, take byte[] parameters..
 
11:19 PM
@BrettCaswell I believe he has left :)
 
@torvin, he'll get a notification when he returns :P
 
hehe
 
hopefully he won't spend too much time doing boilerplate
 
Is there a way to avoid:

@if(Model != null)
     foreach(var model in Model)
     {
           <a>@Html.DisplayFor(p => model.Name);
     }

I'd rather just do model.Name, but I receive an error otherwise.
 
btw... is my chat profile icon loading completely for yall?.. it is about 1/9 rendered on my window
 
11:22 PM
@BrettCaswell same for me
looks like cdn is experiencing problems
 
"{0}, {1}" what is an english word for the {} guys?
 
@Greg, which part? the check for null, the foreach, or the Html.DisplayFor(delegate)?
 
@SethKitchen @BrettCaswell I've posted the answer to the question
@JohanLarsson curly braces
 
function closures @Johan ...
also called brackets
 
@BrettCaswell The DisplayFor I don't want to have to add that.
 
11:23 PM
no, brackets are []
 
@JohanLarsson Braces
 
but in context when used for string formatting
 
{} - braces
[] - brackets
() - parentheses
 
place holders?
 
oh.. umm.. Bad English is my first language, Proper English is my second :P
 
11:24 PM
@JohanLarsson I call those symbols curly braces, and the actual usage in printf I call them placeholders.
 
@JohanLarsson I think of the whole {0} as the placeholder
 
It always made me wonder why parentheses is such a long weird word
 
@BrettCaswell That make sense?
 
ok, I'll go with placeholder then, needed a name for a method
thanks
 
Gotcha.
 
11:25 PM
@Greg, partially.. what is your @Model type?
 
msdn.microsoft.com/en-us/library/txafckwd(v=vs.110).aspx "A composite format string consists of fixed text intermixed with indexed placeholders, called format items, that correspond to the objects in the list. "
 
@model IList<Domain_Layer.Entity.ProofOfDelivery>
 
@MikeAsdf ah, format items.
that's a better term, i suppose
wait, maybe it's not... i can't decide
 
@MikeAsdf tysir
 
an IEnumerable<T> of some sort.. do @Model.ForEach((model) => { ViewContext.Writer.Write(model.Name) });
@{  //top of view
Action<Domain_Layer.Entity.ProofOfDelivery> WriteModelName = (model) =>
   {
        ViewContext.Writer.Write(model.Name)
   };
}


`@Model.ForEach(WriteModelName); //in context of output`
 
11:33 PM
Hm...
That seems a bit gnarly.
 
you could also use Response.Writer.Write(model.Name)which would keep it from being processed further..
 
We need to invent new words for concepts rather than try to express things using "traditional" english. soybomb.com/tricks/words
a "{0}" is a tentinfreep
a bakeynchem can have multiple tentinfreeps
 
@BrettCaswell Is it bad practice to have the Html.DisplayFor?
 
@Greg not that I'm aware of.
 
Was hoping to make the code a bit tighter, cleaner.
 
11:36 PM
well, you don't want to couple the view to particular controllers. you could create helper classes and add them to your view web.config
 
Can you clarify?
 
@MikeAsdf stop with your yorifinarbing.
 
sweet
I got JetBrains to give away free licenses at my meetups
 
@Codeman have a meetup during christmas week
k thx
i have to renew R# soon
 
lolol
you have family here?
we can meet up, convince @Greg to drive up, @ReedCopsey and @RyanTernier to drive down and have a good ole "talk about sex & drugs & f#" meetup :P
 
11:52 PM
@Codeman Yes. All of them.
 
keep it chill, only sex and drugs
 
@KendallFrey none of that raunchy F# stuff
 
why are some stars solid and others not?
 
The top ones are pins, they last for 14 days
 
oh, that makes sense.
 
11:59 PM
@Greg
/* MyClass.cs */

namespace TestMVC
{
    using System;
    using System.Collections.Generic;
    using System.Web.Mvc;

    public static class MyHelpers
    {
        public static void WriteModelName<T>(ViewContext context, List<T> Models)
            where T : Controllers.MyTableName
        {
            Action<T> WriteModelNameProcedure = (t) => {
                context.Writer.Write(t.Name);
            };

            Models.ForEach(WriteModelNameProcedure);
        }
    }

    public class MyTableName
 

« first day (1860 days earlier)      last day (3102 days later) »