|
Please notice that this is not "getacoder" or "rentacoder" website.....
YOu may place your HUMBLE request there....
Have a Happy Coding.....
|
|
|
|
|
If you're going to be using an SMS gateway, your service provider will almost certainly have some sort of developer's guide. I've used an SMS gateway myself and I was able to download an excellent developer's guide which documented all the calls and even provided sample code. They also provided me with free credits to try the gateway out and a "test mode" which allowed me to test my code before I started actually sending text messages beyond the gateway.
So, in summary, speak to your gateway provider and at the risk of generalising, if they don't provide a decent development guide, look elsewhere
Evil cannot be conquered in the world... It can only be resisted within oneself.
|
|
|
|
|
i am a students, i am transform a code about lz77 decompression in c# from JSCRIPT
this is my c# code
public class lz77DeCompression
{
private char ReferencePrefix;
private int ReferencePrefixCode;
private int ReferenceIntBase;
private int ReferenceIntFloorCode;
private int ReferenceIntCeilCode;
private int MaxStringDistance;
private int MinStringLength;
private int MaxStringLength;
private int MaxWindowLength;
public lz77DeCompression()
{
this.ReferencePrefix ='`';
this.ReferencePrefixCode = (int)this.ReferencePrefix;
this.ReferenceIntBase = 96;
this.ReferenceIntFloorCode =(int)' ';
this.ReferenceIntCeilCode = this.ReferenceIntFloorCode + this.ReferenceIntBase -1;
this.MaxStringDistance = (int)Math.Pow(this.ReferenceIntBase ,2)-1;
this.MinStringLength = 5;
this.MaxStringLength = (int)Math.Pow(this.ReferenceIntBase, 1) - 1 + this.MinStringLength;
this.MaxWindowLength = this.MaxStringDistance + this.MinStringLength;
}
private int decodeReferenceInt(string words, int width)
{
int value;
int i;
int charcode;
value = 0;
for (i = 0; i < width;i++ )
{
value *= this.ReferenceIntBase;
charcode = (int)words[i];
if ((charcode >= this.ReferenceIntFloorCode) && (charcode <= this.ReferenceIntCeilCode))
{
value += charcode - this.ReferenceIntFloorCode;
}
/* else
{
Response.Write ( "<script type=\"javascript\">alert("+ charcode+")<//script>");
}*/
}
return value;
}
private int decodeReferenceInt(char words, int width)
{
int value;
int i;
int charcode;
value = 0;
for (i = 0; i < width; i++)
{
value *= this.ReferenceIntBase;
charcode = (int)words;
if ((charcode >= this.ReferenceIntFloorCode) && (charcode <= this.ReferenceIntCeilCode))
{
value += charcode - this.ReferenceIntFloorCode;
}
/* else
{
Response.Write ( "<script type=\"javascript\">alert("+ charcode+")<//script>");
}*/
}
return value;
}
private int decodeReferenceLength(char words)
{
return decodeReferenceInt(words, 1) + this.MinStringLength;
}
public string decompress(string words)
{
string decompressed;
int pos,distance,length;
int getSubString;
char currentChar;
char nextChar;
decompressed ="";
pos = 0;
while (pos < words.Length)
{
currentChar = words[pos];
if (currentChar!=this.ReferencePrefix)
{
decompressed += currentChar;
pos++;
}
else
{
nextChar = words[pos + 1];
if (nextChar != this.ReferencePrefix)
{
distance = decodeReferenceInt(words.Substring(pos + 1, 2), 2);
length = decodeReferenceLength (words[pos+3]);
getSubString=decompressed.Length - distance - length;
decompressed += decompressed.Substring(getSubString, length);
pos += this.MinStringLength - 1;
}
else
{
decompressed += this.ReferencePrefix;
pos += 2;
}
}
}
return decompressed;
}
}
and this the JSCRIPT code
//lz77 class
ReferencePrefix = "`";
ReferencePrefixCode = ReferencePrefix.charCodeAt(0);
ReferenceIntBase = 96;
ReferenceIntFloorCode = " ".charCodeAt(0);
ReferenceIntCeilCode = ReferenceIntFloorCode + ReferenceIntBase - 1;
MaxStringDistance = Math.pow(ReferenceIntBase, 2) - 1;
MinStringLength = 5;
MaxStringLength = Math.pow(ReferenceIntBase, 1) - 1 + MinStringLength;
MaxWindowLength = MaxStringDistance + MinStringLength;
function decodeReferenceInt(data, width) {
var value = 0;
for (var i = 0; i < width; i++) {
value *= ReferenceIntBase;
var charCode = data.charCodeAt(i);
if ((charCode >= ReferenceIntFloorCode) && (charCode <= ReferenceIntCeilCode)) {
value += charCode - ReferenceIntFloorCode;
} else {
throw "Invalid char code in reference int: " + charCode;
}
}
return value;
}
function decodeReferenceLength(data) {
return decodeReferenceInt(data, 1) + MinStringLength;
}
function decompress(data) {
var decompressed = "";
var pos = 0;
while (pos < data.length) {
var currentChar = data.charAt(pos);
if (currentChar != ReferencePrefix) {
decompressed += currentChar;
pos++;
} else {
var nextChar = data.charAt(pos + 1);
if (nextChar != ReferencePrefix) {
var distance = decodeReferenceInt(data.substr(pos + 1, 2), 2);
var length = decodeReferenceLength(data.charAt(pos + 3));
decompressed += decompressed.substr(decompressed.length - distance - length, length);
pos += MinStringLength - 1;
} else {
decompressed += ReferencePrefix;
pos += 2;
}
}
}
return decompressed;
}
//end class
when i give input input in c# code
input :
I'm just a little bit caught in the middle
Life is a maze and lov` ,"r` >!I don't know where to go I can't do it alone I've tried
And I don't know why
then the output :
I'm just a little bit caught in the middle
Life is a maze and love is a rddle
I don't know where to go I can't do it alone I've tried
And I don't know why
when i input in jscript
input :
I'm just a little bit caught in the middle
Life is a maze and lov` ,"r` >!I don't know where to go I can't do it alone I've tried
And I don't know why
then the output
output:
I'm just a little bit caught in the middle
Life is a maze and love is a riddle
I don't know where to go I can't do it alone I've tried
And I don't know why
the right output is in JSCRIPT, in c# there is missing one character
but when i try differen input :
in c#
input :
I'm just a little bit caught in the middle Life is a maze and lov` ,"r` >!I don't know where to go I can't do it alone I've tried And I don't know why
output :
I'm just a little bit caught in the middle Life is a maze and love is a riddle I don't know where to go I can't do it alone I've tried And I don't know why
in JSCRIPT
input :
I'm just a little bit caught in the middle Life is a maze and lov` ,"r` >!I don't know where to go I can't do it alone I've tried And I don't know why
output :
I'm just a little bit caught in the middle Life is a maze and love is a riddle I don't know where to go I can't do it alone I've tried And I don't know why
u can see, they have same output, and the both output are right ..
i am confuse about my program, i dont know where is the error, and what is the solution ..
i hope somebody here, can help me to solve my problem with that code ..
thank you very much ..
regards
novhard..
|
|
|
|
|
I hope that someone answers your request, but I doubt if they will. It is too difficult to read.
Edit your post.
Put the code between <pre></pre> tags, and format it properly, indentation and so on.
Differentiate the input and output from your question, maybe bold it, or italicise it, or both.
At the moment it is too difficult to work out what it is that you want!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i am oredy solve the problem, thx for reply my message ..
|
|
|
|
|
Good for you!
Self help is the best help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
After how much time later the garbage collector is called automatically to recycle the objects?How the garbage collector Knows to which object has to be recycled in the memory? And where we have to Call the garbage collector?
Example: If i have write a code of 500 lines and define a object in the starting and use the object in second last line of the code. Is the garbage collector recycle the object before its use or not.
|
|
|
|
|
Hey, lmgtfy!
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
[My articles]
|
|
|
|
|
hey Ashwani Dhiman
what in your case when you create an object in first line and used in last line it does not matter that you are using the object or not in your code,
the thing is the memory which is used by the object is referenced by any variable or not i.e accessible or not by your code
when memory location is dangling garbage collector will recollect those
hope this will help u
akhilonly007@gmail.com
modified on Monday, April 6, 2009 6:31 AM
|
|
|
|
|
akhilonly007 wrote: hope this will help u
Please write properly. It is very difficult to read text-speak and not everyone on this forum has a sufficient knowledge of English to interpret poorly written text-speak laiden prose.
|
|
|
|
|
hey Colin Angus Mackay
sorry if i hv written incomplete ans, as others on this forum me too poor in writing english
but try to give ans as u hv given i.e point to point
akhilonly007@gmail.com
|
|
|
|
|
My issue was the use of text-speak which you continue to do.
For example:
hv = have
ans = answer
u = you
People who do not have a good level of English will be confused by the use of text-speak as it relies on a good level of understanding of the language.
|
|
|
|
|
Please try to use complete words, it makes it so much easier for everyone.
akhilonly007 wrote: sorry if i hv written incomplete ans, as others on this forum me too poor in writing english
but try to give ans as u hv given i.e point to point
hv = have (x2)
ans = answer (x2)
u = you
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
ok thanks for guiding me
from now onwards i will not repeat such mistakes
akhilonly007@gmail.com
|
|
|
|
|
Ashwani Dhiman wrote: After how much time later the garbage collector is called automatically to recycle the objects?
When it needs to, or when you ask it (but even then it may not).
Ashwani Dhiman wrote: How the garbage collector Knows to which object has to be recycled in the memory?
When garbage collection is run it maps all objects in the system. Any that are not referenced somewhere down the object graph from a known root are discarded. Root objects are those that are statically declared.
Ashwani Dhiman wrote: And where we have to Call the garbage collector?
You don't. It happens when it needs to.
Ashwani Dhiman wrote: If i have write a code of 500 lines and define a object in the starting and use the object in second last line of the code. Is the garbage collector recycle the object before its use or not.
If it needs to then yes. Otherwise then no.
|
|
|
|
|
Colin Angus Mackay wrote: or when you ask it (but even then it may not).
Hmm, I thought GC.Collect forces a garbage collection?
|
|
|
|
|
|
Collin Jasnoch wrote: G2 Collection is BAD
It isn't bad. It just takes the longest because it is where all the large or aged objects are placed. This means it doesn't have the same performance as a G0 collection.
Saying it is bad is like saying an ADSL connection to the internet is bad because you can transfer data from your hard disk faster.
Collin Jasnoch wrote: Microsoft claims the the GC in VS 2010 is "Better", whatever the heck that means
Technology has moved on. Hardware has changed. Now the garbage collector supports the features of newer hardware that it didn't in the past.
|
|
|
|
|
Colin Angus Mackay wrote: Technology has moved on
WHAT! You mean I'm not typing this into my commodore?
|
|
|
|
|
Colin Angus Mackay wrote: It isn't bad. It just takes the longest because it is where all the large or aged objects are placed. This means it doesn't have the same performance as a G0 collection.
Large objects (IIRC >85k) have their own heap separate from the G0/1/2 heaps. It's managed differently in that objects are fixed and the heap doesn't compact after a collect. Instead it uses a c++eqsue traversal algorithm to find a suitable place to store new objects.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Every day is a school day!
|
|
|
|
|
And despite reading about it a week or two ago, I didn't quite get it right. The allocator prefers the end of the heap to free space except when it would otherwise be forced to grow the heap. In certain unexpected circumstances this can bite you badly.
http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/[^]
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Collin Jasnoch wrote: To reiterate again, you need to know what you are wanting from the GC before you start messing with it. Oh and Microsoft claims the the GC in VS 2010 is "Better", whatever the heck that means (I do not recall a time when microsoft released a product and claimed something about it was "worse" or the same for that mattter).
Well obvious possibilities occur: One would be doing fewer G1 collects to reduce the number of objects making it to G2. The second would be to change the large object heap to avoid the sort of problems in the article I linked elsewhere in the thread. Changing the end of the free memory chain would mitigate the pathological case described. Another option would be to suck it up and compact it (at least partially) if the utilization fraction got too low. In extremis only attempting to do so when an out of memory error would otherwise occur, but would still generate large amounts of flack for making the poor management visible. "My app gobbled xGB of unused ram before releasing 99% of it." This would also be impractical if running x64 code because of the larger address space.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Hi
I have application in c# that import dll writing in c++
The interface to the dll is
struct sNDIS_802_16E_CAPABILITY;
...
‘bool::WiMAXGetCapabilites(sNDIS_802_16E_CAPABILITY *pNDIS_802_16E_CAPABILITY)’
How can I send a pointer of the struct to the interface
Should I use ref?
Thanks
Ronen
|
|
|
|
|
What about documentation [^]?
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
[My articles]
|
|
|
|