« first day (2951 days earlier)      last day (2223 days later) » 

03:26
G'Afternoon!
Its still morning
l0l.. here's already 12:30 pm
Oh, KST has 1 hour ahead..
this is message from the future.
03:43
It's still Monday here ;0)
03:53
if then, you must be send message from the past.
THE REAL PAST.
mr5
mr5
04:13
I finally found a case where I really need to use goto
looks like pointer?
Usually I use that when I played Ultima Online with EasyUO
@mr5 Still not necessary, you can just use any other method than switch
Thus, switch is not suitable in your case. Imagine you may add further codes and logics in future.
The reason of usage of goto is only one: inside deep loop.
Hmmm...Maybe I have another reason..
mr5
mr5
@nyconing I'm designing an app prototype where it asks users some questions. I figure out this can easily be done using switch statement where it can handle multiple branches since human answers varied widely
although I am starting to see the flaw of this approach
04:33
Yeah I didnt know why keeping switching firstAnswer.Answer.. This indicates your logic flow is based on answer and then question.
You may creates a QuestionRoute class
So you dont need to re-writing all of logic when you add another "questions branch" in future..
Just a suggestion.
interface IQuestion{ string QuestionString(); IQuestion Positive(); IQuestion Negative(); IQuestion Neutral(); }
With this interface, the answered question given another question.
So you can creating a QuestionRoute
class QuestionRoute { public IQuestion TheQuestion; }
class Question:IQuestion { public Question(IQuestion positive,IQuestion negative,IQuestion neutual){...} }
new QuestionRoute{
   TheQuestion = new Question(
      new Question(...),
      null,
      new Question(...)
   )
}
new QuestionRoute{
   TheQuestion = new Question(
      new Question(
         new Question(...),
         null,
         new Question(...)
      ),
      null,
      new Question(...)
   )
}
mr5
mr5
04:48
Here's my temporary model for it
The problem with this model is it can't handle branching of questions
Do you think your model can do that?
This is machanism you can archiving more than switch. Such as Question jump, Question back and End Question. (Result: IQuestion)
@mr5 Yeah if the Answer itself can given a new Question then youre good to go..
posted on November 14, 2018 by Scott Hanselman

I've posted several times on the Windows Subsystem for Linux that allows you to run Linux on Windows 10 without a VM. Check out my YouTube on Editing code and files on Windows Subsystem for Linux on Windows 10. There's just one rule. You can mess with Windows files from Linux but you can't mess with Linux files from Windows. Otherwise, go crazy and enjoy. Here's some of my previous posts you sh

Pre initialize the QuestionAndAnswer If this question may re-asked. And point to this question inside Answer
Then you dont have to stuck with switch any more..
mr5
mr5
@nyconing yes that's what I did
 
2 hours later…
06:43
ohayou
mr5
mr5
"1 burger, 2 large fries and 1 coke"
how can I effectively group this order into items?
preferably: [ "1 burger", "2 large fries and", "1 coke"];?
{ "Burger", "Coke", "Large Fries", "Large Fries" }
{ Burger:1, Coke:1, LargeFries:2 }
mr5
mr5
it's a text
I need to parse it to become a solid object
06:59
.Trim()
..Split(",")
..Split("and")
1(Number)/Burger(Noun)/2(Number)/Large(Adjective)/Fries(Noun)/1(Number)/Coke(Nou‌​n)
mr5
mr5
supposedly, the comma and the word "and" may or may not appear in a sentence?
why don't you use twitter api?
mr5
mr5
@Arphile can you give me a link to the actual API?
maybe this will help you I think..
07:12
good morning
07:25
hi
07:43
Oh hai
08:02
˚λ
Degree Lambda?
Good morning :)
@mr5 Are you doing NLP? Get a NLP library!
I used CoreNLP with great success.
@RoelvanUden If he's grouping the "and" into "2 large fries", he's not really doing any meaningful NLP.
@AvnerShahar-Kashtan more like incomplete butt with a big wart on it => (˚λ )
08:04
@AvnerShahar-Kashtan If it's free-form input, it's going to be a hassle without NLP
Is NLP neurolinguistic programming here?
:44559739 var listSeparators = new string[] {",", "and", "as well as"};
var order = rawOrder.Split(listSeparators).Select(s => s.Trim());
@SebastianL Natural Language Processing.
@RoelvanUden NLP is a big field. A lot of NLP is about hand-crafting common lists of tokens and separators and applying them to the text.
Just like a lot of Entity Extraction is preparing long lists of, say, common honorifics ("Mr", "Mr.", "Mister", "Ms.", "Ms", etc) and applying regexes to the text to extract the strings that follow the honorific as a Person in the text.
NLP can be very disappointing when you start to delve into it. :)
mr5
mr5
@RoelvanUden I don't know if it's NLP
| |< |\| 0 \/\/.
@AvnerShahar-Kashtan totally agree this. so I use developed NLP.
mr5
mr5
Basically, I'm doing TTS and STT for a voice-only ordering system
08:14
@mr5 Are you parsing an English string and trying to parse it based on english grammar and usage? If so, you're doing NLP. Primitive NLP, maybe, but NLP.
But yes, as @RoelvanUden says, you might be better off finding a free to use NLP tokenizer library which can split your text using smarter rules than the one I suggested above.
@mr5 but in this case, Speech to text need to analyze what actually it requests to do something.
mr5
mr5
@AvnerShahar-Kashtan this is just a prototype. we might use an NLP library in the future or better used an existing AI like siri, cortana, google assistant
or an ML
we still don't know which tools we are going to use
@Arphile yes. but for now, it's designed specifically for ordering limited items only
like me
hehe..
Server server = sender as Server;
server.Received++;
Console.WriteLine( String.Format( "Server[{0}] Received => {1}", server.IdxNo, server.Received ) );

String Recv = Regex.Replace( e.Message, "\0", "" );
String[] Array = Recv.Split( Common.Splitter );

Protocol Ptcl = GetProtocol( Array[0] );

bool PrintMessage = false;
switch ( Ptcl )
{
blah blah...
@AvnerShahar-Kashtan Yeah. Standford's CoreNLP does provide a huge staggering list of English grammar and vocabulary, including the non-past-tense of words and so forth. It makes life infinitely easier when dealing with free-form text.
I code this for bluetooth 1:1 chat and now it works wonderfully. I can move my mouse cursor with this. hehe...
mr5
mr5
08:23
This is fun ^^
STT still have many issues. I'm able to mitigate it by doing this
@mr5 "You're a burden, and i hope you get fried in hell!" => 1 burger + fries
bugger, beggar
public static String[] Burger = new String[]
{
"Burger", "Verger", "Murder"
};

if ( Burger.Contains("aaa" ) {
ProductTYpe = Products.Burger;
}
public static String[][] KnownItems = new String[][] {
Burger, blah, blah, blah...
};
mr5
mr5
@SebastianL that's it! :D :D
@RoelvanUden I had a team of two NLP researchers and developers many years ago, at a startup. They came from diametrically opposed schools of thought on NLP. One was "Write rules, rules, and more rules. Rules for each vertical. Rules for each domain. Rules for each customer. Only way to get good results".
08:28
more case makes more detail.
The other guy was all "No, we must create a learning algorithm, feed it all the training data. Training data for each vertical. Training data for each domain. Training data for each customer. Feed it, tweak it, and await its mighty results".
@AvnerShahar-Kashtan you can't tease us like that and don't tell us the result! Did they fight to death?
@SebastianL Well, the "rules rules rules" guy was an insufferable ass, the "unsupervised, unsupervised, unsupervised" guy was incapable of even conceiving an R&D task taking less than three months, and I ended up asking to quit as a team lead and return to be a simple developer because I didn't want the headache.
learning algorithm guy? He sounds scary
I see learning algorithms like reflection.. when no other solution will do, it's great..
@Neil a wild Learning algorithm guy approaches...
08:35
but when you're holding a hammer, everything looks like a nail
the rules guy seems like he's never heard the phrase "convention over configuration"
@Neil Learning algorithms are pretty much the mainstream in ML and AI these days, so I don't think that's necessarily a bad thing. But he was a recent graduate that never worked a day in his life and had no idea how things worked outside of a lab.
there's a place for everything of course
But throwing machine learning at a problem is like trying to seal a door by wrapping it in saran wrap
or using duck tape maybe would be more precise
might even work most of the time and sure, in some contexts, that's exactly what you need, but otherwise it's a hacky generic solution to a specific problem
@AvnerShahar-Kashtan Sounds like fun!
@Arphile He uses "Unsupervised learning", ... it's not very effective.
mr5
mr5
*it's not super effective
use Thunderbolt!
08:49
counter with USB-C
@Neil I think it was the right solution for the problem he was given, which was automatic document classification ("Contract", "Purchase Order", "HLD Document", etc) that should ideally have worked for multiple customers in multiple domains without too much per-client prep work.
It's just that he wasn't the right person for that.
@SebastianL I know this is not effective some ways but if I need to build an AI for specific features, it is nice considering spend times.
I think when it's supposed to remove hassle, machine learning is the right move.. it's not expected to make all the right decisions, but a good many yes
@Arphile it was a pokemon pun, nothing too serious :D
@SebastianL Oops. I thought it was targeted to AI dev.
lol...
sorry. my brain was busy for thinking.
I have 1 core. and this core has 2Threads. but it work as 1Thread.
09:14
just read that Hector got rejected because he asked for 22k/year. Thats fckng insane
Morning
did anyone heard of azure
just insane how low some wages are allowed to be (de.statista.com/statistik/daten/studie/37401/umfrage/… sorry for the german statistics, but you'll get the gist of it, €/hour)
mr5
mr5
@SebastianL holy shit $11.55/h
that's ₱5,544 which would take me weeks to get
depends on your culture I suppose
In italy, programmers are not considered much more than code monkeys
Not my personal opinion of course..
09:31
@mr5 what are your monthly living costs? (rent + food)
mr5
mr5
@SebastianL €5.55
here in Germany its around 800€ per month (and thats a low estimate)
@Mathematics Heard of Azure? The second largest cloud provider on the planet?
mr5
mr5
@SebastianL err wrong. it's my per day. monthly is ~€167
Azure, the 30-billion-dollar-per-quarter service from Microsoft, one of the world's largest technology and services companies?
09:41
Is there any better alternative to Task.WhenAll and Parallel.ForEach for maximum concurrency?
@AvnerShahar-Kashtan Never heard of it ;)
@Mathematics What's that?
@AmirNo-Family i'd say TPL is as good as it can get if you are working on a single machine
Fuck shitty SAAS providers who change details which break thigns randomly
@AmirNo-Family Sure, manual management. It's quite involved, but you can fine-tune your preferences that way.
09:46
I just want to be able to push the system resources CPU and RAM to its limits
@AmirNo-Family for production or for testing purposes?
and Parallel.ForEach is not great for what I want to achieve as it runs 8-10 Threads at the same time, I want way more than that
For production
I have a server with 4 x Quad Core Xeons and 128GB of RAM
and it will only run my program
but, I can't even consume 10% of the resources
Parallel.ForEach calculates the optimal concunrrency based on multiple factors
it isn't perfect, but it does quite a lot
if you have the time and you know you will always have a computing server like this you can attempt manual management
but i wouldn't advise this to anyone if the app is going to be distributed
@SebastianL could you please give me an example?
shall I use new Thread() or ThreadPool.QueueUserWorkItem() ?
for manual managing?
09:53
yes
that depends on your usecase, have you tried docs.microsoft.com/dotnet/api/…
?
@AmirNo-Family Are you sure your code is even CPU- or memory-bound? Maybe it's using 10% of resources because it's waiting for I/O.
It doesn't have any Disk IO
inside it, there are some HttpClient clients
but I guess that should be fine, right?
HttpClients are IO
Depends on how you use them.
10:02
It's connected to a 10Gbps server
yeah but latency =/= bandwidth
so HttpClients cannot be run at the same time?
http calls are I/O bound. You can have 128TB of RAM and 500 CPUs, but it won't matter if your app is waiting for network data to arrive, which is orders of magnitude slower than pure code.
Interesting
if possible try to get all data before you start computing
10:04
so there is no way to make a lot of HttpClient calls at the same time?
there is, but concurrency is not the solution here
i think
if you have to get a lot of data do it in one big chunk instead of 100 little pieces
What do you suggest then? Imagine I do need to make some Http calls at the same time and then process the data inside them. They are too many different Http calls as if I want to run them one by one and the process them, it will take ages and also defeat the purpose of using concurrency.
i think this is an XY problem
what are you actually trying to achieve?
@AmirNo-Family If you want to squeeze absolute performance out of non-IO calls, make one or two threads per core (one for regular cores, two for hyper threading) and manually distribute pure CPU-based work over the already-prepared threads. That achieves the maximum throughput using your available resources. For IO calls, use the built-in thread stack (use Task and ContinueWith) and push the processing onto your manual thread stack.
But I need as many threads as possible
so one CPU core can only handle 1-2 threads at the same time?
10:10
@AmirNo-Family one cpucore
it's computer science theory, google process scheduling if you want to know more
That's bad then :-(
That's the basic idea. If you do pure CPU-based work, you'll be pushing the thread to its performance peak. That thread runs on one core, and one core only runs one thread at any given time (or two threads per core when you have hyper-threading cores). So having more threads than cores does nothing. Again, any IO-bound work should NOT BE ON THOSE PROCESSING THREADS.
That's the peak performance you'll get.
4x4 XeonCores + HyperThreading equal ~ 32 Threads
Admittedly, 32 threads running at 3.5GHZ or whatever IS FUCKING INSANE
thats not too shabby if you're not simulating physics
10:14
but it's not enough as there are 60,000 Tasks to be processed at the same time
Surely not 60.000 CPU-bound tasks.
I/O is a different story entirely.
how much cputime is one task consuming?
I guess my bottleneck is the HttpClient calls, can something be done about it to run concurrently?
@AmirNo-Family Run them on I/O completion ports. Beware though, hammering a server with 10.000 calls is likely to be seen as a DDoS
you can add loadbalancing
10:16
"Run them on I/O completion ports" Could you please elaborate?
@AmirNo-Family You should be able to google this one. Basically, you hand of the request to the OS and tell it "Yo, call me back when you're done with that shit." and get a signal when the OS is done. You're not consuming any thread or resource in your app meanwhile, and the OS optimizes the living fuck out of those I/O-bound calls.
Windows can easily do 10k i/o calls at the same time. Easily.
wow that's what I need!
I just don't know how to implement it
any example code?
No, no, no. You need to begin to understand threading, CPU-bound vs I/O-bound, and how to manage invocations and work distribution.
There is no cut/paste code for this.
I am not looking for CnP :-D
I just have a tight deadline so will be great to see some examples
You can google each individual aspect. The terms are:
thread work balancing (cpu-based)
i/o completion ports
asynchronous i/o
.net thread scheduler
and some event loop theory is good
10:20
such fast copy paste. Wow
But is it for Windows only?
My code will be running inside Mono on CentOS Linux
Linux doesn't have I/O completion ports. It has its own systems that I am unfamiliar with.
I'm sure they'll have an equivalent, and dotnet core should actually use them by default
probably.
(tip: on windows, it defaults to i/o completion ports for async i/o ops)
I am lost here
34
Q: Linux and I/O completion ports?

someguyUsing winsock, you can configure sockets or seperate I/O operations to "overlap". This means that calls to perform I/O are returned immediately, while the actual operations are completed asynchronously by separate worker threads. Winsock also provides "completion ports". From what I understand, ...

I am not using dotnet core at the minute so it has to be Mono .NET 4.6.1
10:38
@SebastianL Oh yeah, I remember libevent from years ago.
It's probably worth looking into.
10:58
I keep making stupid mistakes
I should be certified dumb
anybody know a good alternative for combobox with checklist for winforms projects?
listbox with custom UserControls in it?
wanna bind some data from a table to the combobox and some checkboxes are needed for the selection
sort of a multiple value selection in the combobox dropdown
11:29
@AdiMohan combobox + multiselect doesn't sound too intuitive to me
11:45
@SebastianL The idea is to have a dropdown and to have checking boxes that indicate that the item has been selected
@AdiMohan sure but wont the combobox collapse after selecting one entry?
 
2 hours later…
13:49
Please how can I maintain session when passing data from an external site to a return url in netcore mvc?
I'm writing a web app
But I noticed when I integrated with a payment gateway and i'm being redirected to the web app with response data, my partial views which use data from my session are not populated
14:43
Protip for you- dont use session
How can I know if it is better for my project to have tree structure exceptions
?
can anyone help me with this json?
{
	{
		"FacebookAuth:AppSecret": "xxxxxxxxxx",
		"AppId": "xxxxxxxxx"
	}, {
		"SendGridKey": "xxxxxxxxxxxxxxxxxxxxxxA",
		"SendGridUser": "xxxxxxxxxxxxxxxxxxxxxx"
	}
}
I don't understand the question.
14:46
I can't get out of this syntax error
@Riccardo you don't have keys for those objects
@MikeTheLiar I've got a syntax error
Error: Parse error on line 1:
{	{		"FacebookAuth:Ap
--^
Expecting 'STRING', '}', got '{'
i'm on JSON lint
Because you don't have keys for those objects
what do you mean?
I've got keys for sure
You just have two objects
14:51
hey the Xs stand for the keys
You need something like this
{
	"foo": {
		"FacebookAuthAppSecret": "xxxxxxxxxx",
		"AppId": "xxxxxxxxx"
	},
	"bar": {
		"SendGridKey": "xxxxxxxxxxxxxxxxxxxxxxA",
		"SendGridUser": "xxxxxxxxxxxxxxxxxxxxxx"
	}
}
Otherwise how the hell are you going to refer to those outer objects?
oh I tried that way but here I had null
public Task SendEmailAsync(string email, string subject, string message)
        {
            return Execute(Options.SendGridKey, subject, message, email);
        }
in this method the SendGridKey is NULL
That's an abrupt change in the nature of the problem at hand.
and this is the class where I define the SendGrid keys
public class AuthMessageSenderOptions
    {
        public string SendGridUser { get; set; }
        public string SendGridKey { get; set; }
    }
the AuthMessageSenderOption class is called by SendEmailAsync method
@MikeTheLiar
I don't fully understand the question
14:56
in the method SendEmailAsync I can't access the SendGridKey defined in AuthMessageSenderOption class
it returns null
so the email delivery fails
You haven't shown any code where Options is instantiated
services.AddSingleton<IEmailSender, EmailSender>();
            services.Configure<AuthMessageSenderOptions>(Configuration);
in Startup file I add the SendGrid service
for instatiate Options you mean this piece of code?
I'm going to suggest you back up and create an MCVE
wait a moment you said I didn't provide you any code where I instatiate Options
let me find where I instatiate it
public EmailSender(IOptions<AuthMessageSenderOptions> optionsAccessor)
{
Options = optionsAccessor.Value;
}
@MikeTheLiar this is where I instatiate Options
No it isn't.
15:01
why?
We're looking for a line that includes something like = new AuthMessageSenderOptions()
Because that's not instantiation, it's assignment.
well I followed a tutorial on MS docs
and I'm quite sure that AuthMessageSenderOptions is just assigned I've instatiated many objects but that has an assignment only
@QuicoLlinaresLlorens oof
is the instance mandatory?
lol yes
You have to have an instance of an object
Because otherwise you get a null reference exception.
15:03
so I haven't found it yet
wait
Put a breakpoint on the line that's throwing the exception
Then walk back up the stack and find where that object is instantiated
'I've already done it
the problem is that the SendGridKey is NULL
let me show you this class
public class AuthMessageSenderOptions
{
public string SendGridUser { get; set; }
public string SendGridKey { get; set; }
}
You've shown me that already
here I define two string but I don't instatiate nothing at all
and when I create the method to send the email asynchronouosly it calls that key
but somehow that key can't be accessed
It can't be accessed because the JSON you provided does not have a key
15:06
and I was thinking I had to have made some syntax errors
But that's irrelevant to the point of getting a null reference exception
I corrected the JSON according to your suggestions
Hence, my asking for a MCVE
what is MCVE
!!tell riccardo mcve
15:07
Model Controller View and?
@riccardo If you would like assistance, please create a Minimal, Complete, and Verifiable Example
never heard of it!
You learn something new every day.
I can show you the online tutorial
there is no instance
about that clas
click the link and scroll down till you find Implement IEmailSender
The configuration object is being created by the dependency injection provider, but the example JSON you gave is invalid, so I think it is probably ignoring the values and providing you a default object without its properties set
This tutorial is actually pretty bad
@Riccardo did you manually edit the secrets.json file created by the secrets tool? You can't do that.
What it looks like is that the configuration class is failing to bring in those extra properties from the secrets store because the JSON is malformed
15:40
Who won again?
One more small step to Clear Web 0.49
 
2 hours later…
17:28
posted on November 14, 2018 by ericlippert

I’ve often noted that “dynamic” in C# is just “object” with a funny hat on, but there are some subtleties to that. Here’s a little puzzle; see if you can figure it out. I’ll post the answer next time. Suppose … Continue reading →


« first day (2951 days earlier)      last day (2223 days later) »