|
With classes, some variables, methods and a whole host of semi-colons. Hopefully you'll throw some algorithms in there as well.
This space for rent
|
|
|
|
|
|
|
|
 Your answer is contained in the text below:
bxIpOAZvrvLsWNTKAecZLbZZHkmgjiEuZxaHyGwzfSTrtdAHFRBBIoFqvncYZnJMQbxFaCJmIulOTsQU
WDmQMnhsEBqnmIEvfYVqFBirsSJhHIYYRkqNajTeWDAxVKkuxSPbHiaHHyrOWjdlFjQhmBRdfnjqaEPd
FXgEJBraarSxWmaYuJPBaRCgDszOoKfDfCQvvPJmehLfTCCjcwzOPopWQiqMxWKnhEdxEBrLdOFNJMsp
thwrEmkUNpuwsYaJPOfgVpxbBcuStoSVcdkLegIBSsFdbZkuFsdpwvlGttRXAagoPQvMjaMFhvKkwXex
WYhUEedrZTdKlzIIWqWgLDMKLOnVwaawcOShcnlUwfbZXyFiwxqcfFrtVVczjPaFQYpnMBLYVUIPDCuu
ZXzobkLrcUkvxfVPUJfYquzekEtlSqEOZcwSlVRqNObDSaxOuwhdXJBCZaIJTUYYIPUFtBtEnpzEeQcv
YAzyggmIFcVClIdihsZeKxILMTZUbWmOFJzrdCkDluFPQccHitPbrZzBHYpPDeAKafWUKWFJZUZkanPo
CcPuxsMGRxhVygHwChSEZBmPcYyLKOpeARvmgskmAdSSIqYMdXtkfrXqUfSSVPZqRGTvaXliyafAnyfO
IHgIzcEzPMbrOoONEJzimEqAVThdmvoubDTeGvOrEbUUBVwTKbhUfWIBJtGvNfghojXdydixZlWReTxi
HIEcWkIcpoCdJBfeNnIgCYWzOCDAvqQxJYIsSrQUrchhZOQIVEtgTefsDvmNoalXitgDXwPmoMiAfupG
zJtwDzbeefPksMgFvYihBqJrubilEysTEkQKLjvhfjYfEJjQQWAzjDDbSFSAjLSufmnNzcPGFqiJKQfL
IWpeEhNRlYZVPZNjKUSAeIwAOWaeJCxshXQBZhYKTmFRGcEYSlbGQzsFnEXRLYWVLxTNRTrMCjMWvhXM
opirWiVMCzdpUUczHjyTcXFQOYlGJbeCsGigduIhzHKhQhYpaWNBSBGUmReNileciVqRSidIndJXzQOX
cZzhBlwaTcQEYpZqkRCJsDVLQcnLYbwyTkOWgQgcKdrXIChVyngQvrNJwQBBGGswZrDiPUhXAIoLOhNx
kSZxYeRtPbogSmjzEkVbVniuwPBoyfCiVQdknwhlZNSYLScfCkbnOvTIeiMrxMHGAJQDmADpiTyNXULw
yXZqWfqHTVdpUrJQdpiciXieMLjzKHlVeitSMRARtamzNTIwuQPlyGUCxYDfbLPERnsBpcDxODLWCTDR
ZRlXnQPVzPYotwoyiusgrtLqtbnloimfztjHAfDmdQUEOMHXGhAbDitFwxUMKokECEjXfeEbxgXavsot
nCSoEGJVMUtAtHfHgTpumDgQiNFfVkltbGMshuoXfCNyabgOszybizznxAGGoesfncrHKviJAMADfrfT
iKajGnLwJcrBmAoiccJRalvVZLWoswVNwEpqGDHXloVEMxLWTmutGvzLBnLOePilcHoiRvleLYfvUVWh
PhUmgCnHVkxRuDBIofLkfUBkAYKThJkoaIWXZbyAUmubYCVnZvyPKNfOHUNoYOLZIIUjAgwKZUKcebfG
ZQzTnKxwWdQkCtkvJCBWcHnTIrkehwYXtcPHUXlyAgwIunMZhEREcQlBStqjRosfjCRkiJOrVhiMJkQC
YyYomrZsIPqmkizQAbCkQNzEfPRircNLbWXpMbhwcTECKXeFTlvvMtQlzKLRADhUuhgurwuBwmbffIyI
MHLPRMkgsQvyIwYWKxgFzebmDiWYcrWIZvyroegTvHMuVFEvKwyXPZpHOpGXEmqdmQFLVHUzwRxyTtIh
hhKXodSTKEWLdbfOvVFuirWsGFZgfMdqPtvIwmeDwWLYWVuIktUJiQWuNMZpvJAvkiqtbShdITxYDOrr
xqKexxQkkAgwVmbLMrfWLYtuzOkrjAFMxbREyqHzrNvtCDHgNKWzHFSjgtfDrOCVamABgDbVZslVDLuj
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Step 1: follow the question/answer guidelines of the forum (first 2 posts of each forum)
For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside < p r e > < / p r e > tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
|
|
|
|
|
I've read that it's not a good idea to fire an sync method from a property, yet I see plenty of places where I would want to do this.
For example, at the top of my Contacts view I have a Search field bound to a ContactSearchValue string property. When the user enters a seaarch value I reload all the contacts that match.
To do this I call LoadContacts from the settter of the property. Because LoadContacts is async I get a compilation warning saying "Because this call is not awaited, execution of the current method continues before the call is completed" This is OK beause it in a property settings and there's no other code.
Anyone have any thoughts on this?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
It is not a good idea because it is fire-and-forget. Unit-testing this kind of code is a pain or plainly not possible.
But yes you can do it... Just be aware of the bad stuff that may happen.
|
|
|
|
|
How else would you reload the contacts when a search value is entered?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
It is mostly done in the SearchCommand... Which is triggered if the user hits the enter key or if a small amount of grace period has passed.
|
|
|
|
|
That seems like a lot of work - hook up a command to a property to fire a method??
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
It just sound like a lot of work, but it isnt.
If you have fire and forget async methods in the property, you can't control what they are doing. You don't know if there are started or finished or whatever... If you have somewhere code that depends on the result of your fire and forget code, then you will looking for bugs that you will never find.
If your fire and forget code is just updating visual stuff (like icons or colors...) then well go for it... If other logic depends on it... Don't do it. Well actually you can do it, if you a fan of bugs. Debugging is a fun hobby. More fun if you are debugging asyncronous code.
On top of that... Fire and forget code is very hard (most of the time impossible) to unit test.
|
|
|
|
|
Kevin Marois wrote: I've read that it's not a good idea to fire an sync method from a property
Did you mean "async method", not "sync"?
|
|
|
|
|
Yes
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Any searching I do, usually incrementally on a separate thread, gets invoked from the "text changed" event of the target textbox. Keyed input get queued or discarded depending on what the "search" is doing at any given time. The search might involve a web service (e.g. postal addresses).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Hi everybody,
I have implemented a Icommand RowHeaderToggleButton in my MVVM application type.
My problem: whenever I click on the toggle button, nothing happens.
Could someone help me with this issue?
Best regards,
Hervend
xaml:
<datagrid.rowheadertemplate>
<datatemplate>
<togglebutton x:name="RowHeaderToggleButton" cursor="Hand"
="" command="{Binding RowHeaderToggleButtonCommand}">
c# (inside view model):
public AlarmsListViewModel(DataBase dataBase)
{
this.dataBase = dataBase;
this.alarms = new ObservableCollection<alarmviewmodel>();
foreach (Alarm alarm in this.dataBase.Alarms)
{
this.alarms.Add(new AlarmViewModel(alarm));
}
this.ListOfAlarms = CollectionViewSource.GetDefaultView(this.alarms);
if (this.ListOfAlarms == null)
throw new NullReferenceException("ListOfAlarms");
this.ListOfAlarms.CurrentChanged += new EventHandler(this.OnCollectionViewCurrentChanged);
}
#region Fields
private readonly DataBase dataBase;
private readonly ObservableCollection<alarmviewmodel> alarms;
private readonly ICollectionView ListOfAlarms;
private ICommand rowHeaderToggleButton;
#endregion //Fields
...
public ICommand RowHeaderToggleButtonCommand
{
get
{
if (this.rowHeaderToggleButton == null)
this.rowHeaderToggleButton = new RelayCommand(() => this.RowHeaderToggleButton_Click(), () => this.CanToggle());
return this.rowHeaderToggleButton;
}
}
private bool CanToggle()
{
return true;
}
private void RowHeaderToggleButton_Click()
{
DataGridRow row = this.ListOfAlarms.CurrentItem as DataGridRow;
if (row.DetailsVisibility == Visibility.Visible)
row.IsSelected = false;
else
row.IsSelected = true;
}
|
|
|
|
|
Where do you bind the DataTemplate to the class? I.e something like:
<DataTemplate DataType="{x:Type local:AlarmsListViewModel}">
|
|
|
|
|
Hi Kenneth,
Thank you for your reply. Actually for me the DataTemplate concept seems a little bit hard to handle when dealing with some types of objects. And, in this specific case, a simple toggle button in the MVVM approach.
The range of the DataTemplate is limited to the toggle buttons associated to the rows of the DataGrid. that's the reason why I didn't have added extra arguments to it. But as I already stated, I'm still struggling to understand the way of correctly applying the DataTemplating.
|
|
|
|
|
Hervend wrote: the toggle buttons associated to the rows of the DataGrid
Ah, I didn't notice that bit. The problem is that the RowHeaderTemplate does not inherit the DataContext (ItemsSource) set on the DataGrid: DataGrid.RowHeaderTemplate Property (System.Windows.Controls)[^]
So it is recommended to use a Style instead (you might have to change the syntax as Im typing from the top of my head):
<DataGrid.RowHeaderTemplate>
<DataTemplate>
<ToggleButton x:Name="RowHeaderToggleButton" Cursor="Hand"/>
</DataTemplate>
</DataGrid.RowHeaderTemplate>
<DataGrid.RowHeaderStyle>
<Style>
<Setter Property="Button.Command" Value="{Bidning RowHeaderToggleButtonCommand"/>
</Style>
</DataGrid.RowHeaderStyle>
|
|
|
|
|
Hi
How to get notification/alert window,while working in application C#
I want to get meeting schedule alert(particular logged in user if he has meeting) every one hour before the meeting.
I am getting data from database.
The process is executed using 'exe' application using windows services
but I do not know to execute windows services and call the 'exe' application and make alert window
Can you please help me to find the solution
Thanks and Regards
Ramachandran
|
|
|
|
|
The problem is that if this is a service app, it can;t have any user interface, or interact directly with the user in any way - in fact there doesn't even have to be a user logged in to interact with when a service is running. Nor can a service app start a non-service app which does have a user interface. So you can't do what you want without having a user application running which the service can communicate with to handle the user display.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
If your question is about an app running on a server "pushing" notifications to users running your client-side app, start here: [^]
If your question is about client-side apps that read some time-stamped data from a server, then need to trigger a notification, consider a SystemTray app: [^]
If you clarify your question further, that will benefit all of us,
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|
|
You can create a Windows app that gets started at Windows startup, runs hidden or as as icon in the taskbar, queries the db on a timer, and "shows" when there is an announcement.
"Closing" the window only hides it, and shows itself again with new announcements.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I'm working on a program that needs to model polynomials. The program has a Number class, and an Integer class that derives from it. There is some polynomial behavior that applies to polynomials with any Number coefficients, and some, like getPsuedoRemainder(), that applies only to Integer coefficient polynomials. This seemed to me like a natural application of class inheritance. I tried a structure like this,
class Polynomial<T> where T : Number
{
List<T> Coefficients { get; }
public Polynomial(List<T> coefficients)
{
Coefficients = coefficients;
}
}
class IntegerPolynomial : Polynomial<Integer>
{
public IntegerPolynomial(List<Integer> coefficients) : base(coefficients)
{ }
}
with the operations that apply to both classes, like addition and multiplication, defined in Polynomial<t>* and the Integer-specific ones defined in IntegerPolynomial. However, I ran into trouble choosing appropriate return types for the operations defined in Polynomial<t>. For example, the sum of two Polynomial<number> objects needs to be either another Polynomial<number> object or something that is castable to one, and likewise for IntegerPolynomial objects. This is the case because I need to be able to, for example, add two IntegerPolynomials and call getPsuedoRemainder() on the result. In order for the Polynomial<number> case to work out correctly, as far as I can tell that leaves me the choice between the following two signatures:
public static Polynomial<T> operator +(Polynomial<T> a, Polynomial<T> b)
public static Polynomial<Number> operator +(Polynomial<T> a, Polynomial<T> b)
The latter obviously doesn't also make sense for the IntegerPolynomial case. The former almost does, in that it would return Polynomial<integer> objects, but I've found that it isn't legal to cast from Polynomial<integer> to IntegerPolynomial.
Is there a way to tweak this structure so that the types work out? Or is there a much different structure that would be more appropriate?
*The preview shows every type I have in angled brackets inline in paragraphs as lower-case even though I typed them all as upper-case, as in the code examples. If you see the discrepancy, note that it isn't meaningful.
modified 6-Jan-18 4:19am.
|
|
|
|
|
If IntegerPolynomial overloads the operator+ too, then the problem of them adding to a "less useful type" is solved. It can pass-through the implementation, it just has to convert back to an IntegerPolynomial in the end.
Which leads me to: you can cast them, just not by a "free" type change. A Polynomial<Integer> isn't an IntegerPolynomial so you can't take an instance of it and change the type, but you can add a conversion operator to IntegerPolynomial so that it can be created out of a Polynomial<Integer> (creating a new instance with the same contents). Though this requires that Polynomial<Integer> is not the base class of IntegerPolynomial, so it's a bit annoying. Basically it trades being able to convert "for free" and code-sharing for the ability to convert in any direction.
|
|
|
|