|
PM88 wrote: 4.Use MVC architecture for designing.
Why? One of the worst pieces of advice for someone is generally "use pattern x on this project" before the project requirements have been defined. You should never go into a project having picked patterns to follow because you end up constraining your design and you might have to contort it to fit an unsuitable architecture.
|
|
|
|
|
Agree, decision of architecture and design pattern is vary by project.
Thanks
-Amit Gajjar
|
|
|
|
|
Hi,
Sorry for the mistake.I defined this one since it was mostly used among Dot Net developer these days.I would like to take back this point.
|
|
|
|
|
It's used commonly by .NET web developers you mean. WPF and Silverlight developers tend to steer clear of it, Winforms developers will not have done much with it and server side developers will have steered clear of it.
|
|
|
|
|
There are many application in the market. if you do something different that people may not have seen before that may impact more. If you want to earn more credit compare to your other class friends you need to think beyond the usual application development. Your idea is not bad but you can find many opensource application in the market with the shopping cart or database applications.
I suggest you to work in any opensource community to provide them help to create some modules or may be some functionality. But first get approval from your project guide. Creating project from scratch is not the only option. First you need to identify any of the community and the functionality they are looking for.
Second option is to work on some algorithm that are not implemented in C#. You can also convert any existing C/C++ library and publish as an opensource. that will also gives you credit from many developers.
But the primary thing is to convince your project guide.
Thanks
-Amit Gajjar
|
|
|
|
|
I would go for the movie database. A webshop application can become very complex.
For extra credit I would create it more as a media library that can also contain books and CD's for example. (and then tie those together).
Also if you're allowed, create something like a flashy WPF (or winforms) instead of web. It removes the problems of sessions, client/server code etc...
Don't get me wrong, don't set the level too low, but my experience is that applications tend to be more complex than you imagined them to be, especially when you're still junior.
hope this helps.
|
|
|
|
|
My file contains data like:
First name: ahmed
Last name: nasser
City: giza
i created a flat file schema to parse this file, but the element store all the line.. such as
<Fname>First name: ahmed</Fname>
<Lname>Last name: nasser</Lname>
i want the element to store only the value without the label ..to be like this:
<Fname>ahmed</Fname>
<Lname>nasser</Lname>
How To do that using Flate File Schema.. BizTalk?
|
|
|
|
|
The script needs to visit a series of game retailer websites and input some keywords into their search boxes. Then it yields the product results sorted by price in an HTML table in a separate page. The resulting HTML table is a list of the accumulated results.
The goal is to obtain a sorted overview of the total result set, sorted by price so that the cheapest version of the game (lowest price) is visible on the top of the list.
How would I begin coding this?
Is another implementation language recommended (Javascript, AHK, Selenium, etc.)?
|
|
|
|
|
|
I am using c#.
I want to print bill of a shop which contains dynamic data.
currently i am converting it in pdf,saved it in a folder & then print it.
what i have to do so that i can directly prepare a bill format using c# and print it without saving & converting it into pdf.
I think i can use datagridview.
Is there any better option rather than using datagridview.
|
|
|
|
|
Look at using the PrintDocument class[^] - the link includes an example.
This message is manufactured from fully recyclable noughts and ones. To recycle this message, please separate into two tidy piles, and take them to your nearest local recycling centre.
Please note that in some areas noughts are always replaced with zeros by law, and many facilities cannot recycle zeroes - in this case, please bury them in your back garden and water frequently.
|
|
|
|
|
I want to write some trace messages to a text file. The same methods could be called in different places. So, if I have something like method A calls B calls C calls B calls E calls C calls D, E, F, I'd like my trace file to show an indentation like this (assume the full stop implies a space character):
A
.B
..C
...B
....E
.....C
......D
......E
......F
Edit: I forgot to mention there's no recursion and the calls to C might not even get called, that sort of thing.
So, method C is called in different places and I'd like to reflect the "depth" where its called from. An old trick is to have a global variable that you increment/decrement but that's really messy. It's not essential that I do what I'd like but it would make the trace file easier to read if things are indented. I know it's a daft question with a limited shelf-life but if anyone does know a quick trick that'd do it for me, I'd be happy to test it.
Tks.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
modified 3-Sep-13 11:37am.
|
|
|
|
|
I suppose you could mess around with StackTrace[^] and its FrameCount property. It requires no changes anywhere, but it's crazy slow.
|
|
|
|
|
It's doable, but not practical.
Every one of your methods that participates in this scheme would have to pass around a "depth" field. Every time a method that uses this field is called, it would have to pass the current depth to the next method, where one of the first things the callee does is increment the depth.
I'm not liking this as is neccessitates passing an extra value into each method and each method would have to be custom implemented to support this, possibly interfering with your logic, but certainly adding a bit more complexity and duplication in your code.
I don't see any other way to do this, but I could be wrong.
[EDIT]
I just thought of something. You might be able to use the StackTrace for the current depth in some logging component, but don't count on it being accurate as you'll also be counting depth into calls that do not belong to your code.
|
|
|
|
|
Thanks guys. I did some research and I did find some suggestions to use the stack frame count. I think I'll bail out from my indentation idea as performance, while negotiable to a degree, can't be degraded too much because idle-time interrupts in the device could kick in. A few are ok because there is some recovery and resending but I don't want to sail too close to shore. Thanks again for confirming my options.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
SeptimusEjjog 151576 wrote: I want to write some trace messages to a text file.
I suggest you research logging APIs instead.
|
|
|
|
|
BitLogger is on the proverbial radar.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
One aspect of your scenario, abstracted to a general level, is: how to prevent recursion when method #3 ... invoked by method #2 ... invoked by method #1 ... "may" call method #1 ? imho, while you state your scenario is not recursive, reading your list of possible calls suggests it might be potentially recursive, and that you are doing something to prevent recursion.
Another, more probable, interpretation is: that you do have a non-recursive scenario here: because the methods are invoked as a result of the user's asynchronous direct actions on interface elements at run-time, so a call to any method may be followed by a call to any other method. I believe that if you wish to represent that as a "tree:" in a "literal" way: there could only be one "root node" (the first method called). Of course nothing "stops" you from treating every call to any given method as a "root node:" it's your choice.
But, on the basis of the information you supply, I can only guess at what's going on in the code, and whether you do, or don't, have to deal with potential recursion.
In general, I would "react" to code that implements an elaborate mechanism to prevent recursion, because it has to, as poorly designed code, most likely in need of re-factoring.
Have you considered, as an alternative to using an integer "level count" variable (which I don't see as "that big a deal"), using something like a .NET Stack data-structure when tracing is activated, and then pushing something onto the stack when any method is called; and, then, parsing that stack when you wish to create your text log-file ?
In WinForms writing tab characters into a text-file is simple "\t\tTwo tabs," and these could be shown at run-time in a WinForms TextBox if its 'AllowTabs property is set to 'true. Or, a WinForms RichTextBox can give you much finer-grained control over tabs, by setting them in code.
good luck, Bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
Bill, thanks your valuable input. My example I gave was quite coarse and didn't truly reflect what my code looks like but I wanted to eliminate the possibility of recursion. That method "C" for example is a lower level chunk of code that reassembles and decrypts some bytes from the device and once that's done, it could call another method to handle some endianess flip/flops on some bits of data.
For expediency, the trace output data is written with a couple of spaces as it's useful to me to separate the higher "what's been requested" from "what's being done". Once the whole thing is bedded down and running smooth (as well as molasses running uphill could ever run smooth ) then the detailed tracing will fade away but will still be configurable as an option.
My particular need to is to find out why a stable deep-rooted socket one moment is like tumbleweed the next.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
Hi, I'm glad you found my response useful in some way.
It seems to me you have at least two separate concerns here:
1. "I wanted to eliminate the possibility of recursion." ... that implies to me you do have possible recursion, and, either you have already handled that in some way, or you haven't. I am not sure, from what you've described, whether you have, or have not, controlled possible recursion ... satisfactorily.
2. "why a stable deep-rooted socket one moment is like tumbleweed the next." ... my guess is that could be "framed" as a separate question for this forum, and, if accompanied by a detailed description of what's happening, and what you need to achieve, and how what you are doing now is, possibly, not working, or "fumbling" on "edge-cases:" I'd expect you could get some good answers here. But, not from dolts like me, to whom sockets are mysterious alien entities.
Is it possible that your scenario here includes handling simultaneous multiple streams of incoming data ? Bernard H.'s question, asking whether you are dealing with multi-threading here, is also quite important, imho.
I assume that once you have "trace history" built/working the way you need/want (using a Stack, or Tree, or whatever, data structure), then parsing that trace history, and formatting a text-file output in any way you like, using tabs, spaces, etc., is a minor concern.
Being a "treeview junkie," I use tree data-structures (and, in WinForms, a very powerful 3rd. party TreeView Control, or (from the same 3rd. party), a combination ListView/TreeView Control, whenever possible.
I suppose one could actually write code to, at run-time, using Reflection, to actually modify every method "marked" with some attribute like [TraceThis] to also push an identifying integer onto a stack, but I shudder at the thought of doing that: that would require going into the "world" of ICustomAttributeProvider, and then dealing with issues like those described here: [^], or here [^]. I have not yet done this, and hope to avoid doing it: my guess is the "cost" of doing that would be greater than the cost of parsing the call-stack dynamically.
yours, Bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
Bill, I identified the "tumbleweed problem" a short while ago and I kick myself for not finding it sooner. The device I have the socket connected to demands a ping "keep alive" interval. I have that value in the app config file, say, 1000s for example but my ping thread sleeps for 9/10th of the time, 900 seconds. After the thread wakes up, it waits on a semaphore and usually gets it within a few seconds at most but it depends on the other thread to finish its work. If the other thread only finds a few records in the database it'll finish and release the semaphore allowing the ping thread to get in and ping the device where it then kips for another 900s.
It took a bit of time to go through several 100 lines of trace but on the "random" occasions the socket fell over, there were more records selected. Aha! But it wasn't always consistent. Eventually I saw it. The ping thread woke up and waited on the semaphore with 100s to go. If the other thread took 102s to process all the records, the ping was overdue and the device silently killed the connection so I got an exception the next time I tried to write to it. My bad! I wasn't really displaying enough information. I changed the interval from 9/10ths of the specified time to 1/3rd. It doesn't matter how often the pings take place but each time one is handled, the device resets its timer and ticks on until the next is due. Go overdue and the connection is toasted. I made the ping interval longer, 30m and at 1/3rd intervals I send one every 10m. That 20m period remaining will be more than sufficient for the largest dataset to be processed. In a sense then, I was sailing very close to shore and I scraped my keel on some rocks.
Call me Cap'n Calamity if you will. Think of the Costa Concordia.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
I had to vote this response up: you've got the poet's gift for metaphor !
I sense an excellent article(s) for CodeProject lurks in these dangerous rapids you're shooting the threads of.
yours, Bill
Google CEO, Erich Schmidt: "I keep asking for a product called Serendipity. This product would have access to everything ever written or recorded, know everything the user ever worked on and saved to his or her personal hard drive, and know a whole lot about the user's tastes, friends and predilections." 2004, USA Today interview
|
|
|
|
|
BillWoodruff wrote: I sense an excellent article(s) for CodeProject lurks
Bill, to be honest, it'd take a braver bloke than me to write an article. I've read many of them and quite often you get folks who'll line up your down vote button in their rifle scope and slowly squeeze the trigger. That, I can live with.
Then you get the good folks who'll barf at you because the content isn't deemed appropriate to the context. That I can handle because it's constructive.
There are good folks who'll encourage you and there are good folks who'll appreciate what you do. The rapids are indeed dangerous waters.
It's only once you roll the die do you see what happens.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
You could come close to that by logging each function in its first line ("Calling SomeFunction(params)") and its last line ("Exiting SomeFunction"). Well, that's not yet the nice indentation, but at least you could find out the call stack from the log. For a multithreaded application, logging a thread property additionally (e.g. System.Threading.Thread.CurrentThread.ManagedThreadId) may be useful.
|
|
|
|
|
Bernard, there are five threads involved. I emit the thread id into the trace file after the time stamp and it makes it a breeze to identify which thread is responsible for what message. It's very helpful.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|