|
You still don't get it, do you?
assuming a fantastic CPU that does everything your algorithm needs for one iteration in a single instruction (waw), and runs at 1000GHz (waw), so it does 1 of your zillion things per picosecond, or 3E19 per year (as there are 3E7 seconds in a year); now assume it started when the universe started (some 14E9 years ago?), then it would now have finished some 4E29 thereof, way less than 1E50 (you're twenty zeroes short).
so sorting isn't relevant, your algorithm stinks, it is just undoable that many times.
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.
|
|
|
|
|
The Might and Magic V Map Editor's floating Toolbar with TabPage as below:
http://cid-fbeb6373d9321a7f.skydrive.live.com/self.aspx/Questions/Visual%20C%7C3/MapEditor%7C_Might%20and%20Magic%20V%20Map%20Editor.JPG
How do I design the same toolbar in Visual C# 2008?
|
|
|
|
|
Here is an Nice Example of Floating Toolbar. You have to design the internal content of Toolbar.
Floating Toolbar
modified on Sunday, July 26, 2009 12:44 PM
|
|
|
|
|
|
I have a list of specific class.
Im doing some simulation and i want to receive in the end the 100 best result.
Lets say i have this class :
class A<br />
{<br />
int j;<br />
int t;<br />
<br />
}
and i want to save in some range of j and t the best 100 "A" elements that give me the low math.pow(j/t,2) (100 result of the lowest A that i have).
Right now im insert the result to the list and then sort the list with the Compare method. each time a take the smallest result of the list and then if the current result is more small then then the small one on this. If its is smallest then i insert it into the the array , sort it and then remove the last object and continue.
What is the best way to take a List/Array of sort element and just insert the Current element to it's place in the sorted List/Array and remove that biggest element of the list ? (In C# )
modified on Sunday, July 26, 2009 7:46 AM
|
|
|
|
|
Do you really need to do that after each insert? Or can you fill the structure, then sort it and iterate the ones you want?
|
|
|
|
|
In the name of God
-----------------
Hi
Anybody know how we can find out Firefox in work ( loading page or downloading file , downloading image) ? please help me in any programing language .
best regards
bye.
|
|
|
|
|
Fullmm wrote: Anybody know how we can find out Firefox in work ( loading page or downloading file , downloading image) ?
Can you please explain it in little bit details? I am little bit confused .
You want to track information when Firfox downloading any file or Images ?
|
|
|
|
|
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I want to create a c# app. It should just display a message box, whenever I am opening Iexplorer.exe. How to do this friends? It should be run at background
|
|
|
|
|
Any way you like. I'd probably have it as a Windows Scheduled Task that starts at login.
|
|
|
|
|
ok., but How to do this in c#,
Which event will fired when browser invoked? Can I get example program?
I am new to c#.
|
|
|
|
|
I don't know what anyone else would do, but I'd likely start with calling FindWindow in an endless loop and doing whatever it is I want to do when I find one.
[
System.Runtime.InteropServices.DllImportAttribute
(
"User32"
,
SetLastError=true
,
EntryPoint="FindWindow"
)
]
private static extern System.IntPtr
API_FindWindow
(
string lpClassName
,
string lpWindowName
) ;
public static System.IntPtr
FindWindow
(
string WindowName
)
{
return ( API_FindWindow
(
null
,
WindowName
) ) ;
}
If no one gives you a better idea, then read up on P/Invoke to figure how to use this.
|
|
|
|
|
|
|
Hello everyone. I've successfully managed to control the general wave volume of Windows.
However, since vista came out, it's now possible to control the volume for every single application in the windows mixer..
Since I didn't manage to find anything anywhere here comes my question: how i can control per-application volume?
What I wanted to do was to mute/lower the volume of all BUT ONE application. ( also via some sendmessage codes I'm not aware of.. )
Can anyone help?
|
|
|
|
|
Is there a free IDE for designing a Winforms gui for a C# program? I have a copy of VS 2008 that I got from school, would that work?
Also, is Visual C# the same as C#? VS 2008 only doesn't list "C#", only "Visual C#".
Thank you.
|
|
|
|
|
You can use VS 08.. yap my friend this are same.
Thanks
Md. Marufuzzaman
|
|
|
|
|
C# is a language. Visual C# is Microsoft's compiler for C#. Visual Studio can be used as an IDE for Visual C#, and is quite handy (but not required) when you need to implement a WinForms application. An Express version of Visual Studio is available for free. And a C#-only version of Visual Studio is (or was) also available, marketed as Visual C# Standard (if I recall correctly).
|
|
|
|
|
How can I use Vscroll for listview when Scrollable is false ?
|
|
|
|
|
Hello,
I'm looking for a way to query the pending applications I'm installing by group policies. I planning a C# class for a program, running on a client in a windows domain, which queries the applications to install by GPO, compare with the installed programs and discover this ones not yet installed.
I've absolute no idea how to discover the according GPOs and I've spend a lot time with Google by searching unsuccessfully for an approach.
Has someone a hint, how i could solve this problem? How do I discover the applied GPOs on a client machine?
Please excuse my bad English and greetings from Berlin
Costa
modified 13-Sep-21 21:01pm.
|
|
|
|
|
hi
how can i convert image that is 32bppArgb (png image) to jpg so if the image is Transparent
i don't get a black image, or if the image is semi Transparent (like red color and 50 % alpha) i get the color like the png image and not a full color?
|
|
|
|
|
The jpg format does not support an alpha mask, png does. Therefore, this will be lost when you convert to jpg.
The rest of your question makes no sense to me.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Nryk,
This response assumes you are not using WPF.
Well, if you want to do this outside your own code, any tool like ACDSee will convert your .png with transparency to a .jpg which looks okay : I have not experimented with this to any depth, but the default settings of ACDSee's .jpg conversion will produce a file with the transparent areas rendered in white.
I would guess it is possible in PhotoShop (I use CS4) to change the settings when you save as .png (while PhotoShop only shows a 24bpp option .png, in fact it does save the alpha) so that what color shows up in the .jpg (where the transparency was) trasformed by ACDSee varies, but that's a guess.
I have never tried making a .png in PhotoShop with partial transparency (unless this is a side-effect of "feathering," which I use often, that I am not aware of). But now that you mentioned it, I am curious to experiment.
If you are doing conversion at run-time in your own code, I would guess you are going to have to construct a new bitmap and interpolate the alpha values into tints of color (luminance values ?) in the rgb source. But I would certainly go and research this with Google, and on StackOverFlow, and, of course, right here on CP.
I would also advise you to check out Bob Powell's win forms and graphics for .NET sites (somewhat out of date, but still full of great hints and tips if you are using WinForms) :
Tips/Tricks[^]
GDI+ FAQ[^]
Check out the CP AlphaForm article[^], by Jeff Anderson, and his source code, for great information on transparency via Layered Windows. While it is not specificly targeted at .png, I think you'll find it valuable.
You can check out my raving about Jeff's article[^]; in that message I include a link to a very valuable on-line resource for understanding .png optimization.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
JPG doesn't have alpha layers
In C++, if you are willing to assume you would be drawing the PNG image on a black background, look up AlphaBlend. You could draw the PNG to a bitmap or just create a 24 bit image using the raw bytes. The BLENDFUNCTION documentation has a chart of the multipliers you need to use. It looks confusing, but is rather straightforward once you think about it.
I'm not sure the equivalent of AlphaBlend in C# (outside of the DirectX classes.) Again, if you assume the background, you could do it yourself.
http://msdn.microsoft.com/en-us/library/aa452889.aspx[^]
|
|
|
|