|
I am not incapable of reading the comments because they have been written by myself. I think you didn't understand the question all i was asking the technical working what is happening in the memory when we execute the given code.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
AliAmjad wrote: you didn't understand the question
Well, it was so off worded, do you really expect anyone to understand?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Not sure what you are asking here. Are you asking for guidance on interfaces?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Ok here is what i am trying to accomplish i am working on an Application Framework and using both the composition approach and inheritance approach all i was asking the technical working of the code given what is actually happening in the memory as there is some confusion i am facing that's why asking.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
WHAT THE HELL ! when someone don't understand the question he/she mark it as bad question. You all guys are expert out there i am sure but i don't consider myself one that's why i was asking for help from all the experts & brilliant brains out there in order to eliminate the confusion i am facing. If by asking something that hurts your ego or that's way too below your expectation then please don't even bother to answer just IGNORE.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
Your question, as worded, implies that you don't know anything about how to declare a variable or create an instance of a class. This is VB.NET 101 type stuff, which is probably why you got knocked down.
The answer to the question at hand is quite simple. Memory is allocated to hold an instance of the object, both the code and data seperately. The code is only kept in memory once for every instance of the class, while each instance's data is kept seperately in their own blocks of memory.
If you wanted to know something beyond this, perhaps an explanation of what you're thinking is going on, or what the situation is you're facing, or why you're looking for more detail would be in order.
|
|
|
|
|
I know all this but may be i am not able to ask the question properly or you are not getting my point anyway thanks a ton for your help Dave.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
Dave Kreskowiak wrote: perhaps an explanation of what you're thinking is going on, or what the situation is you're facing, or why you're looking for more detail would be in order.
Yes, that would be very nice.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I am completely off the road i think if i can rephrase the question should i ask - How memory is allocated to an object in Heap? If you came across any technical article on this topic please let me know Thanks.
AliAmjad(MCP)
First make it Run THEN make it Run Fast!
|
|
|
|
|
AliAmjad wrote: How memory is allocated to an object in Heap?
Yes, that would have helped alot.
|
|
|
|
|
AliAmjad wrote: Dim nyBus As ICalculateTax = New NewYorkBusiness
An instance of the NewYorkBusiness class (I suppose that it's a class) is created on the heap. The reference to the instance is stored in the nyBus variable. The nyBus variable can hold a reference to any class that implements the ICalculateTax interface.
AliAmjad wrote: Dim nyBus As BasicBusiness = New LahoreBusiness
An instance of the LahoreBusiness class is created on the heap. The reference to the instance is stored in the nyBus variable. The nyBus variable can hold a reference to the BasicBusiness class or any class that inherits it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Im trying to print to a 40 column printer through my VB Application. But the printer instead of printing it will keep showing Spooling status. Im Using Epson TM-U220PD Printer, VB 6.0 and Sql Server 2000 as Backend. Anybody plz help me out in this context. I need to solve this urgently...
Here is my code...
sql = "select * from ReportTable"
If rstemp.State = 1 Then rstemp.Close
rstemp.Open sql, con, adOpenStatic, adLockOptimistic
If rstemp.EOF = False Then
'Open "LPT1" For Output As #intFreeFile
Open App.Path & "\reports\Billing.txt" For Output As #1
Printer.Print ""
Printer.FontName = "Arial"
Printer.FontBold = False
Printer.FontSize = 8
Print #1, vbTab & Trim(rstemp!CompanyName)
Print #1, vbTab & Trim(rstemp!BranchName)
Print #1, Space(1) & Trim(rstemp!Address) & Trim(rstemp!Street)
Print #1, vbTab & Trim(rstemp!City) & "," & Trim(rstemp!Phone)
Print #1, Space(1) & "CST No:" & Space(1) & Trim(rstemp!CATName) & Space(2) & "KST No:" & Space(1) & Trim(rstemp!DeptName)
Print #1, Space(1) & "TIN No:" & Space(1) & Trim(rstemp!VATNo)
Print #1, "-------------------------------------"
Print #1, " CASH BILL "
Print #1, "-------------------------------------"
Print #1, "M/s: " & Trim(rstemp!EANCode)
Print #1, "BillNo: " & Trim(rstemp!slno)
Print #1, "Bill Dt: " & Trim(rstemp!a1Date) & Space(3) & "Time: " & Right(Trim(rstemp!a2date), 12)
Print #1, "-------------------------------------"
Print #1, "SN" & Space(1) & "Desc." & vbTab & Space(4) & "Qty" & Space(2) & "Rate" & Space(4) & "Amt"
Print #1, "-------------------------------------"
slno = 1
totitem = 0
totamt = 0
Do Until rstemp.EOF
If Len(rstemp!ItemName) <= 14 Then
Print #1, Space(1) & Trim(slno) & Space(1) & Trim(rstemp!ItemName) & Space(14 - Len(Trim(rstemp!ItemName))) & Space(3) & Trim(rstemp!Qty) & Space(3 - Len(Trim(rstemp!Qty))) & Space(2) & Trim(Format(rstemp!sp, "#0.00")) & Space(6 - Len(Trim(rstemp!sp))) & Space(2) & Trim(Format(rstemp!amount, "#0.00"))
totitem = totitem + Val(rstemp!Qty)
totamt = totamt + Val(rstemp!amount)
Else
str1 = Trim(Left(rstemp!ItemName, 14))
str2 = Trim(Mid(rstemp!ItemName, 15, 40))
Print #1, Space(1) & Trim(slno) & Space(1) & Trim(str1) & Space(14 - Len(Trim(str1))) & Space(3) & Trim(rstemp!Qty) & Space(3 - Len(Trim(rstemp!Qty))) & Space(2) & Trim(Format(rstemp!sp, "#0.00")) & Space(6 - Len(Trim(rstemp!sp))) & Space(2) & Trim(Format(rstemp!amount, "#0.00"))
totitem = totitem + Val(rstemp!Qty)
totamt = totamt + Val(rstemp!amount)
End If
slno = slno + 1
rstemp.MoveNext
Loop
Print #1, "-------------------------------------"
Print #1, " Total : " & Trim(totitem) & Space(3) & Trim(Format(totamt, "#0.00"))
Print #1, "-------------------------------------"
Print #1, "Some text goes here"
Print #1, "Goods once sold will not be exchanged or "
Print #1, "taken back. "
Print #1, "Some text goes here"
Print #1, "Some text goes here"
Print #1, "Some text goes here"
'Ejecting the page
Print #1, Chr$(12);
'Releasing the printer
Print #1, Chr$(27); "q";
Close #1
Else
'Do Nothing
End If
rstemp.Close
|
|
|
|
|
praveenhathwar wrote: I need to solve this urgently...
That's your own problem, then. This site is not for people with urgent needs. Members will post on their own free time, when and if they do feel like it.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hello everybody,
I have a big issue that I can't seem to be able to solve. I need to find a SINGLE CPU process (one program that I know the name of), and display it into a label.
For example My_program ---> 20%
I use (on a timer)
Private m_PerformanceCounter As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total")
ListBox1.Items.Add(CInt(m_PerformanceCounter.NextValue()) & "%")
but I think I get ALL processes added up. I just want ONE of them
for example (in pseudocode)
if process.name = "My_program" then label1.text=process.CPUUsageTimeOfTHatProcess
How can I do it with VB.NET? Any help will be much appreciated. Thank you in advance.
Still trying to find the way
|
|
|
|
|
Of course it's returning the total CPU usage. Look at the line of code your using:
Chaos Machine wrote: Private m_PerformanceCounter As New System.Diagnostics.PerformanceCounter("Processor", "% Processor Time", "_Total")
On top of this, you don't even need the Performance counters to do this. You can get a processes CPU time using the process' Process object. Checkout the Process class[^] and it's TotalProcessorTime and UserProcessorTime properties.
|
|
|
|
|
Hi All,
I posted this under XML but after reading some of the other posts, it was probably the wrong message board so here it is.
OK I have worked out the below code to return the 'EN' string if I supply the string code, say "1000" of the below XML file but what I need to know is how to search for the string and return the string code. If I could use a wildcard in this it would be great.
Any Thoughts???
Private Sub XPathSearch(ByVal XMLPath As String)
Dim xmlNI As XPathNodeIterator
Dim xpathDoc As XPathDocument
Dim xmlNav As XPathNavigator
Try
xpathDoc = New XPathDocument(XMLPath)
xmlNav = xpathDoc.CreateNavigator()
xmlNI = xmlNav.Select("/MOMLANG/STRING[@code='" & stringValue & "']/LANG[@code='EN']")
While (xmlNI.MoveNext())
'Me.RichTextBox1.AppendText(xmlNI.Current.Name + " : " + xmlNI.Current.Value & vbCrLf)
Me.RichTextBox1.AppendText("String value: " + xmlNI.Current.Value & vbCrLf)
End While
Catch ex As XPathException
System.Console.WriteLine("XMLException: " + ex.Message)
Catch ex As Exception
System.Console.WriteLine("Exception: " + ex.Message)
End Try
End Sub
I have worked with reading simple XML elements but have not worked with atributes and the like. I am also new to both XML and Dev in general.
I have read several articles but most give me examples for reading simple XML e.g.
<person>
<firstname>John</firstname>
<lastname>Smith</lastname>
</person>
The file I am trying to read is below, any help would be great and examples are very much welcome. My goal for the GUI in VB.NET will be to have a textbox to enter string number I am searching for and a dropdown but to select the language.
Regards
Jason
<momlang>
<string code="2000">
<lang code="AR">Access Allowed List</lang>
<lang code="CZ">Access Allowed List</lang>
<lang code="DE">Access Allowed List</lang>
<lang code="DK">Access Allowed List</lang>
<lang code="EE">Access Allowed List</lang>
<lang code="EN">Access Allowed List</lang>
<lang code="ES">Lista de accesos permitidos</lang>
<lang code="FI">Pääsylista sallitut</lang>
<lang code="FR">Liste des accès autorisés</lang>
<lang code="GB">Access Allowed List</lang>
<lang code="HU">Hozzáférés Engedély Lista</lang>
<lang code="IT">Elenco accessi consentiti</lang>
<lang code="NL">Access Allowed List</lang>
<lang code="NO">Liste over systemtilgang</lang>
<lang code="PL">Access Allowed List</lang>
<lang code="RU">Access Allowed List</lang>
<lang code="SE">Använda tillåten lista</lang>
</string>
<string code="10000">
<lang code="AR">المطبوعة:</lang>
<lang code="CZ">Vytisknuto:</lang>
<lang code="DE">Gedruckt:</lang>
<lang code="DK">Printed:</lang>
<lang code="EE">Prinditud:</lang>
<lang code="EN">Printed:</lang>
<lang code="ES">Impreso:</lang>
<lang code="FI">Tulostettu:</lang>
<lang code="FR">Imprimé:</lang>
<lang code="GB">Printed:</lang>
<lang code="HU">Nyomtatott:</lang>
<lang code="IS">Printed:</lang>
<lang code="IT">Stampato:</lang>
<lang code="NL">Afgedrukt:</lang>
<lang code="NO">Skrevet ut</lang>
<lang code="PL">Wydrukowano:</lang>
<lang code="RU">Ðапечатано:</lang>
<lang code="SE">Utskrivet:</lang>
</string>
</momlang>
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
I want to control (get/set) the volume level of master/wave/mic of a soundcard using VB.2008.
Where can I find a sample file or more information.
Me kiter
|
|
|
|
|
|
how can i use the metaphones in VB.NET reply me soon
|
|
|
|
|
|
Hi all!
I'm hoping this is the place to post this, as it's not EXACTLY VB / VB.NET, and there's no Topic for VBScript...
Anyways - To the question.
I'm trying to find a way to input a URL, and have it display the raw HTML Data for it.
Eg: If I input:
http://www.codeproject.com/
It'll output:
<html>
<head>
<title>CodeProject. Free source code and programming help</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Description" content="Free source code and tutorials for Software developers and Architects.">
<meta name="Keywords" content="Free source code, tutorials">
<meta name="Author" content="The Code Project">
</meta></meta></meta></meta></head></html>
etc etc etc.
Does anyone know if this can be done?
It is an ASP Page, using VBScript for Code (Due to limitations, JavaScript cannot be used on the page)
Thanks alot
- Reelix
-= Reelix =-
|
|
|
|
|
|
Works FANTASTICLY!
Thanks alot!!!!
- Reelix
-= Reelix =-
|
|
|
|
|
Ok I have a file that I want to search for an ID number, this number has some data in a string of integers after it. I want to be able to search for the ID number and then record the last number of the string. I'll post some sample data here:
<code>[6661] = "0:3;3;1861999.8;2454571.3;2716464.2;1469749.8",</code>
[12024] = "774:1;1;60000.0;60000.0;60000.0;60000.0",
[7431] = "866:1;1;20000.0;20000.0;20000.0;20000.0",
[12030] = "1191:1;1;33000.0;33000.0;33000.0;33000.0",
[15602] = "336:1;1;28844.0;28844.0;28844.0;28844.0",
[15349] = "769:1;1;70000.0;70000.0;70000.0;70000.0",
The way the integers are read is
The item number for Flurry Axe is 871. The following entry in my Auc-Stat-Simple.lua represents it
[871] = "0:11;14;2805857.8;2670179.1;2780751.9;2991890.6",
To take it one piece at a time:
1) [871] = Item #
2) "0:" = Suffix number
3) "11;" = ???
4) "14;" = ???
5) "2805857.8;" = This correlates with the 3 day average from Stat-Simple, as you can see in the picture of the Tooltip I've attached.
6) "2670179.1;" = This correlates with the 7 day average from Stat-Simple
7) "2780751.9;" = This correlates with the 14 day average from Stat-Simple
8) "2991890.6" = This correlates with the the Average Mimimum BuyOut from Stat-Simple
I want to know how to search for the Item# and then take the last number (8), and then store it. After I have it stored I need to know how to convert that number to a certain format. The format of the number is in an in game currency. The set up would be Gold(g),Silver(s),Copper(c) so number 8 would be formatted as 299g 18s 91c. So we'll look at the first string of data in the code box.
[6661] = "0:3;3;1861999.8;2454571.3;2716464.2;1469749.8",
I want to be able to search for 6661 for the ItemID then get the 8th number in that string which is 1469749.8. I want that number to be converted to this format 146g 97s 50c. My main issue is searching for the ItemID and then I guess I would have to figure out how to split the last number, as well as round the decimal if there is one.
If you want to look at the file that needs to be searched it can be found here http://rapidshare.com/files/144373662/Auc-Stat-Simple.lua.html[^]Virus Scan here for those who want it:http://www.virustotal.com/analisis/49bb2fc360d420da5100356a2603dc12[^] If you want to view the contents of the file, just open it with notepad.
|
|
|
|
|
Well, you could read the file using a StreamReader line-by-line, using StartsWith() to see if the line has the ID you want. If it does, then use Split() on the part of the line contained in quotes, with ; as the delimiter. That will give an array of the values in the line. Then you can get the last item, and parse it accordingly.
|
|
|
|
|