Introduction Some jobs are tedious and errorprone. To avoid the errors we should unittest, but to avoid the tediousness we can make use of code generation. One such code generation tool is T4. It is available in Visual studio so why not use it? Well I can think of a few reasons. No intellisense no code coloring and no refactoring. But I guess we will have to learn to live with that. Or use a third party editor like the one from Clarius consulting. So I thought code generation would be a good fit for some of my factory classes I have.
This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.
Introduction Making a splashscreen in WPF is easy, since the .Net framework SP1 there is even a built in method to do this. But this method only accepts a static image. I would have liked a more dynamic thing. Something that says what it is doing. And something that fades in and out and has a custom shape. I’m not very demanding but I know this would be very complicated in windows forms. Possible but difficult. In WPF it seems a bit easier. So I went on a Google frenzy and combined several things I found along the way.
Waiting for your company to provide training courses or advancement opportunities? It might be a long wait. Unfortunately many companies overlook professional development or consistently sacrifice it when the first round of annual budget cuts occur. Even when we do get training opportunities, many of us continue to select classes at random, based on what seems interesting at the moment. We live in a field that is expanding daily, where the environment we work in is drastically different from what it was 5 years ago and from what it will be 5 years from now. Whether we plan on being in a different role or not, advancing our skills and staying in step with the market is a must.
This is your query on a rollercoaster. Not a fun trip and sometimes bringing a paper bag with you is a necessity. It really happens The scenario starts with a phone call from the support desk reporting failed integrations from the ERP system to the WMS system. This integration process is critical for the production of items with the company to fulfill orders and build inventory. Without the process, finished goods inventory is not posted and thus does not become available for sale. This causes a more detrimental effect on financial reporting and filters down to the revolving reason we are in business – making money.
I have been doing most of my frontend in windowsforms but I thought it was time to switch to WPF after all it is already at version 4.0 so most of the little quirks should be gone by now. First thing I did was to convert my dashboard over to it. I can use all the same controllers and model so I only need to worry about the views. On my dashboard there is a ListBox which shows the user some messages of the system (not that anybody really reads them, but it looks cool).
Today I was in the process of making my own copy-paste Analog clock. I went aruond the internet and found [this pretty thing][1]. Of course I could have used that code and gone on with life. But that was not the point of the exercise. I wanted to learn something of this. I liked the way he did the animations, no more need for a timer to update the angles, all is done in XAML.
Model-View-Presenter is an architecture pattern that defines a structure for behavior and logic at the UI level. M-V-P separates the logic of the presentation, such as interacting with back-end services and the business layer, from the mechanics of displaying buttons and interface components. I often build small projects to help understand and grow my skills as a developer, architect, and all-around technologist (as may be apparent from the wide range of topics I post on). Today I worked with a combination of Visio and Visual Studio to build a sample project to play with the Passive View concept and to help grow my own understanding of the concept. This post will cover the Visio side of my learning-curve.
Folks, please remember to refactor early and often… private Element ReadMemberExpression() { var queue = new Queue<Element[]>(); var newDepth = 0; var argsCount = 0; _scanner.CreateRestorePoint(); while (true) { _scanner.CreateRestorePoint(); { var a = ReadArguments(); if (a != null) { argsCount++; if (argsCount > newDepth) { _scanner.Restore(); break; } queue.Enqueue(new[] { default(Element), default(Element), a }); _scanner.DeleteRestorePoint(); continue; } } _scanner.DeleteRestorePoint(); var pe = ReadPrimaryExpression(); if (pe != null) { queue.Enqueue(new[] { pe }); continue; } var fe = ReadFunctionExpression(); if (fe != null) { queue.Enqueue(new[] { fe }); continue; } if (_scanner.MatchNext(Grammar.New)) { newDepth++; queue.Enqueue(new[] { Grammar.New }); } else if (_scanner.Match(Grammar.LeftSquareBracket)) { var e = ReadExpression(); if (e == null) { throw new ParseException(); } if (!_scanner.MatchNext(Grammar.RightSquareBracket)) { throw new ParseException(); } queue.Enqueue(new[]{default(Element), Grammar.LeftSquareBracket, e, Grammar.RightSquareBracket}); } else if (_scanner.Match(Grammar.FullStop)) { if (!_scanner.MatchNext(ElementType.IdentifierName)) { throw new ParseException(); } queue.Enqueue(new[] { default(Element), Grammar.FullStop, _scanner.Current }); } else { _scanner.Unwind(); break; } } if (queue.Count == 0) { _scanner.DeleteRestorePoint(); return null; } else { var element = default(Element); var children = queue.Dequeue(); while (children[0] == Grammar.New) { children = queue.Dequeue(); } element = new Element(ElementType.MemberExpression, children); while (queue.Count > 0) { children = queue.Dequeue(); if (children.Length == 3 && children[2].Type == ElementType.Arguments) { newDepth--; children[0] = Grammar.New; children[1] = element; element = new Element(ElementType.MemberExpression, children); } else { children[0] = element; element = new Element(ElementType.MemberExpression, children); } } if (newDepth > 0) { _scanner.Restore(); return null; } _scanner.DeleteRestorePoint(); return element; } }
Robert Davis (Twitter | Blog) has the control this month and who better to have it other than him. I’ve come to respect Robert greatly over the last few months (yes, had no idea who he was just a short time ago). That’s the point of community though, isn’t it? We meet these leaders and professionals daily and scale up and out endlessly. It truly has no limits and I’m honored to be part of it.
Many times as a database administrator, you’re going to find yourself being asked, “When did this change?” In fact, it is a common question that can come in so often, if you don’t have the answer readily available, the business will quickly become frustrated with you. This can have an adverse effect on your reputation of being able to manage the databases in question. Some databases (and software packages) simply do not track changes in the database. The job of the system is to do what the business wants and that typically does not initially include data tracking. Logging takes time and precious performance away from the systems. That performance hit can make a software vendor look bad. Is it worth the performance cost and cost to develop the tracking solution to them? I think we know the answer to that question in most cases. I’m on their side in the case of where you put your money for the product you provide to a point.