Click here to Skip to main content
15,354,205 members

Comments by E.F. Nijboer (Top 200 by date)

E.F. Nijboer 18-Sep-17 12:27pm View
Simply use the Substract in instead of the minus (-) operator.
d1 - d2 -> d1.Subtract(d2)
E.F. Nijboer 9-Jun-17 16:09pm View
No, sorry. Maybe post a new question here on codeproject with some code to help explain the problem.
E.F. Nijboer 23-Jan-17 18:30pm View
Pretty old post, but happy it could still help you out :D
E.F. Nijboer 22-Jul-16 11:51am View
Please edit the question and add some markup for your code. Also, add the the error message the compiler gives you and highlight the line where the error occurs.
E.F. Nijboer 15-Jul-16 17:19pm View
Make sure the platform of both and c# projects match (so they have matching language runtimes). Also check if they still default to "anycpu". Also, not sure the ByVal might cause the problem. Maybe try it without to see if it has any effect.
E.F. Nijboer 1-Jul-16 13:08pm View
Best solution for controlling the date/clock is to use a DateTimeProvider instead of DateTime.Now directly. That way you would normally have it return the current date and time but for tests you have complete control over it.
E.F. Nijboer 29-Jun-16 18:11pm View
Might indeed be the case but sadly unable to confirm. You should be able to download the deprecated database driver from one of the links anyway and give it a go. Maybe worth a try.
E.F. Nijboer 19-Feb-16 5:38am View
It is no surprise that the longest and most unreadable code line is giving you problems and is almost impossible to debug... Split up to smaller code parts using well named variables and functions and you will most likely find the problem before even needing to run it again. Also, the exception message is quite clear. The value "Reference(" clearly cannot be converted to Double.
E.F. Nijboer 10-Feb-16 9:56am View
In another reply I read about tables with very much data. You should really consider other options like partitioning, which is supported by mysql, sqlserver and many others. Sharding is also supported by both and many others. This is the same concept but involving multiple database servers. Splitting tables manually really is a poor man's solution.
E.F. Nijboer 10-Feb-16 5:29am View
This removes any newline characters that are still in the inputbuffer before calling the getline (because it would otherwise read the getline and be done).
E.F. Nijboer 8-Feb-16 10:45am View
by asking the right question... The title of your question says nothing about your actual question. Also, just run the code to get the answer. Looks like a school assignment so you should just do the work needed and learn something.
E.F. Nijboer 4-Feb-16 12:27pm View
By default ReadAllText will try to detect the encoding but fails (probably because it will try to load the text as utf-8). See link for more info.
E.F. Nijboer 4-Feb-16 3:53am View
Then you must read and write the file wioth the corrent encoding. For UTF-8 you need to specify Encoding.UTF8 as parameter both when reading and writing.
E.F. Nijboer 1-Dec-15 12:14pm View
Happy to help :)
E.F. Nijboer 30-Nov-15 11:17am View
I did, so please read check out the link. The code offers a perfect solution. It offers options as install, remove, debug and uninstall. The debug option means it starts the service in a console window! A perfect example of what you are looking for.
E.F. Nijboer 18-Nov-15 14:23pm View
Great! Happy to help.
E.F. Nijboer 18-Nov-15 12:56pm View
Ah, I see. I would advise to use a stack. It makes it very easy to keep track of the markers and makes it easy to validate the file. You can use an IndentedTextWriter to produce the formatted output.
I updated the answer with more on how you could process the source list.
E.F. Nijboer 18-Nov-15 9:26am View
I understand. I can see some structure but don't understand where "Anonymous marker" comes from. There is no way I could guess this from the original source. It seems like a closing marker is seen as a separate marker, right? Or is this the desired output? How to determine it should be an Anonymous marker?
E.F. Nijboer 18-Nov-15 3:49am View
Are you sure the same port is always used? (check if the port (and ip) is still and accessable, using a browser for example)
E.F. Nijboer 16-Nov-15 11:26am View
Why not use a linked list?
E.F. Nijboer 16-Nov-15 7:08am View
This is a school assignment and you should solve it yourself (or just quit your study)
E.F. Nijboer 12-Nov-15 12:14pm View
If you check out the search-highlight link, you'll find examples and a "launch demo" on the page.
E.F. Nijboer 12-Nov-15 4:46am View
%1 sounds like it is a missing cmd parameter. In cmd files you can use %1 to reference the first parameter. For example: app.exe param1 -> %1 would be param1. Maybe this gives you an idea of what is going wrong.
E.F. Nijboer 2-Nov-15 3:53am View
Well this is a nice example why functions should have meaningful names!

Maybe you can figure it out by looking up some methods for finding image threshold.
E.F. Nijboer 22-Oct-15 15:45pm View
You are completely correct about the data tier. I have seen projects using EF where a separate DAL was created. Indeed just pass-through code without any added value. (five stars on your comment if I could.)
E.F. Nijboer 22-Oct-15 13:01pm View
hmmm, it has been quite a while back using c++... and now you mention it, you're completely right. It seemed very logical to wrap a value type as a reference for reasons already mentioned. It would be just like boxing/unboxing in Java. But I have to admit I was, well... just wrong. ;-)
I appreciate you didn't give up on me so I learned something today :-D Thanks!
E.F. Nijboer 22-Oct-15 6:26am View
In this case the same point[] data but there is no guarantee. The code can easily change in such a way that they will be overwritten. There is simply no protection. When using AsParallel in the way it is intended, each thread is working with its own data and producing its own resultset. Never any worries and everybody understands what is happening. Relying on side effects is mostly bad, especialy when it is not needed. By the way, side effect means that you have a method that doesn't produce a result by returning it, but updating something it has access to (more like a global variable). Anyone having access to this global variable can update it whenever they like. It easily becomes harder to juggle the possible points where this global thing can be updated. Just something to keep in mind.
E.F. Nijboer 22-Oct-15 6:16am View
I think you're right that I might indeed have mixed up when it comes to usage of restrictions. So, that wasn't a valid argument for wrapping a fundamental type into a reference type. It is only a valid point that wrapping it into a reference type might give some benefit in using it. A number can be retrieved from a vector and you would be able to change the value. The Number object in the vector (referencing the same object) doesn't need to be written back into the vector explicitly. When using int or float directly it would be copied into a variable and you would need to write it back to the vector. Otherwise the vector would still contain the same value. Sorry for the misunderstanding.
E.F. Nijboer 21-Oct-15 18:41pm View
Now that you said I was wrong because templates can use fundamental types I saw that in my answer the "class T" was filtered out. I updated my answer and used html encoding so it is now visible. So what I meant that encapsulating the float in a Number class makes it possible to use them when a template class has this restriction.
E.F. Nijboer 21-Oct-15 16:42pm View
Well, in this case we might assume there won't be a problem. Using the Parallel.For is threading relying on side-effects for writing back values in a shared object. Instead of focussing on the actual task, it must also calculate/determine indexes to where it can write results. Also, if a more complex example would calculate a faulty index, it could overwrite or be overwritten and it would be much harder to find where it went wrong. It is very easy to complicate parallel code this way. Why not split it into separate pieces operating on their own data and returning their results when done? Just keeping the implementation clean without more effort. Anyone having to read your code later will thank you because they don't have to inspect the code on what it is doing and if it does/doesn't violate thread safety. It is much harder to understand for people other than the one who wrote it. So you're right not seeing any problems for now, but because it violates basic threading rules they will be coming soon... and others will have a hard time NOT seeing NO problems.
E.F. Nijboer 21-Oct-15 16:16pm View
Fundamental type would be a better name in the context of C++.
E.F. Nijboer 21-Oct-15 7:18am View
Why not try to run your code first?
E.F. Nijboer 20-Oct-15 11:12am View
Well... it depends, because often the Administrator account used is only a local account. Meaning it is no domain account and the database server won't accept it because it can't verify the account with the domain controller.
E.F. Nijboer 20-Oct-15 6:32am View
The "user" used to run the website must also have access to the database. You might want to create a new user (app pool) that can be used to run the website under in IIS and has access to your database.
E.F. Nijboer 20-Oct-15 6:21am View
Maybe you just told it the other way around by accident, but normally the one posting the data is the client. In this case the client would be Android. It is unlikely that the server can even reach out to the android device because it therefor must have a public IP address. So you probably want a webservice on a service that can be called from an android client so it can post data to the server, right? By the way, if the client (android) needs data from the server it can do this also as a request to the server. If you really need the server to push data to android, you should look into Push notifications.
E.F. Nijboer 20-Oct-15 5:36am View
Not a question and reposting won't help.
E.F. Nijboer 20-Oct-15 5:35am View
This is just a repost and not a good question. Just google for sources or try somthing yourself. When you try yourself you can come back and ask if you get stuck somewhere.
E.F. Nijboer 20-Oct-15 3:43am View
That's way to much code for a question. You need to pinpoint where the error is happening. Run the app in the emulator with the debugger attached.
By he way. Try it without ps.Show() and pd.Dismiss()
E.F. Nijboer 16-Oct-15 6:07am View
But you need to surround it with another set of quotes for javascript. The ones you have now are for your java code.
E.F. Nijboer 15-Oct-15 7:27am View
Check out the FileHelperAsyncEngine. It works line by line without reading the file at once.
E.F. Nijboer 15-Oct-15 3:34am View
Manas_Kumar, I think you can add this as answer.
E.F. Nijboer 12-Oct-15 3:47am View
This link might hopefully also give you some idea:
E.F. Nijboer 11-Oct-15 16:44pm View
The idea is to simply create a service and also add a normal main method. Compile it to exe so it will be a valid program and can also be used as a service because it has the needed entry point.
E.F. Nijboer 9-Oct-15 8:04am View
So specific for xiaomi note 4g using another browser. Would be hard to solve because you have no control over it. Looks like the api isn't completely following the standards. Maybe you could report this as a bug to them.
E.F. Nijboer 8-Oct-15 9:51am View
I think the solution would be the same idea. To be a service you need to have a SvcMain. By adding a normal Main you also create a console application. You would need to compile it to an application (not a library).
E.F. Nijboer 8-Oct-15 9:43am View
I would seriously advize you to start using descriptive names for variables (also goes for functions and classes. Here encode could mean anything). temp and temp3 are of type int and temp2 is of type string. v and v2 are suddenly there without nobody knowing where they come from or what they are. The function name is not descriptive AT ALL. What should this function even do? How could anyone have known? This code is very hard to read and therefor just bad code. Bad code (as you might have noticed yourself) is very hard to understand and (nearly) impossible to debug. Good coding starts with good naming!
E.F. Nijboer 8-Oct-15 8:56am View
You probably need to enable 32bit. Check this link:
E.F. Nijboer 8-Oct-15 8:50am View
Did you try on another phone? Or other/new emulated phone instance? Maybe it is just the phone you use. All I know is it should ask you what source to use. Also, maybe the camera is used by another app and therefor unavailable (although it would be strange that the video recorder is available when the camera is not). Might also want to try rebooting the phone anyway.
E.F. Nijboer 8-Oct-15 3:48am View
Normally you get to choose between video, camera or choose existing. Maybe you choose a default input method and maybe that could be the reason you don't get a choice anymore.
E.F. Nijboer 7-Oct-15 3:46am View
But then the file must be in the same directory as the running program or it must be able to find it in one of the directories in the PATH variable.
E.F. Nijboer 6-Oct-15 7:13am View
For that you need to use html5 upload features. This also requires the server to support it to work.
E.F. Nijboer 6-Oct-15 7:09am View
I would say normalization for a relational database. (
E.F. Nijboer 5-Oct-15 10:07am View
Have you tried anything with Wordpress already? Maybe try the forum, faq or support page of Wordpress?
E.F. Nijboer 5-Oct-15 7:09am View
This isn't good question. What have you tried yourself? Otherwise, complete open source blog software exists already. Just try google.
E.F. Nijboer 5-Oct-15 7:07am View
Looks like you already posted this question earlier. You can update a question if needed. No need to repost. Please remove this duplicate.
E.F. Nijboer 1-Oct-15 7:54am View
Then just use /passive instead of /qn as you already found out yourself. Otherwise you need to explain a bit more.
E.F. Nijboer 29-Sep-15 12:46pm View
You need to use a while that will get the next record each time using Check out this link with the exact example code you are looking for. :-)
E.F. Nijboer 28-Sep-15 7:11am View
If it is just the layout page, as you say in the title, it isn't worth the trouble merging the projects in a single solution. How often does the layout change? Is normal communication impossible in the team? Easier to agree that changes in the common layout should always be done in one of the two layouts and the other will always be updated with the newer version.
E.F. Nijboer 14-Aug-15 4:17am View
Looks like the value of a and the result you want are the same. Also, what have you tried so far?
E.F. Nijboer 10-Aug-15 11:10am View
This isn't a good question. What have you tried? Where did you get stuck? First try google and try to find out for yourself. If you get stuck at some point you can come back and ask help about that specifically.
E.F. Nijboer 6-Aug-15 12:03pm View
No, that is also not possible and you already have access to the variables you declared earlier. If you want to iterate over the items you could consider using an array for example.
E.F. Nijboer 5-Aug-15 5:42am View
Looks like a school asignment...
E.F. Nijboer 5-Aug-15 5:40am View
"Hello world"

(this isn't a very good question)
E.F. Nijboer 4-Aug-15 11:08am View

The example for Calendar creates an auxiliary for 2008 and also adds workday information. After that is shows to easily count all the workdays. You could use the same sort of mechanism.
E.F. Nijboer 4-Aug-15 10:56am View
It is not what this site is about. The people on codeproject (including me) aren't going to write the code for you. We try to help you in the right direction but it still is up to you to do the programming. otherwise you just need to hire a developer somewhere.
E.F. Nijboer 31-Jul-15 4:46am View
You do understand that index is zero based? Meaning that when you enter 3 as index, it is item number 4 in the list? So if the list contains 3 items the index can be 0, 1 or 2.
E.F. Nijboer 30-Jul-15 5:05am View
FileStream and StreamReader are actually kind of a design flaw in A FileStream is an actual stream but the StreamReader is not. It is a confusing mix of dependencies and the designers of the .net framework admitted that it seemed usefull at the time but didn't work out as they had hoped. So keep that in mind when looking for a way to convet it.
E.F. Nijboer 29-Jul-15 13:27pm View
no problem :-)
E.F. Nijboer 29-Jul-15 11:46am View
Lets say you have a service called svc with methods a(), b() and c(). Now you want to add a new method d() but you cannot add it directly because you don't have the source of svc? A solution to this problem is to create a decorator service, called svc2. You add the methods a(), b() and c() to your svc2 and when called you redirect the call directly to svc (and the return value from svc back to the client). in svc2 you can now also expose your new method d() with your own implementation. Now svc2 is a decorator for svc, as it enhances the original svc with all the existing stuff and also adding new stuff. Also google for decorator pattern.
E.F. Nijboer 29-Jul-15 8:28am View mvc is a server technology and serves pages to clients. Those clients view those pages in the browser. In the client browser you can't run c#, there is only javascript. So your limited in what you can do. My guess would be that the solution below is the best option you have. Other options would require plugins to be installed into client browsers.
E.F. Nijboer 29-Jul-15 4:35am View
Could be indeed, but us guessing indicates this isn't a very clear question.
E.F. Nijboer 29-Jul-15 3:52am View
If you don't want an mvc answer, what mvc are you using then?
Also, mvc and c# are server side, taking a screenshot is client side (browser).
E.F. Nijboer 29-Jul-15 3:29am View
this is very unclear. What is the actual question?
E.F. Nijboer 28-Jul-15 7:08am View
I can't see the code you work on but if you look at the code in the links I gave you, there is a for loop that will initialize the columns. Is says: DataColumn datecolumn = new DataColumn(column); where the "column" parameter is the column name. The name of that column must be unique, otherwise when the datasource is usaged it cannot reference a column properly. Also, try google to check out what an error means. If it is simply "not working" then nobody can't help you and no code example ever will.
E.F. Nijboer 28-Jul-15 4:29am View
Try naming your columns. You need to create the DataSource dynamically.
E.F. Nijboer 28-Jul-15 4:27am View
I then think your read on the serial port is hanging simply because nothing is received. Maybe try add some logging to figure out where the code is hanging and also try to look for asynchronous examples for reading the serial port.
E.F. Nijboer 27-Jul-15 9:52am View
Sounds like homework and shouldn't be that hard to find out.
E.F. Nijboer 27-Jul-15 9:39am View
Same example here as answer:
E.F. Nijboer 27-Jul-15 9:38am View
You can add DataColumns to the dataSource and fill it up. Check out the link. The answer you look for is in te question :-D
E.F. Nijboer 27-Jul-15 3:31am View
Try managed compatibility mode (see link for more info):
E.F. Nijboer 23-Jul-15 4:07am View
No need to post this question twice.
E.F. Nijboer 22-Jul-15 11:23am View
If you have the sourcecode of both server and client it won't be a problem running them on the same machine for test purposes. If for some unexplainable reason this somehow is not possible you can always resort to a virtual machine as a virtual second development system.
E.F. Nijboer 21-Jul-15 12:38pm View
I would suggest running the WCF service locally in visual studio so you can debug it. Also run the client locally and connect to the local service. This gives you a better view on what is happening (and goes wrong).
E.F. Nijboer 21-Jul-15 3:29am View
your question in unclear. Please be more specific.
E.F. Nijboer 20-Jul-15 8:08am View
I don't think your question belongs here. I think you need to check under Help -> About or Suggestions.
E.F. Nijboer 20-Jul-15 8:06am View
It doesn't even look like you put in any effort at all.. what have you tried? Where did you get stuck? CodeProject isn't a code conversion site or something. You need to be more specific.
E.F. Nijboer 20-Jul-15 8:04am View
Seems like the operation takes more than a minute to complete. You need to optimize it or increase the timeout (as needed) on both the server and client.
E.F. Nijboer 20-Jul-15 5:55am View
Check out the eventlog on the target machine (the system running the wcf service).
E.F. Nijboer 17-Jul-15 9:24am View
You don't see a goto ofter these days. The school you are going to has some really old assignments I guess.
E.F. Nijboer 17-Jul-15 9:20am View
looks like an else without an if
E.F. Nijboer 17-Jul-15 4:23am View
Very unclear question. Please elaborate.
E.F. Nijboer 9-Jul-15 3:48am View
Looks like you already got your answer, so no need to use sql at all.. otherwise, this is a school assignment and you should do it yourself to learn something.
E.F. Nijboer 2-Jul-15 7:21am View
What is the error? Try to add as much info as possible.
E.F. Nijboer 18-Jun-15 12:13pm View
Nice you already found it. Good luck hardening your code and making it thread-safe!
E.F. Nijboer 17-Jun-15 12:55pm View
Great :)
E.F. Nijboer 2-Jun-15 9:55am View
Check here for more on screen orientation:
E.F. Nijboer 28-May-15 11:06am View
Not sure what you mean by writing c functions in assembly because you can't write c functions directly in assembly. So that is somewhat confusing. Did you check out the CCES examples for your processor model?
E.F. Nijboer 27-May-15 15:45pm View
I'm sorry. Must have looked at the wrong component. Luckily you did find your answer :-)
E.F. Nijboer 27-May-15 7:00am View
This isn't a question. What have you tried yourself?
E.F. Nijboer 17-Apr-15 12:08pm View
What did you do to initialize array[0]? How did you declare it?
E.F. Nijboer 16-Apr-15 8:06am View
Try executing it and you'll know if it is correct. I guess that is the whole point of this homework assignment.
E.F. Nijboer 14-Apr-15 10:02am View
You should ask this question directly on the article page because the author of the article might not (probably won't) read this. Look for "Comments and Discussions" on the bottom of the article page.
E.F. Nijboer 8-Apr-15 6:54am View
You need to be more specific. Also, what have you tried yourself?
E.F. Nijboer 3-Apr-15 12:06pm View
Great! Happy to help you out :-)
E.F. Nijboer 3-Apr-15 5:53am View
I added some additional info and example code to my answer.
E.F. Nijboer 3-Apr-15 5:43am View
School assignment? Try google first. If something then still is unclear you can ask a specific question about it here. This question is too general and clearly you haven't put any effort in it. I put more effort in this comment!
E.F. Nijboer 2-Apr-15 10:48am View
Need a little more context i'm afraid. Please explain.
E.F. Nijboer 18-Mar-15 11:57am View
Sounds like some kind of school assignment. Also, the question is pretty unclear. What have you tried yourself? Where did you get stuck?
E.F. Nijboer 18-Mar-15 8:39am View
Sounds like a school assignment. What have you tried yourself?
E.F. Nijboer 9-Mar-15 13:19pm View
Great I could help you out!
E.F. Nijboer 9-Mar-15 6:30am View
This is a little to vague to understand. Maybe some code example of what you are doing might help. You can use "improve question" for that.
E.F. Nijboer 3-Mar-15 7:17am View
Great. Maybe I can help.
E.F. Nijboer 2-Mar-15 4:26am View
I would recommend to first investigate what already exists and what/how you want to measure and what you will be able to do with it. My advice would be to first work out a system on paper before beginning to code.
E.F. Nijboer 24-Feb-15 12:25pm View
Are you sure? You can check it using oleview.exe
Check this link for more info:
E.F. Nijboer 23-Feb-15 14:08pm View
Next time you'll probably post the question after just an hour of sweating it yourself :-)
E.F. Nijboer 23-Feb-15 12:37pm View
Yes, now I also see in your original code in the question $result needed to be checked first before calling mysqli_num_rows($result), like this:
if ($result) {
if (mysqli_num_rows($result) > 0) {

But luckily you already found a solution :-)
E.F. Nijboer 23-Feb-15 7:35am View
This is a bit too much for beeing a programming problem. These are just functional requirements of what you should build. What is the actual programming problem you encounter?
E.F. Nijboer 23-Feb-15 5:27am View
How about using the task scheduler?
E.F. Nijboer 17-Feb-15 12:23pm View
You now create a new FormDefineWord form each time the user presses F3. You could create this form once and hide it instead of recreating.
E.F. Nijboer 17-Feb-15 9:57am View
But that isn't a timer. The form needs to be completely ready. Other option is to create the form and hide it (instead of recreating it)
E.F. Nijboer 17-Feb-15 8:09am View
As I mentioned in my comment abbove, I think D is also false but for another reason. The answer states: "Before destroying an object, the GC calls its Dispose method.". It does not say the object does implement IDispose and therefor you cannot assume Dispose is called.
E.F. Nijboer 16-Feb-15 12:13pm View
Ah okay, but then the information should be available in the book itself.
But to help you out, I also think the answer is D because this only is true if you actually implement IDisposable.
E.F. Nijboer 16-Feb-15 11:44am View
Looks like homework. This is something you can (or should be able to) figure out yourself. Good luck!
E.F. Nijboer 15-Feb-15 16:34pm View
Your comment is very late in the discussion, as this question/answer goes back to 2010. Using TPL might be a good way to go. But this question was more about using more threads than cores when the actual tasks are processor intensive instead of i/o intensive. Even then someone can make the mistake in forcing tpl to use 3 threads and still lose performance. But TPL can help in a great way indeed.
E.F. Nijboer 11-Feb-15 7:07am View
Don't worry about that. Also, ArrayList is untyped and list is more safe and also reccommended. You can use a list in all kinds of situations with all kind of types without the need to convert them back. Much easier and type safe.
E.F. Nijboer 5-Feb-15 9:53am View
E.F. Nijboer 5-Feb-15 9:53am View
You can find examples here on codeproject, for example this one:
E.F. Nijboer 4-Feb-15 9:29am View
So the teacher actually gave an example that was already the answer... nice ;)
E.F. Nijboer 4-Feb-15 7:55am View
But the example link you gave (to DOES use entity framework already.
E.F. Nijboer 2-Feb-15 12:12pm View
How about including the type?
Topic ABC = JsonConvert.DeserializeObject<Topic>(test);
E.F. Nijboer 2-Feb-15 9:24am View
I would really advize you to read up on proper handling of values used in your sql statement. A well known joke about it can be found on xkcd:

Have a look here:
E.F. Nijboer 2-Feb-15 9:19am View
Sounds like a school assignment. Try google, it shouldn't be that hard to find the answers.
E.F. Nijboer 2-Feb-15 9:11am View
Are you creating a test site to explain SQL injection? Or is this a serious attempt to create a website?
E.F. Nijboer 29-Jan-15 7:16am View
Not a clear question. In ssms you can use "estimated query plan".
E.F. Nijboer 27-Jan-15 7:56am View
E.F. Nijboer 27-Jan-15 7:53am View
Add it to the commandline:
E.F. Nijboer 26-Jan-15 14:11pm View
You can simply use the concurrentbag for example and add items safely. You could also have a look at the blockingcollection because it has examples how to implement the producer/consumer pattern. It just takes some time to fully understand and get good experience with threading. Simply try the examples shown and go from there. Also, the Sleep method isn't really helpfull in normal concurrent programming. You should avoid it because it is for real low level use only. Maybe one exception is for test purposes to simulate long running tasks. Also, just keep thinking like how it would be in the real world. Sleep won't help with 2 or more people from accessing some resource. Therefore some locking mechanism needed to protect a shared resource. Have a look at the dining philosophers problem ( for example. There are also a lot more examples to find from there.
E.F. Nijboer 26-Jan-15 12:17pm View
Use Concurrent collections instead:
E.F. Nijboer 26-Jan-15 8:25am View
Hopefully you understand I'm not going to rewrite your code. The link shows how to do it. Please try yourself and if you get stuck you can ask again here on codeproject.
E.F. Nijboer 19-Jan-15 12:30pm View
I don't think it is possible and also something that shouldn't be done. Maybe you can try creating an alias for the System namespace.
E.F. Nijboer 19-Jan-15 12:28pm View
Ah, seemed for me like the only option. I'll remove the answer after this reply.
E.F. Nijboer 19-Jan-15 10:04am View
I recently read "Android Programming: Pushing the Limits [Erik Hellman]" and I would recommend this book as an excellent reference on that. In the final chapter this is all covered. Also the other questions you have are excellent explained in this book (backup, moving to another phone etc...). I'm normally not someone to promote books or anything here but this book is actually quite good on those subjects. It also has some good examples how to use the real-time multiplayer API. This might also interest you I guess. The book is really good in some of these hard subjects.
(As a side note: I'm not affiliated or get anything for promoting this book, just think it could really help you out)
E.F. Nijboer 14-Jan-15 12:11pm View
Ah, you already used the TwoLetterISO. But if the current method works it works :-)
E.F. Nijboer 14-Jan-15 8:22am View
I personally would go with the TwoLetterISORegionName or ThreeLetterISORegionName. Also, even though a server might be configured towards UK/US, they might have certain settings configured more local. Maybe a check on currency could help out for example because they both have a different kind of dollar. Just another idea you might want to consider. It might also be helpfull to get send RegionInfo and CultureInfo from all the servers and compare and analyze them.
E.F. Nijboer 14-Jan-15 8:12am View
Don't include your email address. Answers will be posted here and prevents you from a lot of spam.
E.F. Nijboer 14-Jan-15 3:48am View
No problem :)
If this answer helped, please mark it as answer.
E.F. Nijboer 14-Jan-15 3:46am View
This is not a good question. First of all it sounds like a school assignment. Second, you should show some code or anything you tried yourself. Nobody is going to do your job or school assignments.
E.F. Nijboer 6-Jan-15 7:34am View
No idea exactly what your trying to do but the C root of windows is protected nowadays. You need admin rights to create files there. Try creating a file in a subfolder of your drive (not the windows folder)
E.F. Nijboer 6-Jan-15 7:29am View
A lot of code blocks and not very clear to see what happens when. Try setting a breakpoint and step through it using the debugger. Check the values and parameters in the sqlparamcollection to see what and when it happens.
E.F. Nijboer 17-Dec-14 10:18am View
Correct. But, you need to be carefull with static declared arrays because you could get a stack overflow exception id the array is too big. In that case you need to allocate the array on the heap and... with that comes the responsibility to free it after.
E.F. Nijboer 12-Dec-14 9:17am View
Have you tried anything yourself? Where did you get stuck?
E.F. Nijboer 12-Dec-14 7:29am View
Are you also sure there are no different versions on the machine? If System.DirectoryServices.Protocols.dll can also be found in the GAC or another place the CLR looks, you get an error if it is not exactly the same version.
GAC dir: %windir%\assembly
E.F. Nijboer 12-Dec-14 4:30am View
Check this link for more info:;EN-US;q257757#kb2
E.F. Nijboer 12-Dec-14 4:26am View
Are you sure the exact same version is on the machine?
E.F. Nijboer 11-Dec-14 11:05am View
Go for it! (but this is not really a question)
E.F. Nijboer 11-Dec-14 9:38am View
Could you provide more info (like the actual error you get)?
E.F. Nijboer 11-Dec-14 5:54am View
What did you try yourself? Where did you get stuck?
E.F. Nijboer 10-Dec-14 4:25am View
Have you tried google?
E.F. Nijboer 10-Dec-14 4:18am View
Doesn't the debugger give you any more info? Also, there is no need to repost this again.
E.F. Nijboer 10-Dec-14 4:14am View
Your question is very unclear. You should elaborate and show what you found yourself/tried.
E.F. Nijboer 10-Dec-14 4:13am View
This is not a question
E.F. Nijboer 4-Dec-14 11:31am View
I removed your email from the question to save you from a lot of spam. Also, the question should be answered on codeproject for future reference and people having the same question.
E.F. Nijboer 3-Dec-14 3:51am View
It is very unclear what this is about. If this a question about code you got from an article here on codeproject, you should post your question there.
E.F. Nijboer 30-Nov-14 14:20pm View
Would be best to post a new question with the code you have tried. Looks like you invoke at the wrong moment because it should all be in the method that should be invoked.
E.F. Nijboer 29-Nov-14 8:29am View
I'm sorry but you'll have to try yourself first. If you run into any problems you can post a new question with the code of what you have tried and ask for help. I can't just recode it for you, it's not how programming works.
E.F. Nijboer 28-Nov-14 13:32pm View
The code you posted with the question isn't something to handle in a background worker because it interacts with the UI. To call it from a background worker just add the code into a method of the form. Add the InvokeRequired around the code and invoke if needed. There are suitable examples on the msdn page. Have a look at the SetText example. It only has a single parameter but you can easily do the same and add more parameters as needed. Just give it a try ;-)
E.F. Nijboer 27-Nov-14 8:17am View
There isn't much else to do. It could just be an installed program checking for updates on system startup and then shutting down. If you are really suspicious and have some spare time you could reinstall windows as a last resort.
E.F. Nijboer 27-Nov-14 5:37am View
Somebody can only actively spy on you if the program is running. You could check the task manager (ctrl+shift+esc) and choose to view processes of all users omn processes tab. If it is running it should be there.
E.F. Nijboer 27-Nov-14 4:58am View
This is a very unclear question.

Maybe try start -> run -> msconfig and have a look at the startup tab. Be carefull though because you can easily render your system useless if not done with care.
E.F. Nijboer 26-Nov-14 7:19am View
Be aware that this abuses a get request, therefor not secure and has a limit of +/- 2kb (depending on the browser used by the client and the maximum size of the get request accepted by the server).
E.F. Nijboer 25-Nov-14 7:18am View
This sounds like homework and can easily be found using any of the available search engines. This isn't a question for codeproject. What have you tried? Why would you assume advantages? Or why do you suspect disadvantages?
E.F. Nijboer 24-Nov-14 12:41pm View
Mentioning distributions could indeed be somewhat misleading. I didn't have time to elaborate as much as you did ;-)
E.F. Nijboer 24-Nov-14 8:33am View
Use developer tools of chrome or firefox firebug to step through the js code to figure out what is happening.
E.F. Nijboer 21-Nov-14 12:32pm View
Yes indeed, also very important to get it all working.
E.F. Nijboer 20-Nov-14 7:39am View
Maybe try: String.IsNullOrWhiteSpace(p.User_First_Name)
E.F. Nijboer 22-Oct-14 8:12am View
Nice school assignment... good luck with that.
E.F. Nijboer 17-Oct-14 10:30am View
For local use AppCmd might be usefull for you:
E.F. Nijboer 17-Oct-14 8:49am View
There are monitoring options in IIS ( but another option would be a load balancer ( The loadbalancer can monitor failed requests and uses heartbeats to check if the server is still up and running. It might be an idea to check it out.
E.F. Nijboer 17-Oct-14 8:48am View
There are monitoring options in IIS ( but another option would be a load balancer ( The loadbalancer can monitor failed requests and uses heartbeats to check if the server is still up and running. It might be an idea to check it out.
E.F. Nijboer 17-Oct-14 5:43am View
Sounds like you just want to hack the computers of others and gain access to their systems...
E.F. Nijboer 16-Oct-14 10:18am View
You just posted the question again. Please remove this incomplete version.
E.F. Nijboer 14-Oct-14 4:49am View
No problem :)
E.F. Nijboer 30-Sep-14 4:13am View
I'm on a project using t4 right now and it is extremely dependant on visual studio itself. I don't think you can run t4 without it (as it would be a blessing). If you find an answer on how to do it I'm extremely interested!
E.F. Nijboer 26-Sep-14 4:36am View
The problem seems to be the timeout. You would need to setup the serialport again for the 2nd write. You keep it open but the other side stops listening after 70ms, so I would suggest to just reinitialize the connection or change the timeout on the receiving end.
E.F. Nijboer 17-Sep-14 7:33am View
......................................Try to open a file using a and b and see what happens.
E.F. Nijboer 17-Sep-14 7:19am View
But you didn't actually try something.
E.F. Nijboer 9-Sep-14 10:12am View
try logging in using management studio and/or check out some of the examples here:
E.F. Nijboer 1-Sep-14 9:33am View
Ah yes, sorry. Try change your code in ToUnixTime to this:

return Convert.ToInt64((date - UnixEpoch).TotalMilliseconds);
E.F. Nijboer 26-Aug-14 9:01am View
Try using AutoGenerate. Check the link. On the bottom of the page in the remarks you find an example:
E.F. Nijboer 19-Aug-14 9:56am View
What do you mean with (byte)'!'? Do you want to convert a byte to hex representation?
Try this:

byte b = Convert.ToByte('!');
String hex = b.ToString("x");

Try to check the results first to see if this is what you need. If you just want to add an exclamation (!) there is actually no reason to first convert it to byte at all, just add "!" directly.

It might also be easier to first write one byte at a time because it should matter. Something like:

Does this result in what you want?
E.F. Nijboer 19-Aug-14 7:04am View
Try that question in google:
E.F. Nijboer 18-Aug-14 9:07am View
Your question is very unclear. Please be more clear. What does "make an image" actual mean for example?
E.F. Nijboer 8-Jul-14 9:23am View
Would be nice if you included the error. Click improve question to add more details.
E.F. Nijboer 8-Jul-14 9:22am View
This isn't a good question. Nobody is going to do your job here.
E.F. Nijboer 2-Jul-14 10:01am View
We don't have the textbook that came with your homework assignment. Check in there for answers.
E.F. Nijboer 2-Jul-14 9:58am View
Nice homework assignment...
E.F. Nijboer 2-Jul-14 7:04am View
We cannot see what you see on your computer. It is very unclear what the problem is. What have you tried? Where do you get stuck? Please click "Improve question" and elaborate.
E.F. Nijboer 24-Jun-14 3:51am View
We can't see what you see on your screen. Check the fonts used in your form. Did you change it?
E.F. Nijboer 23-Jun-14 11:04am View
Your question is unclear. Please explain your problem with more details.
E.F. Nijboer 20-Jun-14 7:35am View
You should go to the article and ask on the bottom of the page. You can post remarks on the article page which will notify the writer of the article.