|
First, what kind of database?
Second, local backup or remote backup?
Third, "describing" backup or pure content-backup?
Cheers
Sid
|
|
|
|
|
I am using SQL Server 2000 and I can access Network SQL Servers also..
So I want to get complete database backup and restore itself in SQL Server's databases in my network..
|
|
|
|
|
Hi,
can anybody tell me that how to find out the minimum and maximum value from the single dimention array?
i don't want to go with for -loop or do while logic becoz it's taking somuch time and it reduce the performance.
can anybody tell me that what is the direct way to find out min & max value from array?
any sample code available then give me.
|
|
|
|
|
Are you creating the array ? You could just keep track of the min and max as you add values to the array with a couple variables. Other than that, I believe you will have to do some kind of sort on the array.
|
|
|
|
|
it's not that difficult. If it's generic array, and you don't have any specific information about array (specific information would be e.g. "it's sorted array"), you have to go through whole array - that's common sense. You can optimize this stupid algorithm only if you know something more... As already suggested, you could keep a variable with maximal/minimal value. Or you can have sorted array. Or if you need better performance (e.g. it's BIG array - I can think of sizes 1000+ ) you may consider different structure than array - heap, tree etc. Or you can sort array once and then find min and max is easy and in O(1). It really depends on what is in array and how you use the array... without more information, answer is you can't do anything better then O(N) (meaning: check all N items in array).
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi,
Let me tell you whole information.I had taken generic array not sorted one and it's single dimentional array.I am storing the pixel value of the image(i.e. R,G,B) into that single dimentional array.I want to find out the Minimum and maximum value from the pixel.so now i think u got whole idea.
so now for getting excellent performance what is the best way?
I think now u r having whole information.
|
|
|
|
|
Since you are adding each value to the array yourself just check each value against a Min and Max variable before you enter it into the array. i.e.
if(CurrentValue < MinValue)
MinValue=CurrentValue;
else if(CurrentValue > MaxValue)
MaxValue=CurrentValue;
Array.Add(CurrentValue);
|
|
|
|
|
Hi,
yeh i had applied logic which you had suggested but here as i am first using math.min(,) method which for looping the color pixel ,it only gives me min. value of last two pixels ,not min. value of whole pixels.
here is the code,
for (int row = rect.Left; row < rect.Right; row++)
{
for (int col = rect.Top; col < rect.Bottom; col++)
{
// XmlElement nodeColorFG = xmlDoc.CreateElement("COLOR");
dropColors[k] = PixelInfo.getColor(row, col);
if (dropColors[k].R < MinRvalue)
{
Minmax.MinRvalue = dropColors[k].R;
}
else if (dropColors[k].R > MaxRvalue)
{
Minmax.MaxRvalue = dropColors[k].R;
}
//RAvg+= dropColors[k].R / TotalPixels;
//Getting the Minimum & Maximum value of the Red (R) colors.
if (k!=0)
{
MinRvalue = Math.Min(dropColors[k-1].R, dropColors[k].R);
MaxRvalue = Math.Max(dropColors[k - 1].R, dropColors[k].R);
}
//Getting the Minimum & Maximum value of the Green (G) colors.
//GAvg += dropColors[k].G / TotalPixels;
BAvg += dropColors[k].B / TotalPixels;
k++;
//if (dropColors[k - 1].R > dropColors[k].R) Minmax.MinRvalue = dropColors[k].R;
}
}
so can you suggest me some more changes to get min. and maxi. value of whole pixels?pls.
|
|
|
|
|
Ok, I'm not sure what your variable Minmax is, but here is a possible solution to your problem...
for (int row = rect.Left; row < rect.Right; row++)
{
for (int col = rect.Top; col < rect.Bottom; col++)
{
dropColors[k] = PixelInfo.getColor(row, col);
Minmax.MinRvalue = Math.Min(Minmax.MinRvalue,dropColors[k].R);
Minmax.MaxRvalue = Math.Max(Minmax.MaxRvalue,dropColors[k].R);
Minmax.MinGvalue = Math.Min(Minmax.MinGvalue,dropColors[k].G);
Minmax.MaxGvalue = Math.Max(Minmax.MaxGvalue,dropColors[k].G);
Minmax.MinBvalue = Math.Min(Minmax.MinBvalue,dropColors[k].B);
Minmax.MaxBvalue = Math.Max(Minmax.MaxBvalue,dropColors[k].B);
BAvg += dropColors[k].B / TotalPixels;
k++;
}
}
if (k!=0)
{
MinRvalue = Minmax.MinRvalue;
MaxRvalue = Minmax.MaxRvalue;
}
|
|
|
|
|
Hi,
yeh this works great but one contstrain is as below:
yours given logic is perfactly ok but now need some more logic which remove below constraints:
main problem of this logic is that as it's taking minimum and maximum value of R,G,B if user select the color in which there is one white color pixel of my logic taken white color value in min. value and so it removes all the colors from the image instead of selected color.
so i need to make some more improvement of this logic?can any one help out or guide me in changing this logic ?
thanks again
|
|
|
|
|
So add in another variable to handle White pixels. We cannot write this software for you.....
|
|
|
|
|
Hi,
Can you pls. tell me yours whole idea for improve that logic.It may possible that it helps me lot.
thanks in advance
|
|
|
|
|
I don't see how "loop inspection" on an array is a giantic performance hit but if you do not want to do that then you must create your own ArrayList (or suitable substitute).
When you override Add and Insert just put in extra logic to track the min/max. Extra work will have to be done with Remove where you probably need to search the entire array when the min/max is removed from the collection.
|
|
|
|
|
I start a thread in my program, wich do some actions. At the end of the actions it have to display (make Visible to true) a button to close the window. It seams when the thread stops (finishes) the buttons that is unvisible (Visible is false)
How can i prevent that the buttons will be only visible in the thread i started?
Thanks.
|
|
|
|
|
Hi:
i have hosted my server dll in IIS its code is like
Server view:
//server dll name is mydll.dll
<code>
namespace NameSpaceabc
{
Class ServiceProvider:MarshalByRefObject, IServices
{
void DoIt(string strWorkOnit)
{
//..do some work
}
}
}
//shared assembly has interface def
public interface IServices
{
bool DoIt(string strName);
}
the web.config file is as folllows
//////////////////////////////////////
<configuration>
<system.runtime.remoting>
<application>
<service>
<activated mode="SingleCall" type="NameSpaceabc.ServiceProvider,mydll" objectUri="services.soap" />
</service>
<channels>
<channel ref="http">
<serverProviders>
<formatter ref="soap" typeFilterLevel="Full" />
</serverProviders>
</channel>
</application>
</system.runtime.remoting>
</configuration>
//////////////////////////////////////
Client view:
HttpChannel channel = new HttpChannel();
ChannelServices.RegisterChannel(channel);
IServices iservice = (IServices )Activator.GetObject(
typeof(IServices ),"http://10.0.0.108/mydll/services.soap");
string abc="eiwero";
//as soonas i call my first method it gives an exception ..service not found
//whats the issue
iservice .DoIt(abc);
dlls are copied in the www/mydll/bin folder
web.config is in www/mydll folder
Please help
Regards
Muhammad Ahmed
Ahmed
|
|
|
|
|
Hi Ahmed,
Seems there is nothing wrong with your code. Are you getting the WSDL file when you give the URL http://10.0.0.108/mydll/services.soap?wsdl.
Thanks and Regards
Kodandapani.
|
|
|
|
|
ok,..i have fixed it by changing the server config file tag from
<activated mode="SingleCall" type="NameSpaceabc.ServiceProvider,mydll" objectUri="services.soap" />
to
<wellknown mode="SingleCall" type="NameSpaceabc.ServiceProvider,mydll" objectUri="services.soap" />
now its working fine,..
now i have another problem,.i cant debug the server side dll hosted in IIS,.although i am attaching it to w3wp.exe but to no use,.. ihave also used Debug.Assert(false) but futile,..i check the w3wp.exe using a tool the monitors path where a dll is loaded from ,..it loaded my server dll from a very starnge path,...
my dll is also not registered in GAC,..but yet it loads from that strange path,(i guess cache).i deleted my dll from that path but it copies it again,..
any help on as to how to debug,.??? as an alternative i am debugging by making a service that loads my dll,..
but how to debug using IIS????
thanks
Ahmed
|
|
|
|
|
i am trying to use following COnnection String by putting mDB file in EXE folder
String ConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=myfile.mdb;Persist Security Info=False";
its throwing Exception 'file c:\myfile.mdb' was not found
I have put both EXE and MDB file in same folder..
MyBlogs
http://weblogs.com.pk/kadnan
|
|
|
|
|
I guess I'm not sure what your question is. You can fix this problem by including the full path to the MDB in the connection string. Or are you just making the comment that the OLEDB driver is not a relative path ? If you want to make sure the path to the MDB is the same as the EXE you can use the static property of Application.StartupPath...i.e.
string MDBPath=Path.Combine(Application.StartupPath,"MyFile.mdb");
String ConnStr=string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Persist Security Info=False",MDBPath);
|
|
|
|
|
You just got bit by your assumption that the current directory will be the directory that your app was launched from. This is almost always never the case.
NEVER assume that the file you want is in the current directory. ALWAYS supply a full path specification to whatever function you need.
In your case, I'm assuming that the database you want is in the same folder as your application .EXE:
string appPath = Application.StartupPath();
string filePathToDatabase = Path.Combine( appPath, "myFile.mdb" );
string connStr = String.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};", filePathToDatabase);
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
heres the deal. i have an image loaded into a bitmap. i have another bitmap with two colours. its like a map, i read all the black pixels and make a region out of it. now i want to stick the first bitmap into the cutout bitmap. however i want the first bitmap to be "squished" into the second, giving like a warped effect if the map is designed correctly.
this is the link to the website showing the image and the map to use.
www.users.bigpond.net.au/livebox/index.htm[^]
its a simple concept but for the life of me i cannot think of a way to do it. i thought about getting each pixel from the original and placing it inside the map but then the bitmap might not be the same size thus i have to strecth it. that and the fact that the map can be anything and my program has to skew the bitmap regardless of its shape.
thanks for your time and help in this
stumped
goran sterjov
|
|
|
|
|
Nice idea
Basically, consider the following: Do you have a single region or can there be multiple regions? If there can be multiple regions, you need to find a way to divide your image into smaller ones. Do that as you see fit
The second part: You now have an image and a corresponding "region" in which you need to "squish" your image.
Now, this is where it comes to experimenting. You need to find some algorithm which you can use to "map" image coordinates to region coordinates. if they both are of the same shape and aspect ration, you could simply "divide" the coordinated from the image (using PointF) by the resize ration (or something like this) and then draw them into your region.
Well, you want to do other regions as well, so I suggest you imagine the following situation:
You have your image, laid out in wooden cubes (pixels). You now want to push this image into a certain shape. So, you start on the outside and push the first "pixel". Doing that affects other pixels, which also change position. as you probably will not push hard enough to compress the wood, it will give way by "jumping" up, so that pixels lay over each other.
Now, if you look from above, the "image" has been pushed into shape at the expense of dozens of "pixels" overlapping each other and obstructing view. You could compensate by mixing the colors of all overlapping "pixels", but I suggest you simply remove all obstructed "pixels".
I am quite sorry that I cannot translate the following sentence, but I simply have no idea of how to say this in English:
"Die Richtung, in die du deine "Pixel" schiebst, entspricht einer Linie von der Aussenkante dieser Region zum Mittelpunkt. Stauche anhand dieser Linien, wie oben beschrieben." <- German
Cheers
Sid
|
|
|
|
|
thanks, i see what you mean and will experiment more with these nasty pixels. only hope i hit the solution soon else i will go crazy.
thanks again
goran
|
|
|
|
|
I write a asp.net program and need to know which user is now logged in clients . for example if user "A" is logged button B must enabled And if User "B" is logged button B must disabled in my webform .
Can anyone help me ?
Regards' Amir jalaly
|
|
|
|
|
Each Page has got a User attached to it, so you might want to go writing something like in your Page_Load Eventhandler:
if(User.Identity.IsAuthenticated && User.Identity.Name == "Pete") {
Button1.Enabled = true;
}
What authentication model are you using?
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|