Hi, I am having a Timer control like this: [CODE]asp:Timer ID="Timer1" runat="server" Enabled="False" Interval="1000" OnTick="Timer1_Tick"> </asp:Timer>[/CODE] In an UppdatePanel with AJAX enabled. So everything works fine to the point where on each refresh of the panel a JS is inserted in the header: [CODE]<script type="text/javascript">Sys.Application.add_init(function() { $create(Sys.UI._Timer, {"enabled":true,"interval":1000,"uniqueID":"Timer1"}, null, null, $get("Timer1")); });</script>[/CODE] So you can imagine in 10 min the page is increased by 600 lines. Any ideas on how to make the timer not register itself every time or at least not stack up ? Thanks!

Member Avatar
Member Avatar
+0 forum 3

I am getting garbage value. Is it need to free 's' every time or the reason is something else. please,help. #include<stdio.h> #include<conio.h> #include<alloc.h> char* toBin(int); void rec(int); void main() { int n; char *out; clrscr(); printf("\n Enter no : "); scanf("%d",&n); out=toBin(n); printf("\n %s",out); free(out); // rec(5); getch(); } /*void rec(int n) { if(n<=0) { return; } rec(n-1); printf("\n %d",n); }*/ char* toBin(int d) { int d1=d,r=0,i=0; char *s=""; // free(s); // s=(char*)malloc(10*sizeof(char)); while(d1>0) { r = d1 % 2; d1 = d1 / 2; s[i] = r + 48; i++; } flushall(); strrev(s); flushall(); printf("\n rev : %s",s); return …

Member Avatar
Member Avatar
+0 forum 11

I have posted this on GBA temp ([here](http://gbatemp.net/threads/garbage-on-top-of-screen-when-displaying-text-over-background.350999/)) without any replies: Another newb question.. I am currently using the 16-bit libnds example (Located within [here](http://sourceforge.net/projects/devkitpro/files/examples/nds/)) as a basis and am trying to display text and the png background image on the same screen (in this example it is the top sceen). I am having a similar issue as this post: http://devkitpro.org/viewtopic.php?f=6&t=3222&hilit=background+and+text I have garbage on the top of the screen (only if consoleInit(...) is called), similar to the first problem in the thread. The only problem is that I am displaying the background image in a different method so the …

Member Avatar
Member Avatar
+0 forum 1

I have a bit of a baffling problem! I'm writing a tag matcher in XML and whenever I run the below procedure, I get a garbage value after the name of every tag **except for the first one**. When I add the array text to the parameters list, the garbage value goes away (I had it there during initial debugging) even though it isn't actually referenced at any point in the procedure. Another thing, is that while reading a tag, it doesn't seem to want to recognize spaces. For example, <img src="img.png"/> reads as imgsrc="imgpng" instead of img, but only …

Member Avatar
Member Avatar
+0 forum 1

class Account { Long accNum, pwd} public class Banker { public static void main(String r[]) { new Banker().go(); // do more stuff } void go() { Account a1 = new Account(); a1.accNum = new Long("1024"); Account a2 = a1; Account a3 = a2; a3.pwd = a1.accNum.longValue(); a2.pwd = 4455L; } } It says in solution when line 5, "//do more stuff" is reached, four objects are eligible for GC. Three I know is Banker(), Account() and Long("1024"). My doubt is which is the fourth one? It says in solution that "Account object has two *Long* objects associated with it". So …

Member Avatar
Member Avatar
+0 forum 2

I am getting extra garbage at the end of the string returned by this function. Why? [CODE]char *read(char *fname) { FILE *file=fopen(fname,"r"); printf("Opening input file...\n"); if (file==NULL) return NULL; int length=0; char *ret=new char[length]; while (!feof(file)) { char ch=fgetc(file); char *temp=new char[length+1]; for (int i=0; i<length; i++) temp[i]=ret[i]; delete[]ret; if (ch==EOF) ch=0; temp[length++]=ch; ret=temp; } fclose(file); return ret; }[/CODE]

Member Avatar
Member Avatar
+0 forum 8

This is homework. I have the code written, though. The thing works. Mostly. The assignment is to write a program that reads a list of integers from a file, prints the maximum value in the list to the console, removes the maximum value from the list, and stores the (smaller) list back to the file. I have a file that I just typed in [CODE] 0 1 2 3 4 5 6 7 8 9 [/CODE] as a test and I saved it as a text file. I reference this with the file path inside of the code. Everything works …

Member Avatar
Member Avatar
+0 forum 16

hello everyone.. please answer me , if you can give me working code I thought about something... I know that everything in our machines have addresses.. I thought about watching everything in my computer's random access memory(RAM) But I don't want to see the information in view of garbage , I mean there are hundreds of thousands of processes, bits there(I want to make them char if it is possible and see texts)... In addition I have to say that I want to see everything (no matter what it is) in char type Somethings came to my RAM (mind) So …

Member Avatar
Member Avatar
+0 forum 3

I'm supposed to write a tcp server program which writes into a file a record as structure. The code is given below: [code] int n,i; cout<<"Enter number of student records"; cin>>n; for(i=0;i<n;i++) { cout<<"Enter id,name,average mark"; cin>>r[i].id>>r[i].name>>r[i].mark; } [/code] [code] int i,n1; FILE *fp; FILE *file = fopen("db.dat", "wb"); cout<<"Writing into file\n"; if ( file != NULL ) { for(i=0;i<n;i++) fwrite(&r[i], sizeof r[i], 1, file); fclose(file); } cout<<"Writing completed\n"; [/code] There is no problem in writing part(or there is????) When i read from the file using fread it prints junk values. What is the problem?? Does fread not place correct …

Member Avatar
Member Avatar
+0 forum 1

In my desktop application am using following .net functions [CODE][COLOR="Green"]GC.Collect(); GC.WaitForPendingFinalizers();[/COLOR][/CODE] [COLOR="Red"]I just want to know that, is there possibility that WaitForPendingFinalizers() will wait for indifinite time ? If so ,what is the way to get out of it so that my application can proceed further.[/COLOR][QUOTE][/QUOTE]

Member Avatar
Member Avatar
+0 forum 3

OK, so I get up, shower, eat, and open up my email client. Number 4 from the top is a Daniweb email telling me about the wonderful topics currently being discussed - here's the list: * Prevent programs from saving to certain folder? in Windows Vista and Windows 7 * Win7: To Migrate or Not to Migrate? in Windows Vista and Windows 7 * Error Code 8024402c in Windows Vista and Windows 7 * connecting to localhost` in Windows Vista and Windows 7 * Cant install any programs... Help! in Windows Vista and Windows 7 * Windows 7 Regional Themes …

Member Avatar
Member Avatar
-5 forum 179

[code] #include<iostream>; using namespace std; int main(){ char arr[8]={}; for(int count(0); count<=7; ++count){ arr[count]='*'; } cout<<arr; cin.get(); return 0; } [/code][code]I really do not understand how some garbage values get stored into the array; even after I have initialized it properly; and how it can display MORE values than what I have stored into it; like if my array size for character array is 10; it will show more than that !! I use Dev C++ to write, compile my code. I have attached the code; that I run. In the below code; 3-4 EXTRA values get displayed as well; …

Member Avatar
Member Avatar
-1 forum 9

The End.