Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

itsnotabug itsnotabug
  • Web.config error pages

    sysrpl said:
    figuerres said:
    *snip*

    Actually I was trying to create a universal "catch all" error screen with detailed information, but formatted in a way/styling of my own design. Thanks for the replies. I'll keep looking around for how to get this done.

    do you really want your visitors to know about your null/object not found exceptions or is this for debugging?

     

    in my humble opinion i think it's better to log those exceptions and direct to a *fairly* generic error page, meaning you could catch/redirect to a certain generic error page based on the context the error was created in. then you could email the exception to dev from the log or database if you choose to store it there (i prefer this method because i can also get additional details about the session/context, not necessarily included in the stack trace and report off of it to detect patterns).

  • Odd C# ​multiplicat​ion behavior

    are you only doing base10 scientific notation? could you get away with convert to string, save the index of ".", multiply that index by exponent, insert "." at new index, convert back to dec?

     

     

  • iTextSharp PDF Generator show & as &

    i've found this solves most encoding sillyness.

     

    Response.Write(Encoding.UTF8.GetString(Encoding.UTF8.GetPreamble()) & output.ToString())

     

    you're writing a byte-order mark at the beginning of the file or string or whatever letting the receiver know what it's about to get. in this case the receiver is response.write to a browser and the output is some garbly html. this pattern works for more esoteric encoding schemes as well but i've only used utf8.

     

    of course it's better to catch the encoding errors up-stream.

  • Reliable Client Side Download Speed Testing?

    W3bbo said:
    itsnotabug said:
    *snip*

    A 1KB file is not large enough to give you a statistically significant figure for bandwidth testing because often raw network packets are between 1 and 2KB anyway, so you'd get that data in a single instance.

     

    You'd need something larger, say 10MB of purely random data to test with.

    that was it. thank you w3bbo for pointing out an obvious oversight on my part. i increased to 10mb and i get consistent results although it seems very low... around 10 seconds to download a 10mb file. i go to speedtest.net and it says i get 9mb/sec. would be interesting to see their methodology (they provide ping as a stat so maybe some derivation based on that).

     

    now i have to convince people to wait for a 10mb file to download.

     

    as long as the method is consistent, this measurement should suffice.

     

    thank you again.

  • Reliable Client Side Download Speed Testing?

    W3bbo said:
    itsnotabug said:
    *snip*

    A 1KB file is not large enough to give you a statistically significant figure for bandwidth testing because often raw network packets are between 1 and 2KB anyway, so you'd get that data in a single instance.

     

    You'd need something larger, say 10MB of purely random data to test with.

    good point. i was told to make it as unintrusive as possible but i will bump it up for production. i figured 1 packet was good enough to diagnose what we're really after. much more than the ping test we also tried.

     

    but, i get the same symptoms with larger data. 1st run about 18mb/sec, subsequent runs 200-800mb/sec.

     

    this isn't really for accurate benchmarking, rather to compare pcs at one site with others at the same site. if someone has low wifi strength compared to someone else, we want to be able to see that.

  • Reliable Client Side Download Speed Testing?

    this may be a red herring, but further reading suggests the difference in results may be due to automatic compression happening somewhere in the osi. stepping through, i see that the 1st instance of running the debugger gets a reasonable result: 18 mb/sec, but the subsequent calls in the same session run anywhere from 200 to 800 mb/sec (not likely).

     

    i created myKnownFileof1024.txt by just writing some empty bytes:

     

    Dim arrBytes(1023) As Byte
    Using stream As New IO.FileStream(path, IO.FileMode.Create, IO.FileAccess.Write, IO.FileShare.Read)
    stream.Write(arrBytes, 0, arrBytes.Length)
    End Using

     

    i checked iis where the fle lives and http compression is not turned on for staic or dynamic content. can this automatic compression/caching be happening anywhere else? this is an exe so i wouldn't think browser caching would be an issue, unless webclient is really just using ie internals.

     

    maybe i can create a compressed file and target 1024 so any further compression would not change the file size. hmmmmmm.

  • Offline ASP.Net and Sync

    figuerres said:
    itsnotabug said:
    *snip*

    if you are ready to use Silverlight you can create a Silverlight app that runs out of browser and could store local data and sync.

    if you do not want to get into silverlight then a winforms app will be the next thing to do...

     

    with a desktop app you can use Sql Express or Sql COmpact to store data.

    With SIlverlight you will need to do some kind of XML or Binary file format  to store the data.

     

    if you look at SIlverlight V4 due out sometime this month you can sign the app to give a better install and you can do almost anything a desktop app can do but you can store the app on the server and when users connect you can update the app on-the-fly so it's "web like" in that area...

     

    HTML V5 tallks about an "Offline" thing but thats not yet a real world option. no real impliemtations yet, just a lot of beta stuff.

    for the data we're dealing with, xml or an encrypted text file would suffice... too much overhead with a true relational store.

     

    silverlight could be worth looking into. never dealt with it before but this could be a good excuse to get my feet wet. thanks for the recommendation.

     

    it's times like these i wish i could just write to the file system using plain old javascript. i mean really... what could possibly go wrong? Smiley

  • Reliable Client Side Download Speed Testing?

    i'm in the process of adding some pc specific diagnostic gathering for an exe that is already published. querying the managementObjectSearcher gives me all the hardware info that i need, but i'm having a hard time getting a reliable avg download speed (either kb/sec or mb/sec).

     

    my 1st thought was to look at win32_networkAdapter class and indeed i see "speed" and "maxspeed" as properties of the enabled card but they don't return what i'm looking for (real world performance).

     

    my 2nd naive thought was to synchronously download a known file of size x (in memory, blocking the app) and do some calculation on start time/end time to determine kb/sec, but the results don't seem consistent (on the order of 1000% difference in my tests < could be bad logic on my part)

     

    is there an better way to do this?

     

    here's how i'm doing method 2:

     

    Dim wc As New WebClient
    Dim URL As New Uri("https://www.website.com/myKnownFileof1024.txt")
    Dim starttime As Double = Environment.TickCount
    Dim returnValue As Byte() = wc.DownloadData(URL)
    Dim endtime As Double = Environment.TickCount
    Dim seconds As Double = (endtime - starttime) / 1000
    Dim kbsec As Double = Math.Round(1024 / seconds, 10)
    Dim mbsec As Double = kbsec * 0.008192

     

  • Offline ASP.Net and Sync

    hmmm... looking more and more like we're going to need to roll a desktop app. installing iis on every laptop/local web app is out of the question, unless it can be redistributed and included in the exe. it needs to be something that can be downloaded and installed with minimal interaction by the user.

     

    so microsoft has no client-side web tech? javascript + active-x? i don't know anything about midori/azure, but i would think there would be some disconnected/sync framework in there.

  • Offline ASP.Net and Sync

    i'm looking for some perspective.

     

    we're very early in talks over a project that will require laptop users out in the field to dynamically collect data and upload it when they return to base. the data they collect can be different for each laptop (this criteria will be entered via www.website by admin types not at the base). it's been decided that edge and 3g are not options so some sort of sync needs to happen before the laptops leave the base (to ensure they have the latest criteria) and when they return (so collected data can be uploaded to www.website).

     

    does iis have an offline redistributable similar to how google docs allow you to work offline? i'd rather not have to write a windows app (and subsequently support it for every imaginable configuration of 64/32 bit laptop).  what are my options?

     

    many thanks.