|
Howdy All,
I'm kicking around the idea of using the CodeDom namespace in an application to allow end users some limited access to scripting (for example to functions in System.Math).
Is anyone aware of any restrictions on the CodeDom in a distributed application? I realize it's already part of the framework, but...I had heard a story about licensing restriction in the old VBScript and was wondering if anyone had heard anything similar with regards to .Net.
A little googling didn't really reveal anything other than some GPL discussion around MONO, but none of it seemed relevant. Maybe I just wasn't using the right search terms...
Anyway, has anyone heard or tried anything along these lines?
|
|
|
|
|
I am have an MDI application where I have several child forms that open under the parent MDI form.
When the child form is opened in the MDI parent form it flickers.
The child form has many controls on it which gets filled by querying from the database when the form loads.
Also the child form has a grid displaying all the records from database.
I am using dataset to fetch more than 2000 records from database and bind it to grid.
I am having problem during loading of this form.
I have tried using following to avoid form flickering:
> DoubleBuffering technique
> Using Datareader instead of Dataset for fetching records
> Fetching records from database after form is loaded using Form_Shown() event
and used BackgroundWorker to Asynchronously fetch records from database.
Can anyone please help me out to avoid the form flickering issue.
Thanks in advance !!!!!!!!
|
|
|
|
|
Hi,
I have got a problem.
In a web project in 3.5, I have :
- a Entity Framework model, linked to a SQL Server 2005 database
- two services :
1) a ADO.Net Data Service (ex-Astoria)
2) a WCF Service
These two services are both linked to the Entity model.
In the client project (it's Silverlight), I added two references, for each of the services. VS2008 creates for me two Reference.cs files, one for each service.
The problem is that the two files are containing the same definitions of entities, but VS2008 consider that they are different, because they belongs to two different namespaces. Therefore, if I want to use the two services in the same class, I get an error of ambiguous reference between the two definitions. So I can only use one service in the same class :/ The problem would be resolved if the entities would be defined once.
Would it be possible to have only one definition of the entities for the two services reference ?
|
|
|
|
|
Hi,
I need to get data from SQL and write it on an application using the application's web services.
I need this to be scheduled.
What's best to do?
Write a Windows Service and schedule it or write a console application and schedule it in the Task Scheduler?
Thanks in advance
|
|
|
|
|
I'd go for the console-application, read the records in a DataTable and pump them one by one to the WebService of the application that you're going to export to. That's easily scheduled through the Windows Task Scheduler, and easy to understand (therefore, easy to maintain)
You can run a console-application as a service and effectively delay this decision. There are some freeware-tools out and about that can help in this regard.
--edit--
Question was about a Windows-service, not webservice..
I are troll
modified on Wednesday, March 4, 2009 3:39 AM
|
|
|
|
|
Depending on the frequency you need to run this you would do either.
If you have to run this query many times a day, then a service might be in order. If it's just one or two times a day, then a console app launched through the Task Scheduler would be a better choice.
|
|
|
|
|
Has anyone has run into this problem and found a solution. I spent 1/2 day googling with no success.
File -> Open -> Web Site, navigate to my XSLT file, assign an XML input file, set a breakpoint at <xsl:template match="/" > (actually I set one at every line) and click XML -> Debug Xslt.
It shows the output but does not stop at any breakpoint. If I move the files to a different Web Site that uses VS2005, everything works correctly.
Any help would be appreciated.
|
|
|
|
|
How can i convert a color image into pixel matrix using c#.net
modified on Wednesday, March 4, 2009 1:44 AM
|
|
|
|
|
rohan4040 wrote: How can i convert a color image into pixel matrix
By writing code - in the language of your choice.
|
|
|
|
|
If you had magnified between the lines of his post like times 100 you would have seen:
"Send me the codes pleezzzzz, it's urgent"
|
|
|
|
|
I urgently ignored the subtext.
"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
|
|
|
|
|
a slow but easy way to do this is to use the Bitmap class' GetPixel method.
I am writing this code as I go and will probably contains error:
class ByteColor
{
public byte R;
public byte G;
public byte B;
}
Bitmap myBMP=new Bitmap("myimage.jpg");
int iW=myBMP.Width;
int iH=myBMP.Height;
ByteColor[,] myPixelMatrix=new ByteColor[iW,iH];
for(int w=0; w<iw;w++)>
{
for(int h=0; h<ih;h++)>
{
Color tmpColor=myBMP.GetPixel(w,h);
byte cR=Convert.toByte(tmpColor.R);
byte cG=Convert.toByte(tmpColor.G);
byte cB=Convert.toByte(tmpColor.B);
myPixelMatrix[w,h].R=cR;
myPixelMatrix[w,h].G=cR;
myPixelMatrix[w,h].B=cR;
}
}
As I said this is a easy but slow way to do it. for some more speed you can use the LockBits and UnlockBits methodes and copy the byte array right from memory like this:
Rectangle rect = new Rectangle(0, 0, myBMP.Width, myBMP.Height);
BitmapData ImageColorData = myBMP.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
unsafe
{
IntPtr pointer = ImageColorData .Scan0;
int Bytesnmpr = ImageColorData .Stride * myBMP.Height;
byte[] ColorValues = new byte[Bytesnmpr];
Marshal.Copy(pointer, ColorValues , 0, Bytesnmpr);
for (int i= 0; i< ColorValues .Length; i++)
{
}
Marshal.Copy(ColorValues , 0, pointer , Bytesnmpr);
}
myBMP.UnlockBits(ImageColorData);
this one is much faster but uses unsafe code.
also remember, I worte the code on the fly, so there is most likely errors in this code
|
|
|
|
|
is this coding related to c#.net or any other form of coding?
|
|
|
|
|
How can i convert a numeric value to binary value
|
|
|
|
|
Well, you can use the Calculator that comes with Windows, or you can read up[^] here.
You can find the conversion-routines (like this[^] one) on Google
I are troll
|
|
|
|
|
Hi All,
I have a requirement, wherein there are expand and collapse gridrow (gridview asp.net 2.0).
Has anyone worked on it or provide a sample code for this asap.
For eg: I have a Author Table with Author ID and Author Name.
If I click on a expand/collapse button before Author ID, it should list out all the books written by him. Something like this?
-----------------------------
+/- Author ID | Author Name
-----------------------------
Book ID | Book Name
-----------------------------
Book 1 | Book 1 Name
Book 2 | Book 2 Name
-----------------------------
Anyhelp will be highly appreciated. I googled through lots of sites, but most of them are using third party controls, which I have a restriction to use it.
|
|
|
|
|
I think you want to investigate using the 'RowCommand' functioanlity of the GridView. For instance; I have a grid that I have placed a button in as follows;
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="btnViewApp" CommandName="ViewApplication" Text ="View" ToolTip ="View Application" runat ="server" CssClass ="Button" />
</ItemTemplate>
</asp:TemplateField>
The CommandName attribute is used in the code behind;
Protected Sub gridview_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gridview.RowCommand
If e.CommandName = "ViewApplication" Then
{code to hide the row here.}
End If
End Sub
I can't find a snippet of code quickly for the actual hiding of the row. It isn't very straight forward. But perhaps this will get you close enough. I will reply again if I come across it. Code I have infront of me pulls values out of the selected row. Perhaps you can massage it a bit.
Dim btn As Control = DirectCast(e.CommandSource, Control)
Dim grw As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
Session("celltext") = grw.Cells(0).Text
|
|
|
|
|
hi tech freaks...
i just want to make a social network using .net .
in this social network, we have friends list to be built and if i click on friends list then i should get all members in the list in columns. two people icons per column. i should also get the list of mutual friends if i click a button below each friend. if i hover mouse on the friend's icon then the icon should get lifted up and 4 or 5 sub icons should come around the icon like a spider web kind of thing . each icon should have profile picture of that person's friends. and if i bring down mouse, it should go back to normal state. i should have a link below the each icon which can give list of all friends of my friend.
please somebody help with required code
|
|
|
|
|
I don't know how to break this to you, but I don't think anyone on CodeProject will give that code to you. If you build it and get stuck with a programming problem or maybe even a design problem, then lots of people will jump at the chance to give you some help. But, no one, here, will build this for you for free.
If you want someone to build this for you, try Rent-A-Coder[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
hello ,
i developed a .NET software which i want people to download from the net.
i know that if they never used a .NET product they probably dont have the right framework installed on their PC
is there a way in ASP to know if remote computer has right framework or not ?
coz by this i will be able to send him either a small sized file or a big sized one which includes the framework installation
thanks in advance
avi
|
|
|
|
|
If they're using IE, then the USER_AGENT of the browser contains the .NET Framework version that they have installed on their system.
Sometimes Firefox/Mozilla will also have the information in its USER_AGENT.
Basically, unless you put something on their computer like an Applet or Silverlight doo-hickey, then you're just going to be shooting in the dark.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
tnx,
and what will happen if a prog will run without the framework installed?
will it be friendly or just crash ?
|
|
|
|
|
Crash. It may display a "Cannot find mscorlib.dll" or it may show "You need the .NET runtime." It's been a long time since I've seen a Windows computer without .NET on it.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi Guys,
I've got a problem rounding floats, when adding a small value repeatedly to another, eventually small errors creep in.
float test = 0;
float increment = 0.2f;
for (int i = 0; i < 100; i++)
{
test += increment;
}
if (test != increment * 100)
throw new ApplicationException("Rounding Error!");
What are the available options to get around this?
regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
The Ethically Correct Answer: Floating point arithmetic usually comes with errors because of the representation of the significand. A good understanding of floating-point number representations can assist you in finding a good solution for your problem. Try reading What Every Computer Scientist Should Know About Floating-Point Arithmetic[^].
The Unethical Answer: If you would rather take the myopic path and just get a solution, change your float s to decimal s.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|