« first day (1601 days earlier)      last day (3352 days later) » 

2:00 PM
@Squiggle a work around?
This is all for learning/hobby, I actually do landscaping 9-5 lol...
 
If you learn enough coding you can do it as a job without qualifications :)
Code qualifications are overrated anyway
 
@Sippy Easier said than done. First you need to get past HR.
 
Put keywords on your CV
Done
 
Well I'm in school for comp sci, but I'm doing general class/pre reqs before I get to touch a PC.
 
Lol
You make it sound like beginner code is gonna cause the PC to blow up or something xD
If you crash a PC it's not like crashing a car yo
 
2:13 PM
@Tokencodingnewbie BTW, it looks like it's happening so fast because you're only sleeping for 1/10th of a second there. 1000ms = 1 second.
 
@Tokencodingnewbie no, it prints everything as you expect, but it doesn't render it until the thread becomes free
You should be using a timer instead of Thread.Sleep
 
Okay, I'll look into timer.
 
19 mins ago, by Sippy
Timer
i dun gud?
 
@Sippy You should do your health & safety course
 
2:17 PM
@BenjaminDiele I accidentally deleted the email for the other one
 
public async void StartFight() //The actual turn based fighting part of the code.
        {

            while (_player.isFighting && !isDead())
            {

                int thisDamage = GetDamage();

                _monster.HP -= thisDamage;

                _game.SendTextToTextBox(Environment.NewLine + "You deal  " + thisDamage + "  damage to " + _monster.Name + Environment.NewLine);
                await Task.Delay(1000);

                if(!isDead()) //Check to see if the mob gets a chance to attack before death.
This seemed to work the way I wanted it to.
 
2:29 PM
Goddammit
I think I may have figured something out
and if I did, it was in the stupidest way
 
Let's hope you didn't figure anything out then
 
Shall we hope I did?
 
Let's not.
 
What did you figure out @KendallFrey?
 
2:32 PM
Something ETW-related
 
Thanks alot man. That's why I have never seen such pratices before. I had a suspicion but no final argument. — radbyx 2 mins ago
 
I just fucking lol'd so hard
@Steve
 
Alot man!
 
Well, regardless if what I figured out is useful...
I figured it out from a fucking comment in the source
no documentation, just a passing mention of the fact in a comment
 
2:36 PM
Warning	1	Could not copy "obj\Debug\SuperCoolRPG2.exe" to "bin\Debug\SuperCoolRPG2.exe". Beginning retry 1 in 1000ms. The process cannot access the file 'bin\Debug\SuperCoolRPG2.exe' because it is being used by another process.	SuperCoolRPG2
This has been happening a lot lately...
 
not even the code shows it
@Tokencodingnewbie It's normal. You could try restarting VS or rebooting
 
There's a nice little program which unlocks files
 
What helps is going into task manager and closing the supercoolrpg2 task that is hanging in the back ground.
 
!!google LockHunter
 
but lately I can hit debug once, then it will start doing this again until I close the background stuff.
 
Does anyone knows why F# is extremely slow on Linux?
 
RTM people, RTM
 
I cannot get more than 100MBps downloads with it, while with e.g. Groovy I am getting at 1GBps
...
 
doesnt sound like an f# problem
 
2:40 PM
Networking? Surely it can't really be slow? It's the same core as C#
 
Have you tried running your code in a different machine?
 
yes it works the same on every server
I have written the same part in Groovy, Java, PHP, Python, Ruby, C++, Erlang
and F#
 
Mono?
 
and F# is just the slowest
 
Does .net throttle?
 
2:42 PM
Mono 3.12
 
or possibly Mono
 
it takes 100% of CPU
 
does your code suck? (not trying to be a D)
2
 
100% CPU?! For networking? What?
 
On C# on 2012 server, the download is just slighty faster than with Ruby and slower than with Erlang
and on Linux it's slower than Erlang
 
2:43 PM
Why are you benchmarking network speeds...?
 
Roel van Uden: did you ever did web request or ftp transfer in C#?
 
Only all the time.
 
it is very slow on windows, but on linux it is extremely slow
Windows always takes 100% CPU
 
SLOW?!
"Talk is cheap. Show me the code." ;-)
 
"AppSetting variables have been moved to the database so that they’re easier to manage and setup"... said no one, ever. until a colleague said it today
 
2:44 PM
it's one of the most obvious truths about .net , just stop being in denial!!!
cmon!!!!
 
Do do realize .NET performance is one of the best, right? Right?
 
@Andrew I don't know if you meant this as a joke or not
 
I have done web requests, surely much less than Roel, but it doesn't take 100% CPU
 
.net is great, and fast. but only if you know what your doing. same could be said for any language
 
open System.Net
open System
open System.IO

let fetchUrl url =
let req : FtpWebRequest = WebRequest.Create(Uri(url)) :?> FtpWebRequest
req.Credentials <- new NetworkCredential("xxxx", "xxxx")
req.Method <- WebRequestMethods.Ftp.DownloadFile
req.Proxy <- null
req.UseBinary <- true
printfn "%s" (req.UseBinary.ToString())
use resp = req.GetResponse()
use stream = resp.GetResponseStream()
let reader = new IO.StreamReader(stream)
let charBuffer = Array.zeroCreate<char> 1000000000
let html = reader.ReadBlock(charBuffer, 0, 1000000000)
 
2:45 PM
@Sippy eh
 
I said file download not just web requrst
web request would mean that there's just a bit more than a header
 
Why aren't you just streaming to a file?
 
this is to download terrabytes of data
because I am testing performance so I am trying to squeeze a max from it
I did same in other languages so to avoid local I/O bottleneck
the server I am downloading from has fast I/O as well the network
 
holiday T -15 minutes
 
@Andrew Start streaming. What you're doing makes no sense at all.
 
2:47 PM
Python, PHP, Groovy, Java all does 1GBps with 35-40% CPU usage
So what would you suggest
 
Networking should be about 2~3% CPU usage maybe. Where on earth did you get such insane CPU usages?
 
FtpWebRequest uses socket polling, its going to be very slow
 
@RoelvanUden you speak like you never did ftp or web client, sorry
can you go and test yourself download of 1GB file please
and count usage of single core percentage
thanks Charlie
 
its the FtpWebRequest, its not built for that. you will need to stream the bytes instead
 
that would explain a bit
 
2:49 PM
We had this issue a while back ftp'ing large log files
 
!!learn showcode <>http://showmethecode.es/wp-content/uploads/2012/11/SMTC-transparencia1.png
 
@Sippy Command showcode learned
 
!!tell Steve showcode
 
So.. when Charlie says the same thing as me, it's acceptable.
Thanks for the vote of confidence
 
2:49 PM
Aw man
 
haha
 
@RoelvanUden I WIN
 
@RoelvanUden You have not earned his trust!
haha
 
usually @RoelvanUden wins
 
:-( Can't predict random people.
 
2:50 PM
I will win one day.
 
!!forget showcode
 
@Sippy Command showcode forgotten.
 
bye command :(
 
The only way to win is not to play.
Also, you've just lost The Game.
 
2:51 PM
Wow... That was deep
 
var req = HttpWebRequest.Create("...");
var res = req.GetResponse();
using (var input = res.GetResponseStream())
using (var output = System.IO.File.OpenWrite("test.dat"))
    input.CopyTo(output);
@Andrew ^ Test that. If it takes more than 2%, get a better PC.
 
@RoelvanUden You mean you can't run .Net on a toaster??
 
You can! Windows 10 with .NET IoT! Yay! Toaster Raspberry Pi 2!
 
IoT == I own toaster?
 
Oh god, that Internet of Things hype. It's horrible. "Yes, I want to be able to tweet from my fridge!"
 
2:58 PM
Exactly! Who doesn't want to check their FB on their night lamp?!
 
Funny how noone uses Twitter in Portugal
I mean, they do, they just don't talk about it
 
There are still people in Portugal?
 
Ever.
 
What's portugal? :p
 
:(
Please do not ask me if we're not part of Spain
 
2:59 PM
You're not??
 
We are, we just don't like people knowing it.
 
pff, an hour left until company meeting. Don't feel like much working until then.
 
Company owners should ban SO's chat from their network :P
 
@RodrigoSilva What a poor idea.
I've learned a shitload from SO chat since I started.
 
Sorry to ask, I need some advice - in regards to possibly what to research! I'd like to send an email automatically when something is added to my database. I don't believe I can do this with triggers because I can't add code to it (or launch applications)! I was thinking about writing a seperate tool to constantly check a row has been updated in the database and if so, send email but this seems resource heavy. Is there a 'standard' approach to this as I'm sure it's a common problem
 
3:02 PM
@Sippy I know, but since I don't work yet, I'd love to see you all get mad!
 
@MyDaftQuestions Write an API to send emails, access API in method that adds stuff to database
Write API to add stuff to database and do implicitly
meni option
 
OK IT"S WORKING
:)
Now that's better!
 
... interesting idea
 
Better to do that than have a service constantly querying the database.
 
@RoelvanUden Every.single.day.
 
3:03 PM
Especially if you plan to have a service use COUNT() to determine whether new rows have been added lol
 
Yes. I didn't think about that - Are you saying use the c# code to check the database for a condition, if met then update database and then send email
interesting idea
 
@MyDaftQuestions Nah, I'm saying where your code adds something to the database, send an email from there instead of checking the database again lol
If you use EF you can ensure something was added because SaveChanges() returns the number of rows affected.
 
ah I see - the problem is I won't know the condition
 
@Sippy Only possible when you control all the code that is adding records
 
The customer can state the condition
 
3:05 PM
@BenjaminDiele That was why I suggested doing this as an API
And only letting external apps write to database using the API
:)))))
 
so, customer may say "alert me if the value is product B"
I need to know that so can't hard code it
 
O right
 
but the idea still works great @Sippy
update database - check database for condition and send email if needed
 
Still much easier if you do it the way I'm saying because at the point of saving to database in your API you would know what the object was.
 
@CharlieBrown Who'd knew, streaming works. ;-)
 
3:06 PM
So you'd know if it was product B
 
Can you explain it slightly differently plesae @sippy as I thought I was doing it the way you said :(
 
Okay, using EF you can check that your entity was added by using boolean operators on whatever was returned from doing SaveChanges(). So if you have a save method to add something to your database, you probably have the thing you're going to add in there, right?
 
@Andrew You can continue to fine-tune the underlying TCP protocol configuration and streaming block copy size to get more performance, but you can squeeze maybe 3~5% more performance out it. Not worth the effort imho.
 
So you have your thing, and you can check if it was added or not by seeing what was returned when you saved your context.
So you don't need to read the database.
 
Ah - yes
Crystal clear
 
3:09 PM
@CharlieBrown Please validate what @RoelvanUden said
2
 
He's not to be trusted
 
omg lol
 
Yes or course, I already have the object before saving it!! Genius @Sippy
 
woo
 
3:11 PM
hang on.. wait... I come here a lot and Roel Van Uden is a stunning individual - he gives time, effort, and has helped me numerious times... I assume this is a a joke Rodrigo?
 
It is a joke involving @Andrew. Don't worry @MyDaftQuestions :-)
 
0
Q: MVC Onion architecture, some questions

Escobar5I'm creating a project with Asp.net MVC 5, Web Api 2, and Entity Framework. I'm designing it with an Onion architecture, so I have a DAL, Service and UI layers. My DAL layer contains a UnitOfWork and Repositories, my Service layer contains services for business cases. But I have the following q...

Since when is n-tier called onion?
 
Swoosh
 
ah, ooops.. Now I see silly :( Sorry all
 
Is that a thing? :D
 
3:11 PM
Any way, thank you @Sippy again
bye
 
@MyDaftQuestions yw
 
@Sippy Since fuck-you-o'clock
 
@KendallFrey WOOOOOOOOOOOOOOOW
@Steve
 
@Sippy
 
Is this love?
 
3:14 PM
Repositories on top of EF are bad, mkaaaay? — Sippy 1 min ago
@Roel i did gud?
 
@RodrigoSilva What is love?
 
Actually do you even watch South Park?
 
@KendallFrey Baby don't hurt me...
 
don't hurt me
 
No more
 
3:15 PM
@CharlieBrown What do ya mean?
> My DAL layer contains a UnitOfWork and Repositories
That sounds to me like he has a UoW implementation which he uses in his repositories O_o
 
@Sippy Yes, good job. :-)
 
wewt
Has anyone read CLR via C#?
.. have I asked that before?
 
good morning gang
 
@Sippy "Read CLR"?
 
@Sippy Has anyone really been far as decided to use even go want to do look more like?
 
3:18 PM
@RoelvanUden Sorry, the book is called "CLR via C#"
 
Oh, a book.
 
@KendallFrey I'm pretty sure that was done using Apple's predictive texting thing.
 
@Sippy "Repositories" could mean "DbContext" classes
 
@CharlieBrown Ah good point
 
@Sippy I'm pretty sure that existed before predictive text was a thing
Yahoo answers is a gold mine
How is babby formed?
 
@CharlieBrown I've been reading it :) can you comment on Brian's comment?
 
sure, but you wont like it
 
We're being overrun by our dutch colleagues. Send halp.
 
I kinda disagree with him, I see where he's coming from but at the same time I don't see how it fully justifies making those repositories unless you know your manager is gonna switch you to something that doesn't have its own repos.
I can remain neutral
:)
If it furthers my understanding then what's not to like
 
@RoelvanUden with CopyTo it's using internally 16k buffer instead of 1k
and it's all fine
It is now faster than ruby
 
3:24 PM
@Sippy I do it in a way, so I can reuse the same code for any ORM. but not repo-per-type, which is the anti-pattern
 
@Andrew Sure, but you can change that. You can also change how the OS responds on incoming packets (OS buffer etc), how the TCP packets function (more or less notifications from the OS, e.g. delay for n time or bytes), etc. There is a lot to be tweaked in EVERY language.
Benchmarking networking is just silly, anyway. Just remember, .NET is performance-wise one the best runtimes around, today, only bested by C/C++. No other language can make an adequate difference.
 
@CharlieBrown Like the example you put on Github a while back?
 
Is there any way to convert an ObservableCollection to a list, with the same reference?
 
right
 
Okey dokey
 
3:26 PM
I feel an urge to scream .NET after reading that @RoelvanUden
 
@ErwinOkken the internal objects will be the same
 
Like a war cry
 
@CharlieBrown I have a static ObservableCollection and when it changes, I serialize it to a file. But when I do oc.ToList(); it is a different list.
 
Meh. Performance is good and all, but there are more important things to consider when picking a programming language. Ruby is slow as fuck for example, but it's certainly fast enough for Web apps where most of the time is spent crunching in databases.
 
@ErwinOkken define 'different list'
 
3:29 PM
@CharlieBrown Not the same reference. They don't "sync" :P
 
if you serliaze... then no
 
@RoelvanUden Something my teacher said about Python: "An intel xeon is about 500€, a programmer is 5 times that"
 
The serialization has nothing to do with that. Just the transformation from OC to List.
The ode i use: List<T> itemsList = this.Items.ToList(); // this.Items = an ObservableCollection
 
@ErwinOkken The reason you get a different reference, is because the List is a different object than your ObservableCollection.
 
Yes, and my question is, is there any way to get a reference? Because I need the "Sort" method from the List. :P
 
3:35 PM
Morning peoples.
 
@RodrigoSilva Jup. Productivity matters. But on really huge scale, you want to cut licensing costs (Windows Server is expensive...) and operating costs too. Look at PHP; fine for most purposes, but FaceBook has essentially rebuilt the entire thing to get performance. At some points, it starts twisting around, so you gotta keep that in mind too.
 
@ErwinOkken right, we talked the other day about that. No sort on observableCollection
 
I'm also trying to create my own Sort, but that involves reflection. I hoped there was something more.. native-feeling :P
I know I should be using WPF, but I have to finish this project without. But i'm at a dead end atm :<
 
you shouldnt need reflection for sorting
 
Exciting stuff. Emergency meeting in 15 minutes.
 
3:44 PM
Quite an emergency. Let's wait 15 minutes, then meet.
 
@RoelvanUden It's with the whole company, even those from the netherlands. For a big company, 2 days notice is emergency style :D
 
Don't drink the kool-aide.
 
Hi Everyone!
 
@RoelvanUden I've got a question for you.
 
How do I get Role.Name in the razor view. I am only able to get Role.RoleId and Role.UserId
?
 
3:51 PM
If you have a global JavaScript variable, which is used to store the state of a dollar amount added. If someone tweaks the value of that global variable, it would let them spend more money correct?
 
@SpencerRuport The what now?
 
!!wiki drinking the kool-aid
 
@SpencerRuport No result found
"Drinking the Kool-Aid" is a figure of speech commonly used in the United States that refers to a person or group holding an unquestioned belief, argument, or philosophy without critical examination. It could also refer to knowingly going along with a doomed or dangerous idea because of peer pressure. The phrase oftentimes carries a negative connotation when applied to an individual or group. It can also be used ironically or humorously to refer to accepting an idea or changing a preference due to popularity, peer pressure, or persuasion. The phrase derives from the November 1978 Jonestown deaths...
 
My model is ApplicationUser which has users and its roles
 
You never know what they're gonna ask you to do in those emergency meetings!
 
3:53 PM
@SpencerRuport Well, almost time to find out!
 
How do I get Role.Name in the razor view. I am only able to get Role.RoleId and Role.UserId?
 
@Greg Sure. But relying on something a client can change seems like poor design (tm)
 
@RoelvanUden That is what I thought, I'm trying to find a fix to a problem that was designed mostly on client.
 
@LifeH2O you already asked that
 
3:57 PM
@CharlieBrown just repeated myself to get noticed :/
 
ahlp
 
only 3 mins between... its not C# Chat "instant Answers"
 
0
Q: How can I capture process names using the TraceEvent library?

Kendall FreyI'm using the TraceEvent library to capture ETW traces, but I'm not able to determine the name of the process that caused an event. Here is what I have so far: var session = new TraceEventSession(sessionName, null); session.EnableProvider(MyEventSource.Log.Guid, TraceEventLevel.Informational, ...

 
Man I really want a surface pro.
 
@RoelvanUden I'm going to have to rip a bunch of the Client Code out, for that reason.
 
3:59 PM
@SpencerRuport bought my mom one for xmas last year, she loves it
 
It doesn't matter @Greg. If you run anything on a client PC, it can be altered, regardless of how you code it or how much you try to protect it.
 

« first day (1601 days earlier)      last day (3352 days later) »