|
You can attach your own streams to a System.Diagnostics.Process class object to send/recieve console style input.
|
|
|
|
|
|
Maybe you want to make your own DLL with the console functions, and methods.
|
|
|
|
|
hi
i want to download Directx .0 SDK For Framework 1.0 from this link :
http://www.microsoft.com/downloads/details.aspx?FamilyID=edb98ffa-a59c-4c23-9b92-ba304f188314&DisplayLang=en
but when i follow steps for download,microsoft say to me :
Validation Incomplete: Windows Must Be Activated
how to download it without this problem ?
or please give me another links to download dx90 sdk and documention and ...
thanks
|
|
|
|
|
hdv212 wrote: how to download it without this problem ?
Buy Windows XP
|
|
|
|
|
|
I cant figure out when to use base classes and when to use common
methods that just take in different parameters and do the same task,
instead of having 1 method for each of my objects.
ok so in my data layer (3-tier enterprise web solution), I have
4 classes: mygets, myinserts, mydeletes, myupdates.
Each of these hit the database and do the appropriate work for
7 of my tables: tb1, tb2, tb3 ... tb7
mygets has these methods gettb1(tb1key), getAlltb1, gettb2(tb2key), getAlltb2 ... tb7
each returns a dataset
myinserts takes all fields for tables (as sql parameters) and adds them:
addtb1(field1, field2 ... ), addtb2(field1, field2, ... ) etc.
same for myupdates and mydeletes.
whats the best way to structure having to code the least, and have it
consistent: base classes which have the common functions for each of these 4?
or static methods that basically take in different parameters and get the same
stuff done?
which is more efficient?
related question: are base classes just a better "location" to put common
methods that can be used by a lot of classes? classes that derive from them?
thanks
M
-- modified at 2:09 Tuesday 4th April, 2006
|
|
|
|
|
Hello,
Why not use static overloaded methods from a class say "DatabaseHelperClass"?
GetRows(string key,string value, string tableName)<br />
GetRows(Hashtable filter,string tableName)<br />
GetRows(string tableName)
and same for other tasks??? As far as additions/updates are concerned, you can put the values in a hashtable such that the Key represents the column name and value represents the value of the column you want to add or update in the table. with respect to the key..
For Additions
AddRow(string tableName,Hashtable values)
For Updates
UpdateRows(string key, string value, string tableName, Hashtable values)<br />
GetRows(Hashtable filter,string tableName, Hashtable values)<br />
UpdateRows(string tableName, Hashtable values)
you can do similar for deletions as well. Don't you think it will be a clean approach?
Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
yeah thats what Im doing: I have overloaded functions that do Gets, Insert, Deletes and Updates
for ALL tables.
My question was: where should I put these overloaded functions? in a base class or as common static methods in another class called Utils?
I realized base classes are only useful for object classes, meaning non-static instances.
And also, in my business layer, I do have one class for each table which becomes an object. These table objects then use my data layer to get, insert, delete and update.
pretty clean huh!
M
|
|
|
|
|
Hi
You might like to try using OOP[^]
Create a class for each table. Include properties for each field, and the methods that operate on those properties.
Just a thought
----------------------------
Be excellent to each other
EasiReports[^] My free reporting component for WinForms.
|
|
|
|
|
Hello,
In my opinion, making a class for each table is not an optimal solution because a database might contain alot of tables, and it can expand also, which will increase the implementation cost and It may also result in code replication.
If generic methods for Addition, Update, Deletion and retrieval are deviced then it won't affect much as far as implementation is concerned. Developers will only need to add functionality to use newly added tables where ever it is required without implementing new classes for each table.
What you think?
Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
---how can I recieve a custom message sent from COM server to C# client?
if I send a message in the range 0 to WM_USER-1, it works.
but fail when I send a message above WM_USER?
can someone solve this problem for me?
thank you very much!
Vincent
|
|
|
|
|
Hi All
How to provide values for the parameters when i populate the 'Command'object's parameters using "CommandBuilder.DeriveParameters".
In what scenarios we have to use CommandBuilder.DeriveParameters?
Thanx in advance
Regards,
Sivamani
|
|
|
|
|
How to get inactive / minimized form blink in the taskbar, when something change in that form, like in the chat form. Thanks
<italic>Work hard, Work effectively.
|
|
|
|
|
Back to old good days it was done using FlashWindow Win32 API call. I'm sure there's a managed version of that function is around or at least you can use FlashWindow thru Platform Invoke.
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
-- modified at 0:57 Tuesday 4th April, 2006
|
|
|
|
|
|
Hi.Anybody can give me any hints where is my problem in this code...
using System;
public class Polynomial
{
// convert list of coefficients from input string
// to an array of doubles
public static double[] convertPoly(System.String theStr)
{
// obtain numerator coefficients from text field
theStr = theStr.Replace(',', ' ');
theStr = theStr.Trim();
SupportClass.Tokenizer theToken = new SupportClass.Tokenizer(theStr);
double[] theCoeff = new double[theToken.Count];
// load coefficients into array in reverse order
int index = 0;
for (index = theCoeff.Length - 1; index >= 0; index--)
{
theCoeff[index] = (System.Double.Parse(theToken.NextToken()));
}
return theCoeff;
}
// convert list of polynomials from input string
// to an array of doubles
public static double[] convertPolyList(System.String theStr)
{
// initialize return value to unity
double[] theResult = new double[]{1};
// polynomials seperated by ']' characters
theStr = theStr.Replace('(', ' ');
theStr = theStr.Replace('[', ' ');
theStr = theStr.Replace(')', ';');
theStr = theStr.Replace(']', ';');
theStr = theStr.Trim();
SupportClass.Tokenizer theToken = new SupportClass.Tokenizer(theStr, ";");
int index = 0;
for (index = 0; theToken.Count > 0; index++)
{
double[] theArray = convertPoly(theToken.NextToken());
theResult = multiply(theResult, theArray);
}
return theResult;
}
public static double[] multiply(double[] array1, double[] array2)
{
double[] theResult = new double[array1.Length + array2.Length - 1];
int outer = 0;
for (outer = 0; outer < array1.Length; outer++)
{
int inner = 0;
for (inner = 0; inner < array2.Length; inner++)
{
theResult[outer + inner] += (array1[outer] * array2[inner]);
}
}
return theResult;
}
public static void showArray(double[] theArray)
{
int index = 0;
bool first = true;
for (index = (theArray.Length - 1); index >= 0; index--)
{
if (!first)
{
System.Console.Out.Write(", ");
}
System.Console.Out.Write(theArray[index]);
first = false;
}
System.Console.Out.WriteLine();
}
// main entry point for test purposes only
[STAThread]
public static void Main(System.String[] args)
{
if (args.Length == 1)
{
showArray(convertPolyList(args[0]));
}
else
{
System.Console.Out.WriteLine("usage: java Polynomial (-1,1)(-1,1)");
}
}
}
|
|
|
|
|
Standard question #2:
What error message do you get?
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: Standard question #2
What is standard question #1? and do you have a whole list of these standard questions?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Colin Angus Mackay wrote: What is standard question #1? and do you have a whole list of these standard questions?
Actually I do:
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
Standard question #3:
What does your code look like?
Standard question #4:
No, "nothing" never happens. Exactly what is happening?
Standard question #5:
No, that is not the code you are using. It can't produce that result. What does the code you are using look like?
---
b { font-weight: normal; }
|
|
|
|
|
Thanks
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Why don't you give us a hint first ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Just debug and find out where the error is occuring
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
My company is currently creating a prototype GUI in C# which accesses data in our old codebase (C++) through COM. We have things working pretty well, but have stumbled upon a very strange error, which I was curious if anyone else had run into as well.
After loading our C++ application through COM, I have some xslt files I'd like to transform. I can create XmlDocuments, XmlTextWriters, etc. all perfectly fine, but when I try to use the XslCompiledTransform.Load() function, the compiler just quits. There are no debug message of any sort, and I can't step into the method to see what it is trying to do. I've trying using every possible type of input parameter for the Load() method (string path, XmlDocument, etc.) and none of them seem to make a difference.
I know that something strange must be happening after we load our objects through COM, because if I create the XsltCompiledTransform class and load xslt files before the objects are loaded through COM, things work just fine. I've searched the web, and could not find this issue anywhere else. Any advice on this matter would be appreciated, and if more explaination is needed please let me know (I typed this up really quick, just heading out of work for the day). Thanks in advance.
|
|
|
|
|
HI.
I'm creating a dinamic image that types something with a spetial font. Of course, I have the font not installed on the server fonts dir, so I have to use it with a PrivateFontCollection.
My problem is that the code works in my local server (where I also don't have the font installed on my fonts dir), but when I uplad it to my host, it renders the text in arial, not on my font.
any ideas?
here's the code:
<br />
Bitmap oImage = new Bitmap(400,50,PixelFormat.Format32bppArgb);<br />
Graphics oGraphics = Graphics.FromImage(oImage);<br />
<br />
MemoryStream streamMemory = new MemoryStream();<br />
<br />
oGraphics.Clear(Color.Transparent);<br />
<br />
Color cInk = Color.FromArgb (127,0,0,0);<br />
<br />
Brush oBrush = new SolidBrush(cInk);<br />
<br />
PrivateFontCollection pfc = new PrivateFontCollection();<br />
pfc.AddFontFile(Server.MapPath("Mael____.ttf"));<br />
FontFamily family = pfc.Families[0];<br />
Font oFont = new Font(family, 28);<br />
<br />
<br />
oGraphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;<br />
<br />
string sText = "";<br />
try {<br />
sText = (Request.Params["Text"]);<br />
}<br />
catch{}<br />
<br />
oGraphics.DrawString(sText, oFont, oBrush, 1, 1);<br />
<br />
Response.ContentType = "image/png";<br />
<br />
oImage.Save(streamMemory, ImageFormat.Png);<br />
<br />
Byte[] buffer = streamMemory.ToArray();<br />
Response.Clear();<br />
Response.OutputStream.Write(buffer, 0, buffer.Length);<br />
<br />
Response.End();<br />
streamMemory.Close();<br />
oGraphics.Dispose();<br />
oImage.Dispose();<br />
|
|
|
|
|