|
Wajeeha wrote: HELP HELP URGENTLY!!!!
You might want to stick your head in a crocodile.
|
|
|
|
|
It would seem that you have committed the cardinal sin of demanding help urgently. If you need help urgently then there are various support options you can pay for. If you want help free then you have to wait until some kind volunteer has the time to assist you.
|
|
|
|
|
The best advice I can give you is to start your homework earlier and plan out better what you actually want to do. I find thinking about the task and even following the pseudo-code through on paper often helps to highlight problems in logic.
Maybe you could wait for John Simmons' answer if he sees the desperate request. I'm sure your phrase "n i regret i dint come here earlier." may well be slightly modified once you get his reply.
Also note that the words are "and" not "n", "see" not "c", "you" not "u", "I" not "i".
Your last rambling paragraph does not encourage the reader to continue but merely saps the will of the prospective helper.
I still remember having to write your own code in FORTRAN rather than be a cut and paste merchant being pampered by colour coded Intellisense - ahh proper programming - those were the days
|
|
|
|
|
Baconbutty wrote: but merely saps the will of the prospective helper
So that's what happened to me!
|
|
|
|
|
idiots like you also mean my post has been puched off the front page
|
|
|
|
|
idiots like you also mean my post has been pushed off the front page
|
|
|
|
|
Expect to fail the course.
|
|
|
|
|
I have a decimal number with a variable amount of digits following the decimal. I need to make the number a whole number and in doing so I need to keep track of how many decimal places there were.
ie change 28.9876 to 289874 and store there were 4 decimal places.
I am currently doing this by converting to a string and checking how many are after the '.'
This seems a poor way to solve this problem, but I am drawing a blank on other approaches. Can anyone offer other more efficient/elegant solutions?
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
I'm sure there is an even better way, but...
decimal d = 10.1234;
int dp = (d - decimal.Truncate(d)).ToString().Length - 2;
int val = (int)(d * (decimal)Math.Pow(10, dp));
This method, although still converting it to a string, doesn't 'search' the string for a particular character... just gets its length... which is relatively efficient.
As I said... there will be a better way... what it is I cannot immediately say.
Hope this helps.
Matthew Butler
|
|
|
|
|
For instance
decimal d = 28.9876M;
int[] bits = Decimal.GetBits(d);
int pow = (bits[3] >> 16) & 0xFF;
At the end pow contains 4 , i.e. the number of digits after the decimal point.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Appreciate the help
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
|
Thanks for the help.
this thing looks like it was written by an epileptic ferret
Dave Kreskowiak
|
|
|
|
|
Hi,
I m working on DNet Remoting to develop trading application to accept bid/ask value from user and broadcast to every connected user.
Process is working smoothly on localhost as well as on LAN.
But it is not working when i host app on static IP based server.Client send bid/ask value to server but does not get updates except client running on server.
Currently i m running server app manually by clicking on server.exe.
I did not get any change if I replace http channel with tcp
Any comment/suggestions r invited. Thanks all.
Client and Server Configuration file are given below.
Server Config File
-----------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="Trading">
<service>
<wellknown mode="Singleton" type="Server.Broadcaster, Server" objectUri="Broadcaster.soap"/>
</service>
<channels>
<channel ref="http" port="16784">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
Client Config file
-----------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application name="EventClient.exe">
<client>
<wellknown type="Common.IBroadcaster, Common" url="http://203.200.95.133:16784/Trading/Broadcaster.soap"/>
</client>
<channels>
<channel ref="http" port="0">
<serverProviders>
<formatter ref="binary" typeFilterLevel="Full"/>
</serverProviders>
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
|
|
|
|
|
Make sure port 16784 isn't blocked by your firewall.
|
|
|
|
|
Hi Guys. Maybe somebody here can help me. I'm writing a little app that writes records from a text file to an Excel file. However, I am writing data to two columns, namely A2 and B2. Problem here is that Every record gets appended to the same cell A2 and B2 instead of going onto writing the next record to A3 and B3 etc. Any ideas what I'm doing wrong here?
Code below:
foreach (ReadFile nomread in res)
{
objRange = objSheet.get_Range("A2", System.Reflection.Missing.Value);
objRange.Value2 += nomread.CLIENTSURNAME;
objRange = objSheet.get_Range("B2", System.Reflection.Missing.Value);
objRange.Value2 += nomread.CLIENTFORENAMES;
}
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Kwagga wrote: objRange = objSheet.get_Range("A2", System.Reflection.Missing.Value);
Kwagga wrote: objRange = objSheet.get_Range("B2", System.Reflection.Missing.Value);
This is what you're doing wrong. You are selecting same cell in loop, so you will get different value from nomread but it will write in same cell.
There are two ways you can write values to excel cell. One is using two dimensional array which would look something like yourArray[2,2] and you would send that to your excel worksheet. But in your code it seems like you don't know the max number or cells you will need. So for something like this you can use Array and Column index to write array.
The code will looks something like this:-
int iR, iC;
iR = 1;
iC = 1;
foreach (ReadFile nomread in res)
{
objSheet.Cells[iR, iC] = nomread.CLIENTSURNAME;
objSheet.Cells[iR, iC+1] = nomread.CLIENTFORENAMES;
iC = 1;
iR++;
}
I haven't tested this code so you may need to make some changes. But the point is you should get an idea from this...
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Thanks mate. It doesn't write all the records though. Only writes the last record. I get the jist of it and will see what I can do with what you provided me.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Kwagga wrote: It doesn't write all the records though. Only writes the last record. I get the jist of it
What do you mean by it doesn't write all the records?? Can you post the code that you're using now??!
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Hi Mate. It works fine. I missed something from your sample.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Okay
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Mate, what if I have more than just the two columns??
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
It depends on your set of data. For example if I had 1000 random numbers in collection I would just increment iC column index. And when the column index hits 50 I would increment iR (row Index) and set iC (column Index) back to 1.
This is the code I used before for one my college projects. BUT KEEP IN MIND THAT IT HAS RANDOM NUMBERS ONLY. AND ORDER DOES NOT MATTERS IN THIS.
int iR, iC;
iR = 1;
iC = 0;
for (int i = 0; i <= Globals.Vars.arVbNums.Count - 1; i++)
{
iC++;
if (i % 30 == 0 && i != 0)
{
iR++;
iC = 1;
}
oSheet.Cells[iR, iC] = Globals.Vars.arVbNums[i];
}
But if you're dealing with something like, Data base where order of values matters you will have to stick to + operator. If you look at the code I gave you before it has something like [iR, iC+1] so you will just write something like [iR, iC+2] for next column.
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
Hi
I m developing an application in C#. I m recording a video from Webcam and saving it on harddisk. it creates .avi file, which is very heavy file. so I want to convert it into .mpeg or any other format in which my video file is not as much heavy as .avi.
so plz tell me the solution or code for conversion.
Regardz
Shanzay
|
|
|
|
|
If you're looking for a full solution, and don't actually have a programming issue - gotta have actual code to have a programming issue right? - then you're far better off looking for bulk code on sourceforge.[^] You will probably have far better luck. Good luck.
Scott P
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.”
-Edsger Dijkstra
|
|
|
|