Jump to content
Xtreme .Net Talk

DR00ME

Avatar/Signature
  • Posts

    174
  • Joined

  • Last visited

Everything posted by DR00ME

  1. So, how do I write in separate rows, any samples ? :)
  2. I got some items in my listbox: 1.222 323 323 555 222 2.124 3.12 12 244 324 54 367 244 0.232 0.212 I want to write them just like that in a file, how do I do it ? and How do I read from a specific row in a file....... ? the main thing I want to know is how to write in a specific row in a file.... yeah...using filestream not fileopen or whatever it was...I know this takes a bit of your time but if you got some old example I would be more than grateful...
  3. Function CalcGrade() For I = 0 To 100 'Or For I = 0 To Grade.Length - 1 If not Grade(I) = 0 then If Val(Grade(I)) > HighGrade Then HighGrade = Val(Grade(I)) End if If Val(Grade(I)) < LowGrade Then LowGrade = Val(Grade(I)) End If End if Next I End Function Are the grades from 0 to 5 ? ....or ?
  4. Something like this: Dim counterArray(254) As Integer 'array with 255 slots Dim i As Byte Dim MaxValue As Integer Dim MinValue As Integer Dim indexOfMaxValue As Byte Dim indexOfMinValue As Byte Dim Total As integer Dim avg As integer For i = 0 To counterArray.Length - 1 Total = counterArray(i) + Total If counterArray(i) > MaxValue Then MaxValue = counterArray(i) indexOfMaxValue = i Elseif counterArray(i) < MinValue Then MinValue = counterArray(i) indexOfMinValue = i End If Next i avg = Total / counterArray.Length
  5. Want something similar to this: http://javascript.internet.com/clocks/mousetrailclock.html ??? If that's the case GL HF converting it to VB.net or C# format :D <script language="JavaScript"> dCol='000000';//date colour. fCol='000000';//face colour. sCol='000000';//seconds colour. mCol='000000';//minutes colour. hCol='000000';//hours colour. ClockHeight=40; ClockWidth=40; ClockFromMouseY=0; ClockFromMouseX=100; //Alter nothing below! Alignments will be lost! d=new Array("SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"); m=new Array("JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"); date=new Date(); day=date.getDate(); year=date.getYear(); if (year < 2000) year=year+1900; TodaysDate=" "+d[date.getDay()]+" "+day+" "+m[date.getMonth()]+" "+year; D=TodaysDate.split(''); H='...'; H=H.split(''); M='....'; M=M.split(''); S='.....'; S=S.split(''); Face='1 2 3 4 5 6 7 8 9 10 11 12'; font='Arial'; size=1; speed=0.6; ns=(document.layers); ie=(document.all); Face=Face.split(' '); n=Face.length; a=size*10; ymouse=0; xmouse=0; scrll=0; props="<font face="+font+" size="+size+" color="+fCol+"><B>"; props2="<font face="+font+" size="+size+" color="+dCol+"><B>"; Split=360/n; Dsplit=360/D.length; HandHeight=ClockHeight/4.5 HandWidth=ClockWidth/4.5 HandY=-7; HandX=-2.5; scrll=0; step=0.06; currStep=0; y=new Array();x=new Array();Y=new Array();X=new Array(); for (i=0; i < n; i++){y=0;x=0;Y=0;X=0} Dy=new Array();Dx=new Array();DY=new Array();DX=new Array(); for (i=0; i < D.length; i++){Dy=0;Dx=0;DY=0;DX=0} if (ns){ for (i=0; i < D.length; i++) document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D+'</font></center></layer>'); for (i=0; i < n; i++) document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face+'</font></center></layer>'); for (i=0; i < S.length; i++) document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S+'</b></center></font></layer>'); for (i=0; i < M.length; i++) document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M+'</b></center></font></layer>'); for (i=0; i < H.length; i++) document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H+'</b></center></font></layer>'); } if (ie){ document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < D.length; i++) document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D+'</B></font></div>'); document.write('</div></div>'); document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < n; i++) document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face+'</B></font></div>'); document.write('</div></div>'); document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < H.length; i++) document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H+'</div>'); document.write('</div></div>'); document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < M.length; i++) document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M+'</div>'); document.write('</div></div>') document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < S.length; i++) document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S+'</div>'); document.write('</div></div>') } (ns)?window.captureEvents(Event.MOUSEMOVE):0; function Mouse(evnt){ ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY; xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX; } (ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse; function ClockAndAssign(){ time = new Date (); secs = time.getSeconds(); sec = -1.57 + Math.PI * secs/30; mins = time.getMinutes(); min = -1.57 + Math.PI * mins/30; hr = time.getHours(); hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360; if (ie){ Od.style.top=window.document.body.scrollTop; Of.style.top=window.document.body.scrollTop; Oh.style.top=window.document.body.scrollTop; Om.style.top=window.document.body.scrollTop; Os.style.top=window.document.body.scrollTop; } for (i=0; i < n; i++){ var F=(ns)?document.layers['nsFace'+i]:ieFace.style; F.top=y + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll; F.left=x + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180); } for (i=0; i < H.length; i++){ var HL=(ns)?document.layers['nsHours'+i]:ieHours.style; HL.top=y+HandY+(i*HandHeight)*Math.sin(hrs)+scrll; HL.left=x+HandX+(i*HandWidth)*Math.cos(hrs); } for (i=0; i < M.length; i++){ var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes.style; ML.top=y+HandY+(i*HandHeight)*Math.sin(min)+scrll; ML.left=x+HandX+(i*HandWidth)*Math.cos(min); } for (i=0; i < S.length; i++){ var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds.style; SL.top=y+HandY+(i*HandHeight)*Math.sin(sec)+scrll; SL.left=x+HandX+(i*HandWidth)*Math.cos(sec); } for (i=0; i < D.length; i++){ var DL=(ns)?document.layers['nsDate'+i]:ieDate.style; DL.top=Dy + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll; DL.left=Dx + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180); } currStep-=step; } function Delay(){ scrll=(ns)?window.pageYOffset:0; Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed); Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed); for (i=1; i < D.length; i++){ Dy=Math.round(DY+=(Dy[i-1]-DY)*speed); Dx=Math.round(DX+=(Dx[i-1]-DX)*speed); } y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed); x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed); for (i=1; i < n; i++){ y=Math.round(Y+=(y[i-1]-Y)*speed); x=Math.round(X+=(x[i-1]-X)*speed); } ClockAndAssign(); setTimeout('Delay()',20); } if (ns||ie)window.onload=Delay; </script>
  6. DR00ME

    Gc

    heh, I think I should spend one night for reading that article. :)
  7. DR00ME

    Gc

    How does garbage collector operate ? like does it recognize flying objects ? and how does it know which objects are garbage and stuff ? and when it should be called... is it reliable ? p.s. all possible examples in VB format, please.
  8. I suggest animated .gif or something similar as mouse pointer... maybe there is a way to do it with math too... but I'm not going into that :)
  9. Dim MyString As String = "yadda yadda yaa" Dim MyByteArray() As Byte Dim MyEncoding As New System.Text.ASCIIEncoding MyByteArray = MyEncoding.GetBytes(MyString)
  10. I have had similar problems with some image handling things until I found a solution which were .Dispose ..... my program crashed faster tough ... anyway try to look for some flying objects which are eating up memory...
  11. Maybe I bulls*** now but try it... lol 1. 'Put this in server.vb Private main As New main(Me) 2. 'Put this in main.vb Private trick As server Public Sub New(ByVal trk As server) trick = trk End Sub you have to do both operations in order to make it work.... 3. you could also try putting Private trick as main in your server.vb and making MyServer and sApache_server_port Public in main.... after doing phase 1. and 2. you should be able to access the methods or whatever like this: Protected Overrides Sub OnStart(ByVal args() As String) main.MyServer.SetPort(main.sApache_server_port) main.MyServer.SetRunLevel(Threading.ThreadPriority.Normal main.MyServer._start() End Sub or option 3. Protected Overrides Sub OnStart(ByVal args() As String) trick.MyServer.SetPort(trick.sApache_server_port) trick.MyServer.SetRunLevel(Threading.ThreadPriority.Normal trick.MyServer._start() End Sub remember to make the things public you want to use. or something like that... I might be totally wrong too... just play around and see what happens... :D
  12. you want to access things which are defined outside the sub ? (from inside the sub) ? if that is the case, yes there is a way to do it quite easily. But case2: If you want to access the protected sub here is some info:
  13. I knew it! at least I tried! :D
  14. Just because an interface is public doesn't mean you have to implement it publicly. Implementing the interface privately is actually better. If you make every method implemented in private, you can no longer access specific methods directly. You have to use a reference to the interface. :p
  15. Well, Java vs CSharp, since you came up with this kind of a question I would like to point out that Java is not Operating System dependent...but CSharp is... that's one of Java's advantages... anyway GL with your .doc endeavours...
  16. I think the answer is Windows 98 itself.
  17. Good stuff.... I think I'm gonna "check out" Hamilton's book and if it is worth to buy... I got this one book by Michael Halvorson but it is useless... black book which got this triangle on it....there's nothing new in it... I think I need one of those OOP books... P.S. I have used .dispose whenever possible to clean up the garbage...
  18. Denaes cheers, that lightened me. P.S. One question more, if I construct something with new() do I have to destruct it with finalize() ?
  19. Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click if btnStop.text = "Start"' then btnStop.text = "Stop" else btnStop.text = "Start" end if End Sub Or if you want to flag it... Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click Dim btnFlag as boolean = False 'Stop is default btnStop.text if btnFlag = False then btnStop.text = "Start" btnFlag = True else btnStop.text = "Stop" btnFlag = False end if End Sub or use negation 'if not' ....etc etc etc....
  20. : Use constant names like LancelotsFavouriteColour instead of blue and assign it hex value of $0204FB. The color looks identical to pure blue on the screen, and a maintenance programmer would have to work out 0204FB (or use some graphic tool) to know what it looks like. Only someone intimately familiar with Monty Python and the Holy Grail would know that Lancelot's favorite color was blue. If a maintenance programmer can't quote entire Monty Python movies from memory, he or she has no business being a programmer. :D personally I use a lot of camelStyle... and three letter prefixes like txtName lblInfoText etc....but like plasibly stated using a type- prefix in the variable names is ridiculous... e.g. devicesCount looks much better than intDevices... since there cant be half devices...there should 'bling' something in the brains...
  21. OK thx, can you be more specific and try not to use words like an instance and constructor :D ok I know whats a constructor in C++ ...but VB....some example would lighten me .... :) actually what is an instance ? lol
  22. I know how sub programs operate and all but whats the difference with these two sub programs ? Private Sub testing(byval this as string, byval that as string) ..... End sub Private Sub new(byval this as string, byval that as string) ..... End sub P.S. In fact I want to know what happens when you put 'new' there instead of the sub program name.... so... TAKE MY HAND!!!!!!!!!!!!!!!! :D
  23. Well I'm not lying if I tell you to use these API- functions... Private Declare Function midiOutGetNumDevs Lib "winmm.dll" () As Integer Private Declare Function midiOutGetDevCaps Lib "winmm.dll" (ByVal DevNum As Integer, ByRef DevCaps As MIDIOUTCAPS, ByVal SizeOfStruc As Integer) As Integer I guess...
  24. ok this is in my class1: Private Class2 As New Class2(Me) and this in my class2: Private form As class1 Public Sub New(ByVal f As class1) form = f End Sub with "Class2. " Im able to run class2 public sub programs in class1 may I ask why ? can someone explain me all this code...it is very smart coding I guess... I found out this is very useful because i dont have to use 'Shared' keyword in my sub programs to give executing access to other classes ...nor I dont have to inherit things... Thanks goes to DynamiC_SysOp!
  25. lol, I think I pressed some wrong buttons and I lost the message...
×
×
  • Create New...