|
There are much better algorithms to solve Knapsack[^] and the related Subset Sum[^] (this problem). The pseudo-polynomial time DP algorithm is very fast on most practical inputs, and the approximation algorithm is tune-able to be as close to exact as you want it to be, trading off speed for accuracy.
|
|
|
|
|
Hello,
I would like to make infix to postfix calculator.
What I would like to make is like, If I entered the number on the calculator, 1+23*4=, then calculator form will show "1 23 4 * +".
And, I already made my own two program, these are calculator form, and converter infix to postfix program.
But, I don't know how combine two program.
Could somebody help me?
I uploaded two my program on the storage.
infix to postfix program
http://firestorage.jp/download/60346ca65783c9f87a086c362427c05bfdfea76d
calculator program
http://firestorage.jp/download/e636062b4f88508536aed645e85fdc9001e86f83
|
|
|
|
|
Sottyoru wrote: But, I don't know how combine two program. Just add the extra code as a new class or method to the one that needs it. I do not think anyone is going to download these files and do it for you.
Veni, vidi, abiit domum
|
|
|
|
|
|
I want to write a dll file in .net
when i write the dll file and add reference to the project.
I can simply see the whole contents of dll files.while debugging
My question is that i want to write dll file such that no one can see its contents or methods defination. just can use the methods of dll files.
|
|
|
|
|
You need to use obfuscation.
Here[^] is a list of obfuscators that you could consider using.
Note that even obfuscation is not a 100% secure way and users can still view your code.
|
|
|
|
|
Consider this. Suppose no one can see the contents, how does your computer know what to do with it? That could sort of be done, with asymmetric key cryptography, but let's hope that never happens. If people can't read your code, then how will viruses get caught? (on the other hand, how would you find an exploit?) How will backdoors be detected?
Because of the extreme value of the key (at least hundreds of millions, perhaps billions - remember, every virus writer and every government is going to want it), significant resources will be poured into cracking it, ranging from brute-forcing it with super-computers to inspecting the physical circuitry with electron microscopes to going after the source of the key with hacks / actual cloak-and-dagger spies.
It won't be safe for long.
This is not a scenario anyone should want. The only party that actually benefits from it is the one who finds the key. Everyone else loses.
|
|
|
|
|
What are you on about, the guy just wants to protect his code (naive I know but understandable).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Just exploring the hypothetical scenario of protectable code.. I hope he (or anyone else who reads it) never thinks of it as a Good Thing again.
|
|
|
|
|
I Want that My logic in my dll file should be hidden just.
|
|
|
|
|
There's no need to shout. However, a point to consider - it's pretty much impossible to hide your logic. If someone is determined enough, they will be able to get access to it. Even obfuscation only does so much - one of the biggest weaknesses of managed languages is the ease with which they can be reverse engineered.
|
|
|
|
|
Then don't use a managed language in .NET. This includes F#, C#, VB.NET, ...
Use C/C++ and it'll compile to a native code library. This STILL won't protect your logic but it will make it much more difficult to reverse engineer over going with managed code.
|
|
|
|
|
Hello
Does anybody know useful links in order to download sample code :
.net and sedna xml database & exist-db?
Many thanks.
|
|
|
|
|
|
Thanks , But i need sample code and crud operation.
|
|
|
|
|
Then I am afraid that you will have to go and search for it yourself; we don't know what code you are looking for.
Veni, vidi, abiit domum
|
|
|
|
|
I have problem regrading C# to PHP communication. I have read many old posts here and after that i came to conclusion that i have to Use PHP SOAP Web service on server side to get interaction with c#.
Here is the code which i tried:
//webservice.php
configureWSDL('webservice', 'urn:webservice');
$server->register('getMessage',array('msg'=>'xsd:string'),array('return'=>'xsd:null'));
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
//notify.php which containing function which is registered with webservice
//member.php getting message and displaying it. This will be message i want from C# code when ever i //click the button.
In 2nd part in Visual Studio 2012 i added web service reference of WSDL file correctly, and written following code for a button.
//c# code
private void button1_Click(object sender, EventArgs e)
{
localhost.webservice src = new localhost.webservice();
src.getMessage("Hello");
}
But when ever i click button and i saw member.php page nothing happens.????????
Still it showing "temp". I want this "Hello" should be shown whenever i click button.
Any help please?? I am worried wasted my whole week to learn this and now have limited time for my project. I shall be very thankful to you.
Regards,
|
|
|
|
|
Hi, I am making a software,in that want to change month of a datetimepicker using a textbox.
i.e. as i put 15 in textbox the value of the month of a datetimepicker is increased by 15months.
like current date is 05/10/2013
and when i put 15 in a text box...the value of datetimepicker is increased by 05/01/2015.
thanks..
waiting for your reply..
|
|
|
|
|
In the code that handles the change value event (you do not say what your UI is so I can't guess) you increment the datetimepicker value by textbox.text value in months
datetimepicker.value.addmonths((int)TextBox.Text)
[edit] Alright, alright use parse ot tryparse to convert the text value to an int! [/edit]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You low on caffeine Mycroft?
You can't cast a string to an int - the compiler won't let you...
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
Middle of the afternoon, hot sun, excellent bottle of white, should leave the bloody computer alone. Thank you for the redirection.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Middle of the morning, p*ssing down, pint glass of water...
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
Try:
int months;
if (int.TryParse(myTextBox.Text, out months))
{
myDateTimePicker.Value.AddMonths(months);
}
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
We have a managed C# DLL registered for COM interop. This DLL can be called from either a managed or unmanaged application where the customer can control the size and position of the DLL. In our demo application, we use the following win32 API functions to call the DLL. The problem we're running against is that we're losing mouse functions on toolstrip menu items after clicking in the form, even though the hot keys will still work using the keyboard. All controls work initially until clicking on the title bar (which I omitted) or certain controls on the main form.
[DllImport("user32.dll")]
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
private void btnAdopt_Click(object sender, EventArgs e)
{
hWndDocked = (IntPtr)FindWindow(null, "DLL-Title";);
hWndOriginalParent = SetParent(hWndDocked, this.Handle);
MoveWindow(hWndDocked, 125, 25, iWidth, iHeight, true);
}
Some of the DLL dropdowns we can make work by changing the Parent Handle below in close event:
SetForegroundWindow(Global.ParentHandle);
Hopefully my explanation is clear, but has anyone run across this problem? Is there a better way of setting and controlling the DLL handles without losing certain mouse functionality? How can I make this work or what am I doing wrong?
Thanks in Advance,
Rick
|
|
|
|
|
It's difficult to tell exactly what you are doing, but if you are changing the parent of an active window that could quite easily mean that all mouse clicks are being redirected to the wrong window.
Veni, vidi, abiit domum
|
|
|
|