|
swethasri wrote: Kindly provide me the solution for this.
Sure, but first let's discuss terms. My rate is USD$100/hour with a 40 hour minimum.
only two letters away from being an asset
|
|
|
|
|
The following is the Requirement.
The end User will define the Flow of the Process using UI.Based on that Flow result i need to create one Action.
E.g LEt us consider REcruitment Process
I have to provide UI to create Recruitment Process as a flow diagram.
I need to execute this flow diagram once defined
Based on the Result of flow Execution, i need to provide a grade to the candidate.
I dont know how i can give UI provison to the user to define a Workflow dynamically.
If anyone knows kindly let me know.
|
|
|
|
|
Great, payment in advance for the first 40 hours. Contact me off line and we can arrange details.
only two letters away from being an asset
|
|
|
|
|
I think CodeProject is not made for businiess purpose like this.
It's an platform to save others sinking boat with help them and share knowlege as well.
manoj Kumar Jha
"Learn to smile at every situation. See it as an opportunity to prove your strength and ability."
|
|
|
|
|
_KANGAROO_ wrote: t's an platform to save others sinking boat with help them and share knowlege as well.
Yes that true !
but its not true for them who are asking a dumb question by mentioning "please give me source code ", "please Send me solution ASAP ", "Its very urgent...please give the full code "..........
Before asking question here , he should read books or search google for proper solution . and he should try it himself , if stuck everybody here to help him. But not in that way he has asked. and for that case I am agree with what Mark suggested . In my case it is USD$80/Hour
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
Wrong website. Get your cash out and head to somewhere like rentacoder.com
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
cPtr = (unsigned char *) &Float1 ;
cPtr += 3;
for (k = 0; k< 4; k++)
{
*cPtr = sBuffer [BufPtr++];
cPtr--;
}
How to convert these code to C#? Thanks
|
|
|
|
|
It can't be converted, neither sBuffer nor BufPtr are declared.
If I assume sBuffer is a string array and BufPtr is an integer, then you cast it to char. Assuming also that Float1 is a char array;
char[] cPtr = Float1;
cPtr[x] = (char)sBuffer[BufPtr++];
only two letters away from being an asset
|
|
|
|
|
Well, first of all, what are we converting it from? Is this C code? I'll just assume that it is...
As Mark said, without the definitions, one can't make a definitive conversion.
The .NET equivalent of an unsigned char is the Byte data type. If Float1 and sBuffer are byte arrays and BufPtr is an integer, you copy the data like this:
for (int i = 3; i >= 0; i--) {
Float1[i] = sbuffer[BufPtr++]
}
If Float1 is a single precision floating point number (Single), you use the BitConverter class to convert it to an array of bytes:
byte[] data = BitConverter.GetBytes(Float1);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Here are the declaration:
int i, k, BufPtr;
unsigned char *cPtr;
float Float1;
unsigned char sBuffer []
And the purpose of these code is to get the value of Float1.
Thanks
|
|
|
|
|
If you want the value of Float1, just use the Float1 variable. Example:
Console.WriteLine(Float1);
If you want the memory representation of the variable as a byte array, read my previous post.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
.NET 3.0 is an extension to .NET 2.0, not a replacement. Meaning, the version that supports 2.0 also supports 3.0.
I are troll
|
|
|
|
|
Hi.
Does any one know, is there any limit to the buffer size that could be sent at once with the NetworkStream.Write through a socket?.
I'm sending a byte array with a length of 16890, and receiving only a few hundred of them.
networkStream.Write(buffer, 0, buffer.Length);
Please help.
Thanks.
|
|
|
|
|
Hi,
I think you can send as much as you like, if not the Write method should/will throw an exception; however when the network (hardware definition and/or protocol) is somehow limited, the protocol stack and/or driver will chop it into several packets.
Example: Ethernet packets are limited to some 1500 bytes (this relates to the collision detect mechanism,
the maximum length of a connection, and the bit rates).
I doubt a receiver will put them together again, so sending 16890 bytes in a single write may result
in some 11 packets being transmitted and received. That is one of the reasons a Read method always
returns the numbers actually read.
modified on Sunday, January 11, 2009 6:55 PM
modified on Friday, June 10, 2011 12:34 PM
|
|
|
|
|
To expand on Luc's excellent information, the opposite is also true of the data being spread across multiple packets. If multiple pieces of data are sent that are small, depending on how the OS decides to use it's internal buffers, it may combine one of more and send them as 1 packet.
So, you can see that you have to have some way to sort it out on the receiving end since it may be received completely differently than how it was sent.
One approach is to create your own mechanism, or protocol, for transmitting data. A common technique is to perform 2 transmissions, the first is a small amount of data that contains the size of the data to be sent (can be just 4 bytes representing an Int32). And then the second transmission is the actual data. So, on the client end the first transmission would tell the client to expect N bytes of data. Then the client can read until all N bytes are received.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Lets say I have a database with one table, for the sake of this question, and the table structure is like below:
Customer
========
CustomerID
FirstName
LastName
DateOfBirth
Address
City
Province
Country
PostalCode
I have created a DAL which is a singleton class and has a method called Load() which loads all the customers from the database (Lets not worry about memory issues here). Now what I want to do is allow clients to pass in objects of type T and I will load that object for them. For example, client can pass object X and X only needs CutomerID, FirstName, and LastName and I will load object X with those fields.
The problem is at the design time of DAL I can not anticipate the type clients will pass in. I know I can create a method which takes a generic type and create a constraint on it that it must derive from some class or implement some interface but I can not foretell what interface they should implement or what class they should inherit. A client might pass an object which only requires the ID or 2 fields, or 5 fields and so on.
One solution is clients can pass names of fields in an array and I can return them values in an array but I do not like this option. I want to totally abstract the object loading from the client. Can this be done?
Here is the skeleton:
public class DAL
{
public void Load()
{
// Loads all customers from the database and keeps them in a DataTable
}
public CustomerCollection ToCustomerCollection()
{
// Creates type of Customer which has all fields for customers and adds them to a CustomerCollection
}
public void LoadMe(T unknownType)
{
if (T is SomeAbstractClass || T is SomeInterface) // Not an option
{}
// This method should somehow find the properties of T at runtime and load those properties.
}
}
Note: Both clients and DAL know the fields in the database.
|
|
|
|
|
I don't know if you can use C# 3.0, but Linq would probably be a rather clean solution, something like:
var clientCustomerCollection = from cust in Customers
select new { cust.CustomerID, cust.FirstName, cust.LastName };
Perhaps there's a way to do this which is done by the C# 3.0 compiler under the hood also to some extent in C# < 3.0 apps as well.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
That's the problem with most developers; wasting time trying to recreate the wheel rather than using tools and libraries that have already been built and tested.
CodingYoshi wrote: I want to totally abstract the object loading from the client.
Trying to be all things to everyone is impossible and a further waste of time.
only two letters away from being an asset
|
|
|
|
|
I am not recreating the wheel but looking at the best option to do what I need to do. I am already learning LINQ because Greeeg suggested and seems like this is exactly what I was/am after.
When I answer questions on Code Project, I try to answer the question and follow by suggesting an alternative or better solution.
|
|
|
|
|
CodingYoshi wrote: I am already learning LINQ because Greeeg suggested and seems like this is exactly what I was/am after.
LINQ can create anonymous classes, but that's something completely different than what you asked for. It can't be used to dynamically populate existing classes.
CodingYoshi wrote: When I answer questions on Code Project, I try to answer the question and follow by suggesting an alternative or better solution.
That doesn't get you very far. Quite often people don't know what they want, what to ask for or how to ask for it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
This could be done using reflection, but I would not recommend it as it adds a lot of overhead.
I would rather make the class responsible for assigning the values, using an interface like:
public interface IDynamicProperties {
string[] GetPropertyNames { get; }
void SetProperty(string name, object value);
}
The class to be populated could implement it like this:
public Customer : IDynamicProperties {
public int Id { get; private set; }
public string FirstName { get; private set; }
public string LastName { get; private set; }
public string[] GetPropertyNames{ get { return { "CustomerId", "FirstName", "LastName" } } }
public void SetProperty(string name, object value) {
switch (name) {
case "CustomerID": Id = (int)value; break;
case "FirstName": FirstName = (string)value; break;
case "LastName": LastName = (string)value; break;
}
}
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
This following console app attempts to use the PDFToImage class (at bottom of this post):
class MainClass
{
[STAThread]
public static void Main(string[] args)
{
if (args.Length < 6)
{
Console.WriteLine);
return;
}
using (StreamWriter sw = new StreamWriter(args[5]))
{
sw.WriteLine(transformPDFToImage(args[0]));
}
}
private static string transformPDFToImage(string input)
{
whatdoiwritehere?PDFToImage(input);...?
}
}
I've tried...
PDFToImage pdf2i = new PDFToImage(input);...but the compiler responds with The type 'org.pdfbox.PDFToImage' has no constructors defined(CS0143)
If I write...
PDFToImage pdf2i = new PDFToImage();...the compiler responds with 'pdf2i' is a 'variable' but is used like a 'method'(CS0118)
Thanks for any help.
For reference, here's the PDFToImage class definition (written in Java). (In my library, it's since been dotnetized, using IKVM, into a .NET-referenceable DLL): http://svn.apache.org/repos/asf/incubator/pdfbox/trunk/src/main/java/org/apache/pdfbox/PDFToImage.java
modified on Sunday, January 11, 2009 4:59 PM
|
|
|
|
|
Correct the class has no constructors that take any parameters, so yes case #1 would be correct.
If you want to rewrite it in C# you would need something like this
public class PDFToImage<br />
{<br />
public PDFToImage() {}<br />
public PDFToImage(string input){ ... }<br />
public PDFToImage( [parameters] ) {... }<br />
public string TransformPDFToImage(...) { ... }<br />
}
only two letters away from being an asset
|
|
|
|
|
Does it go onto the module like this? (Please forgive me, I'm not an OO programmer.):
namespace pdf2jpeg
{
class MainClass
{
[STAThread]
public static void Main(string[] args)
{
if (args.Length < 6)
{
Console.WriteLine();
return;
}
using (StreamWriter sw = new StreamWriter(args[5]))
{
sw.WriteLine(transformPDFToImage(args[0]));
}
}
private static string transformPDFToImage(string input)
{
PDFToImage pdf2i = new PDFToImage();
}
}
public class PDFToImage
{
public PDFToImage() {}
public PDFToImage(string input){ ... }
public PDFToImage( [parameters] ) {... }
public string TransformPDFToImage(...) { ... }
}
}
How would I call that public class PDFToImage from within private static string transformPDFToImage(string input)?
Thanks for your help.
modified on Sunday, January 11, 2009 4:56 PM
|
|
|
|