« first day (1285 days earlier)      last day (3667 days later) » 

6:01 PM
@RyanTernier Have you used the HtmlAgilityPack?
 
@Greg I have about an hour of experience with it. Think I could help?
 
@KendallFrey Maybe, the above query is to find a nested table. Any thought as to why it throws my data in a single field?
 
I'm terrible at query syntax :(
Can you explain what you mean by "a single field"?
 
tbf, I like query syntax and I don't know what he means either
 
Wait, let me guess.
 
6:07 PM
Well, the table has four columns:

Name, Address, Phone, and Email.

When it writes it out, which I use a separator value to separate for a CSV, it ignores and places in a single field.
 
x.Node contains the InnerText of multiple HTML elements?
 
Multiple cells.
Multiple td.
 
What's the HTML it's reading, for reference?
Just an example is fine
 
I don't see any comprehension of CSVs there
 
Yikes, I can't read all that
 
6:09 PM
@TomW That is in a loop later on, as it appends based on each cell.
 
Just the <table> please
 
@KendallFrey Yeah, third party company.
 
@Greg I'm afraid I have no idea what you're asking now. The more times I read, the less I understand
 
@TomW Okay, I'll keep on my path. I'm getting close.
@TomW Essentially the query grabs all the data, but when I run it through my loop to compare my columns to make sure it enters them in the proper location it doesn't.
 
what does the loop look like?
 
6:12 PM
What does the HTML look like?
 
            foreach (var node in query)
                builder.Append(node.Node + "#");
 
@Greg Nope. haven't done web work in 3 years since getting this job.
 
and now you do MUMPS, or what was it?
 
what's your notion of the 'right' order?
 
6:13 PM
@RyanTernier This is for an in office desktop utility application, to expedite work. Unfortunately, this third party company with these tables is online :(
 
love answering questions where I can use dynamic :)
 
@TomW It does it in proper order, just without the rows.
 
Again, sample input, expected output. In this case also actual output.
 
So rather then a four columns with infinite rows, its one row and infinite columns
 
@Greg the result of that query doesn't contain any notion of rows
it's just a sequence
 
6:15 PM
@TomW Yeah, I realized that as we were talking.
 
i are king rubberduck
3
 
Indeed?
 
...because obviously patriarchial status is denoted by size
 
That is kind of awesome.
 
@TomW Translation: The bigger the manhood, the manlier the man.
 
6:25 PM
@TomW Where is that?
 
I want to say Netherlands, but I'm not positive.
 
!!urban rubber duck
 
@RodrigoSilva Rubber duck Masturbation at its best. Men with their meat. Ladies with their beans. No one ever makes it to breakfast, though they're always scrambling their own eggs.
 
the fuck
 
6:28 PM
Apparently: "In 2009, while it was on display in Belgium, vandals stabbed the Rubber Duck 42 times." Those fuckers!
 
Who the hell comes up with these definitions? haha
 
the public :P
 
@ton.yeung You'll have to refresh my memory.
@ton.yeung I've got parsing on the brain, so I'm partially insane at the moment.
 
@ton.yeung That is an excellent question, I don't know.
 
6:34 PM
great beers, Belgium
 
@ton.yeung And their world didn't implode, maybe other countries should follow suit.
@ton.yeung Actually I read that Canada is officially the wealthiest middle class in the world.
@ton.yeung Kind of interesting.
@ton.yeung I know, thought I'd share a fun fact.
 
6:53 PM
@ton.yeung More than likely quite a bit. They apparently have been very proactive about redistributing a portion of the wealth.
 
Wealth... don't get me started on how silly the whole tax thing is.
 
@ton.yeung ... We need a rhetorical style, as it is difficult to anticipate such things through a chat.
 
My girlfriends mom puts 800k into stocks. SHe makes 92$k in 1 year on stock changes, and she makes 40,000 in dividends. She's only taxed 12% on the dividends when she takes them out.
Someone else makes 40k and they get taxed 30%... they also need to work full time for it
 
@RyanTernier Well, maybe I should talk your girlfriends mom. Make some extra cash money.
 
That's just the investing side.
 
6:56 PM
@RyanTernier I think it's more for the benefit of the business receiving the investment than it is the investor
i.e. it tips the balance between them not bothering, and supplying capital
 
Don't get me started on tax deductions, and how it SCREWS OVER SINGLE parents who pay support
I pay $14k / year for child support. Because I pay support I can't declare them as eligible dependants. Yet, their mother who gets tax free $$ from me, can declare them as a $30,000 write off.
/rampages at tax tiime
 
@RyanTernier weird, in the US, you can deduct your support payments, and it's income for the other parent
 
@RyanTernier - Your gf's mom is a smart lady
 
same with alimony payments
 
@ReedCopsey You can deduct spousal support, but not child :(
@TravisJ She runs a nursing home. 20 rooms for old people. They pay around 300-500$ a day. Nursing homes are a cash cow
 
6:59 PM
interesting
 
lunch
 
@RyanTernier you should probably explore some gender discrimination litigation there
since mothers always get custody and fathers always therefore are put at an economic disadvantage by the tax system
 
@TomW WIth the new family relations act, it's not based on gender. It's based on who the kids live with, and if there is support payments
 
more outlandish arguments have been made on grounds of discrimination and won
 
If the kids lived with me, and she worked full time and I didn't, she'd be in the same boat. the issue is, she doesn't work.
Last year I was tempted to becoming a contractor. Make 30k a year, business makes 40k
I'd still give the same amount to my kids, but I'd be the one buying it for them
that way I'd know it's going towards sports, clothing etc. and not her drinking beer on the porch
but it's too risky for me atm.
 
7:03 PM
Ryan you're forgetting that men don't have rights and our only purpose on earth is to make money to give to women to raise children.
Get with the times.
 
Hahaha
 
In the 1970s the UK's social housing program had a rule wherein if you'd held a social rent for a certain period of time and been a good tenant, you could hand the rental to your children if they also required a social rent
 
To behave any other way makes you a patriarchy supporting woman hating sexist. :)
 
Haha, true oh so true
 
this system was challenged by the Racial Equality Commission on grounds that it was racist
this was intended to foster communities who'd behave as though they were homeowners even though they couldn't afford it
 
7:06 PM
but then again, sexist is such a vague term. Hillary Clinton would say "There are no women leading the front lines in our wars, that is sexist. More women need to join the army". Then, when the front lines are all women "Look at this, look at how many women are dieing for this country than men. That is sexist. Men are making the women do all the work"
 
since people from ethnic minorities, who were extraordinarily rare in this country when the social housing system was in its infancy, couldn't conceivably have had parents who had social housing, they couldn't be passed a lifetime rental in a favourable home such as the white british tenants tended to have
they sued the government, and they won
that system doesn't exist anymore
 
@TomW I'm a firm believer that a person should not be able to own land in a country unless they're a citizen of that country. Half of Vancouver real estate is owned by Asian investors. They jack the price high, and the hard earned money of the Canadian person is being put into China, rather than back into the local economy
 
well they were at that point. They just didn't have parents who also were
the point I'm making is that you can win discrimination claims based on ludicrous ideas
@RyanTernier but I agree with you, I can't see why foreigners should be allowed to own real estate if it ruins the chances for local people
which it doesa
and who suffers from banning it? Foreign people who this country owes absolutely nothing, and who are rich anyway
who cares
 
@TomW There's always lawyers who want to set presidences.
 
7:36 PM
@Greg Check your e-mail.
 
Thanks, I'll check it out.
Anyone here have an Xbox One?
 
@Greg Nah... my wife watches me enough when I don't want her to... I don't need my console doing that as well ;)
 
@EvanL If you didn't have that winky face I would of thought you were serious, then I would of flipped out as that is the typical troll on the console.
 
I am going to get one, as soon as they arrive here in Norway
 
@Greg Truth is... I just had a baby so gaming time? Non-existant...
 
7:46 PM
@EvanL Well, it does more than game. The voice control and television input is quite nice.
@LasseV.Karlsen Nice!
 
@Greg True. Let me rephrase:
@Greg Truth is... I just had a baby so gaming time? Non-existant... Expendable cash? Non-Existant... =P
 
@EvanL Lack of cash, makes sense.
 
But just wait till he's 4 years old... then it's on!
 
Hm, is anyone familiar with the game Warface for Xbox 360?
Just got an email from xbox live saying I can play it free with my xbox live gold subscription, does that mean the entire game is free, I wonder...
Ah, free 2 play, right
 
@LasseV.Karlsen They more than likely made the game free and transitioned to a free-to-play model.
@RoelvanUden Question for you...
 
7:51 PM
Go for it.
 
@RoelvanUden This example, if I transitioned the Console would it handle being switched to a csv?
 
Sure... I just parsed the HTML into a data class.. you're free to transform that however you see fit.
json, xml, csv, xls... it doesn't matter
 
So the data class is storing the values before it spits them out correct?
 
See, I was doing it with a StringBuilder and spitting the data out.
 
7:54 PM
That's silly.
 
Well, I had to remove some of that extra garbage.
Can you explain this a bit for me:
	static class Extensions {
		public static HtmlNode MoveToParent(this HtmlNode node, Func<HtmlNode, bool> predicate) {
			node = node.ParentNode;
			while (node != null) {
				if (predicate(node)) return node;
				node = node.ParentNode;
			}
			return null;
		}
	}
You created a static class so that it would essentially handle the HtmlNode, just to see if it has data in the node?
 
what part of it do you need an explanation for?
it's basically a method that moves up to a parent node you're interested in, dictated by the func delegate
I'd call it "FindParent" or something like that though
 
I haven't worked too much with this style syntax, can you break it down a bit?
 
What part of it?
 
(this HtmlNode, Func<HtmlNode, bool> predicate)
 
7:59 PM
Why it's a static class, and why there is that this keyword before the first parameter? And do you understand that func delegate?
 
@LasseV.Karlsen The Static makes sense, cleaner syntax when your implementing. The this and the Func part.
 
@Lasse - It is a razor extension
 
ok, let's take the func first, ok?
 
Okay.
 
Basically, you can write this: MoveToParent(someNode, node => node.Name == "Interesting");
 
8:01 PM
Okay.
 
You provide a delegate, a pointer to a method, such as a lambda expression like that, and that will be called internally
basically, the internal loop will first go up to the parent, and then ask that expression, is this the node you want? If so, return the node, otherwise move further up the parent hierarchy.
You can provide a method for the delegate in various ways:
 
Okay.
 
The this keyword makes it an extension method on the type after the this parameter. So instead of MoveToParent(mynode, node => node.Name == "interesting") you can write myNode.MoveToParent(node => node.Name == "interesting")
 
1. A lambda expression: `node => node.Whatever == 42`
2. An anonymouos method: delegate(HtmlNode node) { return node.Whatever == 42; }`
3. A full blown method
The this keyword is black compiler magic
A static method in a static class, where the first parameter is prefixed with this is called an extension method, and allows you to do this:
 
I like using the this keyword to make extensions, although it is not a very common approach.
 
8:03 PM
Instead of Extensions.MovetoParent(thisNode, node => node.Name == "Whatever")
You can do this: thisNode.MovetoParent(node => node.Name == "Whatever");
Basically, it seems you've just bolted on a new method to the HtmlNode type, without changing that type.
The second syntax will be automagically transformed into the first, and thus the compiler will compile it as though you just wrote out Extensions.MoveToParent(...), it just looks nicer.
 
Okay, so essentially the equivalent would be something like this:

var query = from table in document.GetElementById("_memberListGrid").Descendants()
from row in table.SelectNodes("tr").Cast<HtmlNode> .... etc.
So by building it as an extension method it helps simplify the query process a bit?
 
It makes the code somewhat easier to read and write.
The main purpose of extension methods is to facilitate LINQ.
Basically, when you do this:
 
@Greg - Why are you using the old format of linq?
 
@LasseV.Karlsen Yeah, okay.
 
from x in collection select ...
the code is transformed into this:
collection.Select(x => ...
 
8:05 PM
It does allow for method chaining without method nesting. So myObject.MyFirstMethod("blah").MySecondMethod() instead of something like MySecondMethod(MyFirstMethod(myObject, "blah"))
 
@TravisJ The syntax seemed easier to me to read while I was doing the complex part, was doing to transfer it eventually.
 
At this point, the type of collection might not have a Select method, but if you create one as an extension method, it will work.
So you can "linqify" everything, by just providing the right extensions methods for the types.
 
I see, I see...
 
@Greg - Hm, I always found that version harder to read
Although they are both rather easy in general
 
@TravisJ Feels more like SQL to me, which I'm comfortable with.
 
8:07 PM
I compose all of my sql with lamba expressions
 
@LasseV.Karlsen So the extension method is designed to simplify and make it easier to provide the Linq capabilities. Rather then the approach I took by hard coding.
 
Yes
Extension methods was added as part of the LINQ overhaul.
They're useful for lots of other things as well, but their main reason was to make LINQ possible.
 
Okay.
That makes more sense, by using the delegate like that it should help for a return type correct. If it is a declared type or an anonymous, correct?
 
Not sure I understand that last sentence.
 
Well, the Func is coupled to a delegate. I though they are basically a storage, for a method return type for declared type or anonymous type. Since it encapsulates the data.
Or am I mistaken?
 
8:15 PM
a delegate stores a reference to a particular method on a particular object
you can invoke a delegate to call that method on that object
the func is a delegate
 
Okay, so I was right.
@LasseV.Karlsen I word things goofy sometimes.
 
@LasseV.Karlsen - How is the func a delegate?
 
Random thought, when I execute something like: myObject.Dispose(), what really happens?

-> Does the compiler mark that object as "cleanable" and the GC looks for such objects

OR

-> Does it csomehow call GC and actually performs the clean?
 
I don't fully understand the connection since I barely worked with delegates.
 
8:16 PM
I didn't think a Func was a delegate, but I know their often coupled I thought.
 
Func<T1, TResult> is a delegate type. It is defined as delegate TResult Func<T1, TResult>(T1 p1);
 
@RodrigoSilva - All that does, is call the Dispose method on myObject
@LasseV.Karlsen - Is that also compiler magic?
 
@TravisJ Well yes, but that means it will be erased from memory, correct? From the heap, I think
 
@RodrigoSilva - Depends on what is implemented in the dispose method
 
Well, it depends on what you mean by that, the compiler certainly knows syntax that will create a delegate for you if you just name a method on an object.
@RodrigoSilva If you dispose an object that does not in the slightest involve the garbage collector for that object.
 
8:18 PM
@LasseV.Karlsen - I meant does this
Func<Person,bool> xpr = p => p.Name == "Travis";
get converted to a delegate?
 
The Dispose method might release references to other objects, making them eligible for collection.
xpr is a delegate.
The lambda expression is automagically converted to a normal method, and the delegate refers to that.
 
Hm, I see.
 
So the compiler converts that behind the scenes later on? I see
 
Basically, first the compiler creates a normal method, like this:
private bool SomeMethod<>1(Person p)
{
    return p.Name == "Travis";
}
Then it rewrites your code to this:
Func<Person, bool> xpr = new Func<Person, bool>(SomeMethod<>1);
Saying "I want this particular method wrapped in a delegate", and then it assigns that delegate "wrapper" to xpr.
 
interesting, I never knew you could new a Func
where does the delegate keyword come in to play?
 
8:21 PM
it's a keyword that is used during declaration of the Func<...> type.
It's basically a special way for the compiler to provide some extra code for you in that type, without you having to write it every time. a delegate is a class, like most other classes, inheriting from a base class like MulticastDelegate, with a constructor and properties and everything.
You just don't write it as a class declaration.
 
See, conversations like this make me realize how little I know.
 
But now you know more :)
 
True, wish I could read a book that goes into that much detail per topic. Then I'd never program, as I'd be constantly reading. Vicious cycle.
 
@LasseV.Karlsen - Is it possible to create multicast delegates to be used as callback functions?
Or is it a behind the scenes only tool
 
A multicast delegate is basically a fancy way of saying that a single delegate object can refer to more than one method.
If you invoke the delegate, it will call the methods one by one. Unless one of them throws an exception.
And delegates and callbacks are, at least in my mind, synonymous.
You provide a way for some existing piece of code to involve your new code to make decisions, provide data, etc.
 
8:25 PM
So why exactly is the node = node.ParentNode delared twice?
 
Without you having to pre-build a dataset, figure out the answers ahead of time and pass them as parameters.
It first moves one up outside the loop, so that the loop will ask "is this first parent node the one you want?" instead of "is this node that you just gave me the one you want?"
 
..?
 
Basically, outside the loop it's just to avoid asking the delegate about the node that was passed into the method to begin with.
 
@LasseV.Karlsen - I see. Now I think I understand why people also use the type of syntax
Func<Person,bool> xpr = p => p.Name == "Travis";
List<Person> people;
bool found = xpr(people);
 
It basically assumes that if you say "move to the parent node", you're not interested in the start node.
 
8:26 PM
@LasseV.Karlsen Okay...
 
Essentially that could be a do while loop
 
@LasseV.Karlsen So I have a question...
So would that approach be better, of would an approach that does something similar in a single class be bad?
Essentially I was writing the hard-coded Linq in a single class, and doing the scraping there as well.
I also was using a StringBuilder.
 
Neither is "better" per se.
So consider this. Is one of the two ways code you would just naturally write, at least before we had this conversation?
 
No, I more than likely wouldn't have done it that way.
 
8:31 PM
:)
 
@LasseV.Karlsen - Back to delegates, since Func is a delegate construct does that mean that when delegates are defined they are similar to expressions in that all they have to do is match the signature?
public delegate bool xpr(Person P);
and then if I accept that in a method
public void ScreenPeople(xpr Screener){ foreach(Person p in People.ToList()) if( xpr(p)) People.Remove(p) }
that I can define a method which fits the delegate
public bool NameIsTravis(Person p){ return p.Name == "travis"; }
 
@TravisJ Beyond me with that.
 
Yes, that is correct.
 
@Greg - I have always been curious between the connection of delegates and func
So that revelation was kind of fun to make
@Lasse - Thanks for the explanations :)
 
8:37 PM
Note that there is another delegate for the type of delegate that takes a parameter of some type and returns a bool, called a Predicate
 
@TravisJ I have trouble understanding that. I'm not that skilled yet.
 
So a Func<Person, bool, you can also use Predicate<Person>.
It is implied that a Predicate returns bool.
ie. public delegate bool Predicate<T>(T value);
 
@LasseV.Karlsen That is cool, so it is almost like built in error checking. If true awesome, if false bad.
 
Entire LINQ is built on this.
Take this:
from person in persons
where person.Name == "Greg"
select person.Age;
This is transformed into this:
persons.Where(person => person.Name == "Greg").Select(person => person.Age);
So the LINQ syntax is just compiler magic to get to a serious of method calls.
 
Yeah, that makes sense.
The compiler magic doesn't help though.
 
8:40 PM
Where(...) is an extension method that will loop on each element in the collection it is given, persons in this case, and for each element it will invoke the delegate to ask it if that is one it wants.
Select(...) is an extension method that will loop on each element in the collection it is given, and for each element it will invoke the delegate, and whatever that delegate returns is the values produced by Select.
Where will produce the elements from the original collection, as long as the delegate says true.
Select returns potentially different values.
 
That makes more sense!
 
Where can be implemented naively like this:
 
So essentially when I call that `where` it is performing a method like this:

if(data.Contains("value"))
return true;

That sort of thing?
 
public IEnumerable<T> Where<T>(this IEnumerable<T> collection, Predicate<T> predicate)
{
    foreach (var element in collection)
        if (predicate(element))
            yield return element;
}
Here's Select:
public IEnumerable<TOutput> Select<TInput, TOutput>(this IEnumerable<TInput> collection, Func<TInput, TOutput> selector)
{
    foreach (var element in collection)
        yield return selector(element);
}
The real Where and Select probably contains a bit more code, like parameter null checking, and some other things, but those two would actually suffice.
 
I see, that is really helpful @LasseV.Karlsen
 
8:46 PM
@Greg - For a list and explanation of every linq method in method form, Jon Skeet wrote an ebook with examples here: edulinq.googlecode.com/hg/posts/index.html
 
Can I buy it for my Kindle?
 
its free, just click and read. really helped me when I was learning linq
 
So it isn't in that format?
 
Oh, I am not sure if you can buy it on kindle
 
It's just a website
 
8:48 PM
"ebook" should have been quoted, that is just what Jon called it for some reason
 
PDF file, you can send that to your Kindle.
MOBI and EPUB files, probably more suited for your Kindle.
 
Awesome, thank you!
@LasseV.Karlsen Do you have a LinkedIn?
 
MRW I see blue, bold, italic text in our plain-jane app:
 
9:09 PM
!!urban MRW
 
@RodrigoSilva MRW An abbreviation for "My Reaction When".
 
!!urban rodrigo
 
@TravisJ Rodrigo A person who wants everything with reproductive organs. A walking hormone. Even though a rodrigo is usually harmless you must have firm handle on his outgoing attitude. But rodrigos are still usually well-liked, everyone knows a rodrigo.
 
:P
 
9:10 PM
lol sorry, your name has the best entry
 
you know my weak spot
 
!!urban Greg
 
@Greg [greg](http://greg.urbanup.com/2285681) A scottish word used mainly in glasgow
meaning to always get drunk and flirt with women
 
Seems about right
 
!!urban Arrigotti
 
9:13 PM
@Greg No definition found for Arrigotti
 
You guys have nothing on me...
!!Evan
 
@EvanL That didn't make much sense. Use the !!/help command to learn more.
 
!!urban Evan
 
@EvanL [evan](http://evan.urbanup.com/2656039) adj./adv.
1. to be awesome beyond contemplation 2. to be so good looking that one is attractive to every female present and at least one guy present 3. to be incredibly smart

noun
1. one who is awesome beyond contemplation (not to be confused with one who is "pious beyond reason") 2. one who pwns in all that he/she does

verb
1. to pwn someone so badly the pwned begs to "take it in the face" 2. to w(snip)
 
!!urban recursion
 
9:14 PM
STAHP
 
mind blown
 
@TravisJ recursion See [recursion].
HAMMAHTIME!
 
Can't remember the exact word =/
 
Sorry, I was away here, yes, I have a linkedin profile: linkedin.com/in/lassevk
 
!!urban Spencer
 
9:23 PM
@SpencerRuport spencer a great guy who cares about alot, usually very easy to talk to but can be shy; just someone who cares and is very sweet
 
d'awww <3
 
lol
!!urban STOY
 
ZABIVAT' VREMYA!
@TravisJ Stoy SEXYYYY BITCH!
 
I'm deleting 6 branches atm.
So I've got about 30 minutes with nothing to do.
 
@SpencerRuport drink beer
 
9:33 PM
!!steve
 
What exactly is the meaning of this:
HtmlEntity.DeEntitize(column.InnerText).Trim(), @"\s+", " ")
 
its de-entitizing, duh
:p
 
@Steve Yeah, still a giant WTF
 
lol
i'd help you if i had any clue
 
9:36 PM
I know.
I'm not sure what constitutes a HtmlEntity and why they're being DeEntitize.
 
@Greg I believe an HTML Entity would be denoted by the & symbol. Likely the DeEntitize() function removes these special characters. Total guess, but just looking at w3schools.com/html/html_entities.asp
 
Usually that function is HTMLDecode
 
Oh, converts Html into plain text.
 
Makes sense... just a weird way to name the function.
@Greg Do you have the implementation of DeEntitize()? I'm curious how it works.
 
Hello. can anyone tell if this can be modified to show KB/s etc. ?
private static readonly string[] FileSizes = { "Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };

private static string ConvertBytes(Int64 value)
{
int mag = (int)Math.Log(value, 1024);
decimal adjustedSize = (decimal)value / (1L << (mag * 10));

return string.Format("{0:n1} {1}", adjustedSize, FileSizes[mag]);
}
that is for file size in bytes to KB, MB etc..
 
9:52 PM
@jyrka Presumably you only need to modify the string.Format to say {1}/s instead of just {1}
 
			var rowMapping = new List<List<string>>();
			foreach (var row in table.Descendants("tr").Skip(1)) {
				var columnMapping = new List<string>();
				foreach (var column in row.Descendants("td")) {
					columnMapping.Add(Regex.Replace(HtmlEntity.DeEntitize(column.InnerText).Trim(), @"\s+", " "));
				}
				rowMapping.Add(columnMapping);
			}
@RoelvanUden You there?
 
I'm working on a menu system, and I need a prototype menu (just a bunch of buttons that display nested menus) to test it on. Interesting ideas, go.
As in Stack Overflow > Main, Chat | Chat > C#, Lounge<C++>, JavaScript
 
@KendallFrey What type of data, and your primary goal? Of application, and desktop correct?
 
etc.
All I require of you guys is a non-boring menu hierarchy
 
Is this correct way to measure download speed? I found many diffrent ones on internet, can really tell which is best.
if (SW1.ElapsedMilliseconds != 0)
{
long m = (e.BytesReceived / SW1.ElapsedMilliseconds);
if (m < 1)
{
label3.Text = String.Format("Speed: {0} B/s", (e.BytesReceived / SW1.ElapsedMilliseconds));
}
else if (m < 1024)
{
label3.Text = String.Format("Speed: {0} KB/s", (e.BytesReceived / SW1.ElapsedMilliseconds));
}
else if (m < 1048576)
{
label3.Text = String.Format("Speed: {0} MB/s", (e.BytesReceived / SW1.ElapsedMilliseconds));
}
else if (m < 1073741824)
{
label3.Text = String.Format("Speed: {0} GB/s", (e.BytesReceived / SW1.ElapsedMilliseconds));
SW1 = stopwatch
cant*
 
9:58 PM
looks goofy to me
it will always display a speed of <1 from what I can tell
 
@Greg No I meant the actual code for the DeEntitize() method.
 
Wait, never mind, you're not even doing the unit conversion
You have no concept of units in that code
You're mixing B, KB, MB, GB, and s, ms
 

« first day (1285 days earlier)      last day (3667 days later) »