|
Hi,
I am building an application which does work of Active Directory object creation and update. I need to remove mailbox associated with a domain id without deleting the AD object?
Any inputs will be appreciated.
Regards,
Anchal
|
|
|
|
|
Hi,
I am building an application which works on Active Directory user creation and update. How can I create a Linux mail box for an existing AD object (that is an existing domain id)?
|
|
|
|
|
I have an array as such
List<Bitmap> imgList = new List<Bitmap>();
i need to scroll through that list, very quickly and stitch all the images into one. Like so
using (Bitmap b = new Bitmap(imgList[0].Width, imgList[0].Height * imgList.Count, System.Drawing.Imaging.PixelFormat.Format24bppRgb))
{
using (Graphics g = Graphics.FromImage(b))
{
for (int i=0;i<imgList.Count;i++)
{
g.DrawImage(imgList[i], 0, i * imgList[i].Height);
}
}
b.Save(fileName, ImageFormat.Bmp);
Process.Start(f);
}
imgList.Clear()
The problem that i'm running into is that the images are 2000 wide by 2 high, and there could be 30,000-100,000 images in the array. When I try to make a blank bitmap that size, it get a parameter not found error. Any help would be GREATLY appreciated.
|
|
|
|
|
|
Yeah, I'm afraid GDI+, which is the base for the .NET Image processing, was never designed to handle images of that sort of size. I know this from terrible experience, attempting to process mapping images in municipal councils, and back then I was using GDI+ directly from C++, and it was getting itself into a mess when we stated processing files of ~12,000 x 15,000 pixels.
You are probably going to need to look at doing something in C++, using a library like ImageMagik or similar, to process these images.
One possbility in C#, if you don't want to load the final image, is to look up the internal structure of a BMP file. You could then write the headers and the raw data from the smaller files directly to that file. I really don't fancy your chances of loading it in .NET again afterwards, though.
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
You should explain "why" you want / need to do this.
The concept of "virtualization" could be applied here if it's simply a case of making something "look" like it was all "stitched together".
(Cannot think of any "practical" purpose otherwise).
|
|
|
|
|
You do not need to stitch them into a single bitmap to give the user the impression it is a single picture.
Draw on a Panel or something. When the user drags it, update your virtual coordinates and calculate which parts of which bitmap to draw onto the canvas.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You physically can't create a bitmap that size. As you're, presumably, wanting to appear as though the image is stitched when scrolling, you need to actually allocate a bitmap area that is about twice the size of the visible viewport (this is roughly how things like Google maps handles their images). As you scroll around, you will display the area that you have preloaded - when you get near the edge of the viewport, discard a load of these bitmap images from the opposite (invisible) side of the viewport and load in more on the side you can see. If you think of them as tiles, you should get the idea of how to do this.
This space for rent
|
|
|
|
|
Thanks for all the feedback. As far as virtualization or blocked segments go, that doesn't work because i need the image to be archived for later use (after it's stitched of course). The best solution I've found so far is the create several small stitched images. ¯\_(ツ)_/¯
Perhaps, assuming i don't find a .net solution, I'll circle back when i have more time and take a stab at it in c++.
|
|
|
|
|
I'd recommend first calculating whether such a bitmap is feasible. And no, current description still does not show a 'need' for stitching.
What is the use-case for having such a large bitmap archived?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
JBHowl wrote: I'll circle back when i have more time and take a stab at it in c++.
If and when you do, seriously take a look att the open-source ImageMagick: Application Program Interfaces[^]. It is not overly difficult to use, and for large images such as you're describing, it implements its own disk-caching system. Its been around since Noah was a lad, so its relatively stable.
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
Hi,
If you have a number of .bmp files, it isn't hard to create a stack of them in a new .bmp file without even using the Image or Bitmap classes, provided all images have equal width.
All it takes is some understanding of the BMP file format[^] (basically locate the height information, and the border between header and pixel data), creating the BMP header, and stitching the data half of each of the .bmp files together.
The input images don't even have to be files, you could apply the same to memory streams. So what I would suggest is this: open an output stream, emit the BMP header for the resulting image (could be based on an input image with the height adapted appropriately), then enumerate the images, and for each of them create the memory stream, then append the byte data skipping the input header.
However, I do agree with the others, my first approach would be to avoid the need for a huge image altogether, as working with huge images will cause heavy memory loads, big latency times, and/or fatal errors. When huge amounts of data are involved, streaming is the way to go; stitching things together statically goes the wrong way. If part of your system needs the whole data, then try and fix that if at all possible.
PS & FWIW: I guess it is easy to show your image using a ListBox where each item corresponds to one input image; make it user drawn so no time is wasted in loading and painting items that aren't currently visible.
modified 21-Oct-16 20:06pm.
|
|
|
|
|
hi guys,
I have developed a MVC implementation 5, it works perfectly locally
but I published it on IIS and I have had this problem
//
in the controller I
public ActionResult Index ()
{
CatalogModel m = new CatalogModel ();
m.LocalCodeColumn = 1;
m.PriceColumn = 2;
m.SelectedClientList = m.GetClientSelectedItems ();
return View (m);
}
and in the view:
Select Client: @ Html.DropDownListFor (m => m.SelectedClientList, Model.GetClientSelectedItems (), "--Select--", new {@id = "ddlClient"})
and this function :
public IEnumerable<SelectListItem> GetClientSelectedItems()
{
IEnumerable<SelectListItem> listClient = dataServices.GetClients();
return listClient;
}
i dont know if the problem with the framework on the server or else
Thank you
modified 20-Oct-16 11:12am.
|
|
|
|
|
This question would probably get a better response in the ASP.NET forum; it is not a pure C# issue.
|
|
|
|
|
|
I am attempting to design an interface for a set of calculation methods, inputs are:
MethodName
Collection of RateSet names
optional collection of tenors (key/value) per Rateset
Collection of Parameters (key/value)
Based on the MethodName the interface should then pass the collection values to the method
The method will crunch the values and output a collection of RateSets with Rates (key/value)
How would the implementation of MethodName to the actual method be done?
Reflections, case statement ???
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If you are passing the MethodName as a string, then reflection is probably your best option for calling it.
However, having said that, if you are designing the interface, why not have it with a property that is a method delegate? That way, instead of passing the name of the method to your implementation, you can pass the method itself. No reflection needed, no limited switch-case constructs, and no nasty little bugs when the signature of MethodName does not quite match what was expected.
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
Midi_Mick wrote: why not have it with a property that is a method delegate In which case what would be the benefit of using an interface, it would be no different to using the method direct.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I was thinking you were looking for something like this:
public delegate ICollection<RateSet> Method(ICollection RateNames, IDictionary Parameters, IDictionary Tenors = null);
interface IRatesCalculator {
Method Method { get; }
ICollection RateNames { get; set; }
IDictionary Parameters { get; set; }
IDictionary Tenors { get; set; }
ICollection<RateSet> Results { get; }
}
public class RatesCalculator1 : IRatesCalculator {
public RatesCalculator1() {
Method = (ICollection RateNames, IDictionary Parameters, IDictionary Tenors) => {
List<RateSet> rateSet;
return rateSet;
}
};
public Method Method { get; }
public IDictionary Parameters { get; set; }
public ICollection RateNames { get; set; }
public IDictionary Tenors { get; set; } = null;
public ICollection<RateSet> Results {
get {
return Method?.Invoke(RateNames, Parameters, Tenors);
}
}
}
public class RatesCalculator2 {
public RatesCalculator2(Method calculator) {
Method = calculator;
}
public Method Method { get; }
public IDictionary Parameters { get; set; }
public ICollection RateNames { get; set; }
public IDictionary Tenors { get; set; } = null;
public ICollection<RateSet> Results {
get {
return Method?.Invoke(RateNames, Parameters, Tenors);
}
}
}
You may even need to make Method a Read/Write property if you wanted to set it after the creation of the class object.
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
This is a case where I would change my thinking around and use the Strategy patter[^] instead.
This space for rent
|
|
|
|
|
I think you are close to rediscovering abstract factory.
Calling a common interface which is implemented in number or classes and interface calling concrete methods according to some decision.
I suggest you read implementing factory/abstract factory before digging into reflection.
---
Pd.
|
|
|
|
|
So why aren't you just using a delegate here?
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
The methodname comes from a user selection and is a string!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If it is from a user-selection, that you don't need to use a string. Most controls have a "display" value for the string, while your real value may be an enum. As Pete said, a strategy-pattern
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Yeah, seems like an obvious reason to go with a delegate method. Don't even need to create new classes to handle it, and the delegate effectively takes the place of an interface.
Psudocode!
delegate object MyDelegate(IEnumerable<kvp> parameters, IEnumerable<kvp> tenors = null);
Dictionary<string,MyDelegate> UIDelegateAssociation = new{{Key = "uiSelection", Value = (p,t){}}};
UIDelegateAssociation["uiSelection"].Value.Invoke(params,tenors);
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|