|
Luc Pattyn wrote: I think it belongs in the "do not use" category.
You only think that. We'll leave that in the toolbox, and let the OP try it out if he can't come up with any alternative; as long as he lets me know what his application is called so I can avoid downloading it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I would like to be able to join math variables. What I mean with this is that, for example, the following can be joined (I don't know if this is actually called joining):
2x^2 - 5x^2 + 2x + 3x - 5 + 6
join to (is equal to):
-3x^2 + 5x + 1
Is there a library or does someone have a code snippet for such actions? If you have a hint or an easy trick, also please tell me. Thanks.
|
|
|
|
|
The process you're talking about is called simplifying. I would assume it's done by going through each element (where element 0 is 2x2, element 1 is -5x2, etc) and making a note of each unique index (the power). When you encounter an index that's occurred before, add the current element to the unique element that's got the matching index and move on.
After that you just need to display it. With this, you just iterate through the list of unique elements and print them.
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Thanks very much for your suggestion. It's a great idea of performing the action, however, I tried using Regex to make an ordered list (array) of all items:
+2x^2
-5x^2
etc.
The expression is ([+-])(.*)x\^2
It works well, but now I have to simplify them - I will try doing so.
|
|
|
|
|
Just a note regarding your Regex. You're assuming that the letter following the number is always x, that there is only one such letter, and that the power it's raised to is always 2. If you move on to more advanced equations, like 2xy<sup>4</sup> - 3x + 4xy<sup>4</sup> , then you'll have to alter it.
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
You're completely right. However, I am just creating a small application for the so-called abc-formula, and you just enter the formula instead of only a, b and c in most tutorials (then you have to calculate yourself anyway). It only works with quadratic formulas, therefore I have 3 static regex's (for x^2, x^1 and x^0; respectively a, b and c). It is going well by the way.
Thanks.
|
|
|
|
|
Hi All,
I am writing a small app that shows a dialog when its tray icon is clicked. The problem is, on Windows 7 the NotifyIcon does not appear at all. I checked both the normal tray and the hidden icons. It is not there. I also checked the visible property of the icon, both at designtime and runtime. Also, any balloon tips to be shown are not shown.
Any help in this matter would be appreciated.
Thanks.
~ Soumya92
|
|
|
|
|
Be sure you've assigned an icon to NotifyIcon component. Unlike Form s, there's no default icon for tray icons (so they won't show unless you've assigned one).
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
That was indeed the reason for my problem. Stupid of me not to see it.
~ Soumya92
|
|
|
|
|
I'm attempting to use managed code from unmanaged code using clr hosting.
This works fine but I'm having trouble creating one specific type.
I've gleaned the following values from the HResult, but can't find out exactly what the error code means.
Can anyone help?
hresult = -2146232828
severity = 1
facility = 19
error code = 5636
Thanks in advance!
M.
|
|
|
|
|
You seem to be getting a COR_E_TARGETINVOCATION exception. It's not a well documented exception; have a read of this[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks for the answer...that was the problem.
Some dependent assemblies were missing from the GAC.
|
|
|
|
|
foxymop wrote: Thanks for the answer
No problem. I'll tell you how I figured it out, so you know what to do next time - I converted the error code into hex using Windows calculator - enter the value in decimal, convert it into decimal and change it to a DWord. I searched for the HResult of that value, in corerror.h. From that point, it was easy to google on the "friendly" name and identify issues with it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks. I had been wondering how you achieved it, as I once created a tool that calls FormatMessage(), however it did return null/nada/Nothing for this error code.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi Guys,
I've got two config files for a winforms app:
app.release.config
app.debug.config
I copy these into the appropriate folders using the following post build event:
if $(ConfigurationName) == Debug copy "$(ProjectDir)app.debug.config" "$(TargetPath).config"
if $(ConfigurationName) == Debug copy "$(ProjectDir)app.debug.config" "$(TargetDir)$(TargetName).vshost.exe.config"
if $(ConfigurationName) == Release copy "$(ProjectDir)app.release.config" "$(TargetPath).config"
if $(ConfigurationName) == Release copy "$(ProjectDir)app.release.config" "$(TargetDir)$(TargetName).vshost.exe.config"
This works if i only build the project, but if i run the project as well, then the files are replaced by the origional app.config.
If i change it to overwrite the app.config file (Either pre / post build):
if $(ConfigurationName) == Debug copy "$(ProjectDir)app.debug.config" "$(ProjectDir)app.config"
if $(ConfigurationName) == Release copy "$(ProjectDir)app.release.config" "$(ProjectDir)app.config"
Then it overwrites the app.config file fine, but doesn't actually copy it to the output directory.
Any thoughts? This should be a common problem that's got a solution right? It's driving me crazy
Regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
modified on Friday, August 14, 2009 6:17 AM
|
|
|
|
|
i am developing the billing module of a clinical management system.i have a data grid in my windows form in which the bill details are generated automatically..i want to pass some of the person details and the datagridvalues to the crystal report so that i can take the printout.how can i pass the values to crystal reports from the windowsform.The datagrid values are taken from seperate seperate tables in the database
|
|
|
|
|
Please don't cross post questions. It generally doesn't help you get an answer any faster and can result in multiple locations to find an answer to the question. The original question is here[^].
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Anyone ever have an issue with signtool.exe where it freezes up?
I'll run it one minute and it doesn't work, then a few minutes later it works fine. Also, suspiciously Internet Explorer will stop working.
I've already ruled out anti-virus software.
|
|
|
|
|
The SignTool can also go out to a website that provides a timestamp. Perhap's you're having internet connection issues?
|
|
|
|
|
That could be.
Although IE doesn't work Chrome accesses the internet fine. Maybe it's an M$ thing.
|
|
|
|
|
Hi,
We need to export the content of a docx file (MS Word 2007) to docx/HTML in sharepoint portal. For this, we are evaluating using System.IO.Packaging library available in .Net 3.5 WindowsBase assembly. We can identify text in the document and export it. However, we are still not finding any easy way out for exporting images, tables, attachments etc. If you have any solution to the problem or working experience with packaging library, please let me know. This is urgent.
Thanks,
Bijon Roy
|
|
|
|
|
I came across some great articles about merging wave files, but unfortunately the wave files I use are imported by the user. Therefore, it is quite likely that one wave file has a different sample rate/bps than the other one. When I try to merge them, Windows Media Player cannot play them, most probably because they have different sample rates/bps. How would I go about making the wave files have the same sample rate/bps as each other, in .NET, so they can be merged properly?
Thanks.
|
|
|
|
|
It depends on the quality you want to achieve, and whether you want to do it in real time.
* for very low quality, simple sub-sampling will work
* for medium quality use linear interpolation of samples
* for high quality, use a more complex method such as sinc interpolation
There are some useful resources here...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Thanks, I'll use your suggested web site.
|
|
|
|
|
hi,
I am using .net 1.1 version.
The problem is i have used one datagrid which contains some data columns and one checkbox column.
Datagrid contains nearly 50 records and 50 checkboxes.(i.e) each record contains checkbox.
below the datagrid an image button is placed.if i didn't select any checkboxes and click on the image button it should tell please select any two checkboxes for compare.
how to do this if i used .net 2.0 then the OnClientClick event can be used but i am using .net 1.1 so please any one help me....
Regards,
Prakash
|
|
|
|