|
Start with SOLID and you won't go far wrong.
|
|
|
|
|
Actually , I have switched from java domain to C#,will it ok if i use the java design principle??
|
|
|
|
|
What do you mean by Java design principle? What's a Java design principle? Do you mean, should you use the same tricks in C# as you do in Java? Well, that depends on the situation as .NET does some things differently and you should follow the .NET way of doing things. If you're talking about designing applications, then use SOLID and, where appropriate, use relevant design patterns.
|
|
|
|
|
perhaps you need to elaborate more on your question. What do you mean exactly when you say "design principle" ?
|
|
|
|
|
How about:
1. Form follows function
2. An application should fit the tools used to build-it, the users who will use it, and the people who will maintain and extend it ... like a custom-made glove fits the hand.
3. Less is More.
4. Achieving simplicity is more complex than achieving complexity.
5. If not you: who ? If not now: when ?
6. Both the wild-eyed dreamer in you, and the compulsive fanatic for order and correctness in you, need breathing room in the conceptual and design stages of an application; if you don't know how to play either of those two roles, or both: get someone else to play them.
7. Know the future users of your application: their skills; their limits; their backgrounds.
8. Put out welcome-mat saying: "Unknown welcome Here !"
cheers, Bill
«If you search in Google for 'no-one ever got fired for buying IBM:' the top-hit is the Wikipedia article on 'Fear, uncertainty and doubt'» What does that tell you about sanity in these times?
|
|
|
|
|
Hi all, I have a web service that used to work but stopped working when I migrated to a new computer. The new computer comes with Windows 8.1 and IIS Express. I made sure that I got everything I need by selecting every option under IIS.
I installed the same version of Visual studio (VS 2012) on the new machine and tried to run the same web app I had in the old machine. When I click a button which makes a call to my web service, nothing happens. I found out through Fidler2 that the problem was
"Data at the root level is invalid. Line 1, position 1."
I have searched online but none matched my situation. Basically all I'm trying to do is send text from a regular html page in the form of JSON to the web service. Then the web service will modify a text file on the server using the text it received. I know the code in the web service works because I called it directly in Visual Studio and it worked fine.
Please suggest a way to fix this problem, thanks in advance
modified 19-Nov-14 10:15am.
|
|
|
|
|
Sounds like mal-formed XML. Have a look and give an example.
|
|
|
|
|
Hi, thanks for responding. I am not reading or writing any XML. In fact even after removing all the code in the webmethod of my webservice except for the return statement
return "Success!"; I still get the same error.
|
|
|
|
|
Yes you are, you just don't know it.
Have a look in your web.config file and you'll probably file the XML in there is messed up.
|
|
|
|
|
Hi, thanks for replying. I validated the webconfig file and it is actually valid. It turns out the problem was in the url in my ajax. I copied and paste the webservice url from Visual Studio and it appears a couple of letters were automatically tacked onto the url between the webservice name and the webmethod name. Once I removed the extra letters everything worked fine.
|
|
|
|
|
|
Hi, thanks for replying. You got me thinking for a minute there with your question
"JSON is XML, is it not?"
According to json.org JSON is not XML, it's an alternative to XML.
Also the website
http://searchwindevelopment.techtarget.com/definition/JSON-Javascript-Object-Notation
says the following:
"JSON was originally based on the Javascript programming language and was introduced as the page scripting language for the Netscape Navigator Web browser"
modified 19-Nov-14 13:08pm.
|
|
|
|
|
|
I would suggest your survey include possible "null" use-cases by asking questions with negative answers like:
Are you familiar with BDD, and have you used BDD:
1. No
2. Aware of BDD through media
3. Familiar based on reading articles, or documentation
4. Familiar, and actually used a BDD tool
5. Familiar, and using BDD tools now
Have you used BDD:
1. No
2. Once
3. More than once.
If you have used BDD, but would no longer consider using it again:
1. You would not use it again because of performance issues
2. You would not use it again because of code complexity and maintenance issue.
3. You would not use it again because of errors produced by a specific BDD tools
4. You would not use it again because you no longer see any value in it
5. You would not use it again because your work no longer requires it
Have you used more than one BDD software tool:
....
And, so forth.
«If you search in Google for 'no-one ever got fired for buying IBM:' the top-hit is the Wikipedia article on 'Fear, uncertainty and doubt'» What does that tell you about sanity in these times?
|
|
|
|
|
I'd give you a fail simply for asking what someone's "gender" was.
|
|
|
|
|
I'm trying to use the Native Wifi for continuesly reading the signal strength.
If i run the code below in a fast loop, it quickly crashes with below msg. If I move the "client" object instantiation out, and only do that once, it does not crash. However it's not updating the value correctly. If I turn of the wifi on the remote device off, this is not recogniced until i shut down my application. Only then does my pc-wifi-client remove the remote wifi device from the list.
How can i continuesly read the signal strength of a specifi SSID ?
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in DynamicData.exe. Additional information: An attempt was made to establish a session to a network server, but there are already too many sessions established to that server
public uint Wifi()
{
signalStrength = 0;
WlanClient client = new WlanClient();
foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)
{
Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
foreach (Wlan.WlanAvailableNetwork network in networks)
{
if (GetStringForSSID(network.dot11Ssid) == "NAME")
{
signalStrength = network.wlanSignalQuality;
}
}
}
return signalStrength;
}
|
|
|
|
|
The answer is in the exception:
Nikolaj jensen wrote: An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in DynamicData.exe. Additional information: An attempt was made to establish a session to a network server
So what else is running? Are you opening connections and leaving them open?
You will need to look at the entire program and not just this method.
|
|
|
|
|
Hi All,
Am 2+ years experienced in asp.net,webservices and ado.net and am planning to take an MCPD certification.Can you please suggest me which .net framework version to choose and can you suggest me which exam code should i apply for?
Thanks,
Navatha.
|
|
|
|
|
|
Member 11245746 wrote: Can you please suggest me which .net framework version to choose I think you should always target the most recent one.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have a device that sends a value:
V_rms: 120 v
I can use a terminal on my PC and see it through my serial port.
Now, I would like to make a software of my own version to see it on a window like this:
__________
V_rms | 120 |
|__________|
(A square with the value)
Can you please guide me to start to build such GUI?
Is C# a good option to use? I use Visual Studio as an IDE. Do you have another better option such as MATLAB maybe?
What do you think?
Thanks in advance!
|
|
|
|
|
It should work fine in C#, if you already know the language.
See the SerialPort class for starters: MSDN[^] - the link contains an example - it should handle the communications pretty well.
Display is also pretty trivial - but I'd get the comms part working first, as that's likely to be the most complicated (and hardest to test).
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
While I use Visual Studio C#. Should I choose Windows Forms Application? I got a little bit confused. Let's take a look at the following example.
<a href="http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.datareceived(v=vs.110).aspx">http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.datareceived(v=vs.110).aspx</a>[<a href="http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.datareceived(v=vs.110).aspx" target="_blank" title="New Window">^</a>]
Where should I copy and past this piece of code? Because when I use Forms I got many errors!
|
|
|
|
|
WinForms is not a bad idea - it's probably the simplest after a Console app.
And the example there is a Console app - so you can't just "copy and paste" it and expect it to work.
You could copy and paste it into a Console app and it should compile cleanly (but you need to look at how it works and combine that with your task rather than just trying to code by copy and paste - that really doesn't work for anything more than trivial applications regardless of language)
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Oh shoot! Thanks for the explanation!
|
|
|
|