Ketsuekiame 860 Master Poster Featured Poster

Given that I spent most of this weekend asleep and/or playing MTG, I'll do it this week :)

Ketsuekiame 860 Master Poster Featured Poster

I suppose if a member has 4 accounts they could still make 4 entries whoever chooses the winner.

If honesty and integrity cannot be relied upon, the whole idea is doomed to fail.

However, what would be the point. If the OP chooses the winner and you make 4 different posts with 4 accounts, all you're doing is making it harder to choose. Why not demonstrate your knowledge from a single account, you would be much more likely to be selected if you're shown to be a good contributer.

Let's say the OP selects some answer which gets the bounty but later realizes that it's not the complete solution. Should the OP expect the follow-up solution from the bounty-winner.

In this case, my personal choice would be no. The OP has selected their answer as being what they wanted. If the OP is "wishy-washy" and doesn't get the complete answer they were after but mark the question as answered, then it's a problem of their own making.

Let's take the question/answer:

Q: "Do you like red or yellow?"
A: "Yes" <-- Marked as solved

The question is ambiguous and so is the answer, however, the OP has chosen to close the question and say that this answer was satisfactory to their purposes. If they actually wanted to know which colour, they should have asked that before they closed their question.

A programming example:

Q: "How do you write lines to the Console in C#?"

Ketsuekiame 860 Master Poster Featured Poster

What if only those members who are selected and participate in the thread get to vote on either a single member or all members get a cut.

Again too easy to game. If I post in the thread with 4 accounts and my main account, it means I can vote for myself 4 times.

I think the only reasonable solution to this is what Pritaeas said; get the OP to pick one or more users when they mark the thread as solved. If the OP picks no one, DW would just keep it. Perhaps put it in a separate "pot" and use it as a "prize fund" for any competitions you might want to do.

Ketsuekiame 860 Master Poster Featured Poster

I completely forgot this thread even existed :)

I can't remember what my reasoning was for the state information to be client side. I'm sure there was one, but it escapes me now ;)

On another note, I've been experimenting with something called SignalR. Essentially, it allows you to make calls to client side javascript from the server (websockets underneath). Removes the need for polling the database and should make it considerably more efficient ;) If the client doesn't support websockets, it will fall back onto long polling, but without the need for you (as the developer) to do anything.

If you like, I'll write you up a demonstration this weekend and you can see if it's something that you'd be interested in :)

Ketsuekiame 860 Master Poster Featured Poster

Oh you mean the old style Async! Sorry, I thought you meant the new one :)

That looks okay. I'd do it slightly differently by abstracting the client away, but your way isn't "wrong".
To answer your previous question about the async methods, you should be able to untick some box when you're generating the client code that says "Generate Async Methods" or something similar.

I'm not overly familiar with WP8, however if I recall correctly, you still need to update controls on the UI thread and the ASYNC return event may not be.
As such you'd want to do something similar to the following in order to update the control:

Deployment.Current.Dispatcher.BeginInvoke(()=> TextBox1.Text = e.Result);
Ketsuekiame 860 Master Poster Featured Poster

Any particular reason you can't use the async keyword? If so, just take it off.

An async method returns a Task, the result of the Task is your data type. So it might say Task<string> which means you can call the webservice from your application (synchronously) by called webService.GetMyString().Result;

If you decide you can use async, you could simply call string myString = webService.GetMyString(); and the call will happen asynchronously until the result is required.

e.g.

public async Task CallServiceAndGetString()
{
    string myString = webService.GetMyString(); // Web Service call gets sent. Does not block, but lets say that this calls lasts 30 seconds for whatever reason.

    someClass.CallStarted = true; // WebService call still going
    someOtherClass.DoWork(); // Still going...

    MessageBox.Show(myString); // Blocks here until the original call completes
}
Ketsuekiame 860 Master Poster Featured Poster

Well, your two options are (to achieve what you want);
1. Decode the PDF server side and parse into HTML format. Insert that between your div
2. Run some kind of Java Applet that requests the file from your database. That file would still need to download to the client machine, but would only exist in the applet's memory. You could then stream that to wherever you want. If you want it in your div, then you need to parse it to HTML again.

Ketsuekiame 860 Master Poster Featured Poster

I think you should clarify what you want. As in, do you want to connect to any website regardless of whether or not it's controlled by you, or, would this website be yours and provided for the purpose/support of your chat application?

Ketsuekiame 860 Master Poster Featured Poster

Random number generators, in a lot of cases, need to be deterministic and you often need more than one in order for it to remain deterministic.

If the RNG were static, you would be limited to one. Due to threading, this means that the RNG may not be deterministic. For example; if two threads run within nanoseconds of each other, different executions may end up getting the numbers switched around, even in a "deterministic" scenario.

Additionally, there is more than one type of RNG. The standard RNG is unsuitable for cryptography, so there is a special one for that purpose.

Ketsuekiame 860 Master Poster Featured Poster

Probably better asking on Business Exchange. You're essentially asking us to pitch business ideas at you. ;)

Ketsuekiame 860 Master Poster Featured Poster

I would do a little re-design there. Whilst const ought to be flagged by Obsolete, I would redesign and make a public property that returns your const. Mark the property as obsolete and it should flag it.

Ketsuekiame 860 Master Poster Featured Poster

If you're using a List as ddanbe suggested, as an extra bonus you can use the ForEach method on the list object.

guys.ForEach(guy => guy.UpdateLabels());

There's little difference between foreach and List<T>.ForEach other than the latter is slightly faster and allows you to modify the collection (which you shouldn't do this way anyway).

Ketsuekiame 860 Master Poster Featured Poster

Nothing really, they both have the same outcome. The second way is the preferred method if you know the contents before hand.

It boils down to;

Guy[] guys = new Guy[3]; -- You're reserving space for 3 "Guy" objects in this array. You don't yet know what object is going where, this will be filled in later.
Essentially guys[0 to 2] == null

Guy[] guys =
    new Guy[3]
    {
        new Guy { Name="Joe", Cash=50, MyRadioButton=rbGuy1, MyLabel=lblBetDesc1 },
        new Guy { Name="Bob", Cash=75, MyRadioButton=rbGuy2, MyLabel=lblBetDesc2 },
        new Guy { Name="Al", Cash=45, MyRadioButton=rbGuy3, MyLabel=lblBetDesc3 }
    };

I'm initialising the array with these three objects. Seeing as we already know the contents, there's no point reserving space and then filling it in later.

If you were going to do your method 1, the compiler would probably optimise it away so that the array is initialised with the contents on the next three lines (although I can't guarantee).

So, use method 1 when you're filling array contents from a different source or you don't have the contents yet.
Use method 2 when you already know which objects are going to be used.

Ketsuekiame 860 Master Poster Featured Poster

If you simply want uniqueness, take the highest number you already have and add 1. Simple yet effective.

You said that you don't want to have to iterate through all previous codes, yet, you have to anyway to check that the number you have is unique. There are ways to increase the entropy of the distribution but the chance of hitting an existing number with RAND is quite high compared to using GUID or single digit incrementing.

Ketsuekiame 860 Master Poster Featured Poster

Hmm, I wouldn't remove on a simple edit.
I would put a little button on your profile page that clears the flag.

I've always prefered explicit over implicit, especially in cases like this. :)

Ketsuekiame 860 Master Poster Featured Poster

Maybe it was a cache/refresh thing, but to me it looks the same as you've typed it...

d5f3daab889e7e5b28e890cac5f0f315

Ketsuekiame 860 Master Poster Featured Poster

I would scour google for a C++ library that can capture a desktop area.

You will be able to link to your C++ from C# by using DllImport. This allows you to specify the method signature and library that you're calling. The .NET library will handle the specifics.

I'm afraid I don't have any links to give you, only a general idea of how it would work. But unfortunately I don't have the time to do any discovery programming for you.

Ketsuekiame 860 Master Poster Featured Poster

You won't be able to do this entirely in C# unless you utilise something like SharpDX.

You will need to call out to a C++ library in all liklihood.

Once you have the stream, you can display it on a form. A picture box might not be the best control for this, but it totally depends on how the video data is streamed to you (for example, you might have a WMV stream rather than an array of bitmaps etc)

Ketsuekiame 860 Master Poster Featured Poster

Would it be possible for you to mark this as read and retry?

My mail server went down for a while and bounced some of the DW emails. Now everytime the website attempts to send one I get a PM saying that the address previously bounced and I should edit my profile.

I have, but the message still appears. The mail server is up and working fine. Is there a way that we can remove this flag from the mail account?

Thanks.

Ketsuekiame 860 Master Poster Featured Poster

Open it in a browser or in the form?

Ketsuekiame 860 Master Poster Featured Poster

Unless someone reverse engineers the proprietary protocol I doubt third party manufacturers will be able to.
There is no real standard for how accessories communicate with their host hardware.
Also, if they're using a direct electrical link rather than a software interface (with standard hardware such as a USB type device) then you could potentially cause serious damage to the components involved.

Ketsuekiame 860 Master Poster Featured Poster

Not sure what website you were looking at but I haven't been able to find that. Git is available as OpenSource from their website. Install and configure a repository, there are a few guides out there that show you how.

GitHub may charge to create a private repository, but this is a different service to one that you'd set up yourself. They're essentially hosting and managing it for you and you don't have to make your source code open source.

Ketsuekiame 860 Master Poster Featured Poster

I personally think of the "cloud" to mean geo-redundant storage and distribution, much in the way content delivery networks work.

i.e. I upload a picture of my cat to "the Cloud".
Jim, from the US, downloads the image of my cat from a server in the US. My boss, on the other hand, would download the same image from a server in the UK.

To me, or the user storing information, everything is handled and managed from a central point. I "can't see" the 25 worldwide servers my information is subsequently distributed from.
This is what I would consider correct usage of "the Cloud" as terminology. Although I admit that it's pretty much a buzzword and marketting tool.

As far as source control is concerned, if I recall they are sectioned into three generations.

1st Generation - ie. SourceSafe
2nd Generation - TFS
3rd Generation - Git/Mercurial

In a large organisation TFS still offers benefits over Git/Mercurial simply because of the Enterprise level support from Microsoft, however, Git is a "superior" system in terms of features. Distributed source control is some kind of witch-craft, but I think it's hard to go back to TFS after getting used to Git.

Ketsuekiame 860 Master Poster Featured Poster

You could try and use WebKit.NET. This will attempt to use the same browser component that is used in Safari.

Other than that, there is the Chromium Embedded Framework, but I've found this difficult to use and produces unpredictable results (do not expect Google Chrome and Chromium to give the same output...)

Ketsuekiame 860 Master Poster Featured Poster

The web browser control is based on Internet Explorer. If the web page doesn't work in IE, it won't work in your WebControl either.

Ketsuekiame 860 Master Poster Featured Poster

@jwenting Have you considered hosting your own Mercurial server?

Ketsuekiame 860 Master Poster Featured Poster

I would like to add that this is not only DW exhibiting the issue (for me). This also occurs is Battlelog (for Battlefield 4). Because of the size of the application involved, the problem is extremely exaggerated compared to the problem with DW. It is enough to bring my entire machine to a standstill.

This appears to happen only with Chrome on Windows 8.1 and the latest update (again for me)

My work machine is Windows 7 running Chrome 32.0.1700.102m and does not appear to exhibit the issue.

Ketsuekiame 860 Master Poster Featured Poster

Given that it works elsewhere, just not on your machine, indicates a possible issue with your machine. The graphics drivers perhaps. Unfortunately, beyond this, I'm out of ideas.

Ketsuekiame 860 Master Poster Featured Poster

When you reinstalled your OS, did you copy the entire source folder to backup? Inside there's an obj directory. Try deleting that folder and rebuilding.

Ketsuekiame 860 Master Poster Featured Poster

You'd need to make it static, or if it never changes, const

Ketsuekiame 860 Master Poster Featured Poster

Google for dxwebsetup and download the one directly from Microsoft. This will ensure you're up to date.

Ketsuekiame 860 Master Poster Featured Poster

Have you check the value for videoid is a valid value? Did you also run the query against the database manually and check the result?

What type of object is viewerlist?

Ketsuekiame 860 Master Poster Featured Poster

I don't really understand your question. Could you try and explain it again please?

Ketsuekiame 860 Master Poster Featured Poster

Have you tried updating DirectX?

Ketsuekiame 860 Master Poster Featured Poster

That's a pity, really your only way to keep something alive is to recruit the youth and teach them. Music changes and evolves, there's no reason you can't have good music that is also modern.

Do you have anything available to listen to?

Ketsuekiame 860 Master Poster Featured Poster

Yep, although your will also add up standard characters too :P

You could also use '0' instead of 48. Just easier to remember :)

Also, strictly speaking, you could do the conversion in a select (removing the .ToArray()) and then .Sum(s => s)

My version: Console.WriteLine(Console.ReadLine().Select(c => c - '0').Where(c => c < 10 && c >= 0).Sum(c => c));

I did two version of mine because I didn't like the lengthy if statement and calculating the value c - '0' three times. The other version has no select statement but applies the mathematics everywhere that c is used.

!!IMPORTANT NOTE!! This is an incredibly inefficient and/or stupid way to do it :D

Ketsuekiame 860 Master Poster Featured Poster

Ah, sorry I'm used to dealing with Sockets and not the TcpClient abstraction. Calling close on the TcpClient should be enough.

You could try switching to MessageReader.ReadBytes. The advantage here being that it will read all the data available up to the size you specify, if available. This call will not block, but instead will return how many bytes it managed to read on this operation. If the stream has closed (reached the end) it will return -1. You can check for this value to tell you whether or not the stream has closed.

Also, becareful with your message parsing loop. You will get stuck in an infinite loop there if an exception is never thrown.

Ketsuekiame 860 Master Poster Featured Poster

Hmm, I can only find a classic rock band from California. Is this you guys? (It appears to be a quartet and has a guy called Jim in it)

Ketsuekiame 860 Master Poster Featured Poster

Take the value, mod by 10 add to result, divide original result by 10 (ignore decimal place) iterate in loop until original value is 0.

For those of you who are interested in my on going "One Line Challenge", this can be done on a single line.

Ketsuekiame 860 Master Poster Featured Poster

According to specification, a TCP/IP connection has no requirement to idle timeout.
You're now essentially saying "I'm expecting data to be received within 20 seconds, otherwise, something went wrong."

The OS or network card itself will handle the underlying connection when this happens and in some cases could take this to mean "The connection has been lost" and close it.

You have two solutions;

  1. Remove the timeout, there's no need for one unless you're expecting data every x [milli]seconds. To remove the problem of threads not joining because of the read block, Shutdown <--- IMPORTANT and Close the socket before you try to join. This will cause the Receive method to abort and throw an exception. A little bit dirty, but within spec.

  2. Sending a simple "PING-PONG" every x seconds that goes by without a data-send, for example, would be sufficient to keep the connection open without worrying about the timeouts.

I would personally go with option 1. Option 2 can get complicated even though it may seem simple at first.

Ketsuekiame 860 Master Poster Featured Poster

No but it sounds interesting. Are you in one?

Ketsuekiame 860 Master Poster Featured Poster

I believe it would be fairly easy to host your own Mercurial server.

Ketsuekiame 860 Master Poster Featured Poster

Probably means the join is failing. Check that your User table contains SiteIDs that are contained in your Sites able where the firstname is equal to what you're searching for.

Also, when you execute this look at what LINQ to SQL is generated using SQL Profiler. You can execute this against the database and see if you're getting any results.

If you aren't, then there is probably a problem with your data. For comparison, running the following query is equivalent;

select
    u.FirstName,
    u.LastName,
    u.Username,
    u.Password,
    s.SiteName,
    u.Active
from [Users] u
inner join [Sites] s on u.SiteID = s.SiteID
where u.FirstName = 'Name to search for';

If you run this, you should get some results, if you don't, then it is definitely a data issue :)

Ketsuekiame 860 Master Poster Featured Poster

Sounds like the LVDS board is dying/dead. If you can take it back, do so. If not, you could probably buy a replacement board from HP, but it might be cheaper to buy a new monitor.

Ketsuekiame 860 Master Poster Featured Poster

Your padding is unecessary as you are parsing it to an int. 000001 simply becomes 1 once parsed. If you need to retain the leading 0s then you need to store the data as a string, not a number.

Also, you could use String.Format("{0:000000}", row[0]); as it looks a little neater, but this is personal preference. Using PadLeft is generally more correct as the intention behind the code is clearer. This won't fix the problem though, just another way of doing what you're currently doing.

Ketsuekiame 860 Master Poster Featured Poster

You could try installing the VB6 runtime. It's a long shot but it might be a corrupt/missing library issue: Click Here

Ketsuekiame 860 Master Poster Featured Poster

Your stuttering and speeding up issue, is more than likely the connection between you and the server. That's probably not something you can fix unless it's a problem with your router.

As for the freezing up issue, I also use 8.1 and have had no issues. What I have found, however, is that it makes the graphics card very hot for no particular reason (that I can see, it's not doing anything particularly complicated).
If you can, use the EVGA PrecisionX tool and clock your fan at 100% before you start the game and if possible (if you have a second monitor for example) keep an eye on the temperature of the card. If it doesn't crash, the problem is that your fan auto-speed isn't getting high enough to cool your card down.
I have to admit though, that this is unlikely to be the problem. If you were overheating enough for a driver crash, you'd probably get some screen flicker rather than a hang.

Have you tried re-installing the game? It's possible some of the files may be corrupted.

Ketsuekiame 860 Master Poster Featured Poster

So what exactly happened when you were debugging?

Ketsuekiame 860 Master Poster Featured Poster

You need to use the OnSelectedIndexChanged event. This will allow you to grab the current selection from the combo box as it changes.

You would then put this value into your data container so that when you "Submit" your component to the database, it will contain the correct value.

Ketsuekiame 860 Master Poster Featured Poster

If you want to use a single DbConext, then you must do just that all the way through the application.

It sounds like the DbContext has cached the previous version of the model and you've updated the model but bypassed the DbContext (so the cache hasn't updated)