Usage of Arrays..!!
When I'm going through the code that was given to me..I was bit confused in analyzing the arrays. The part of the code that was given to me in as follows
for(int k=1;k<=columns;k++)
weight[1][k]=x[1][k];
trackclusters[1][1][k]=x[1][k];
}now that my doubt is trackclusters[1][1][2]=x[1][2] ??
Please help me out in this regard
As such I said at the very beginning that I was given this code, so I dont know what prompted the person to make use of three dimensional array..
Now my question is if I'm trying to read lots and lots of data from x[1][k] into trackclusters[1][1][k] , will trackclusters be able to read the whole data from x[1][k] ?
Similar Messages
-
can anyone out there help me with this assignment ????? i`ll attach the file to this topic
In this assignment, you are to write a Java applet, using arrays, to simulate the functions of a drinks-vending machine.
The assignment requirements described below are broken down into 2 stages of development, described in this document
as 'Basic Requirements' and 'Additional Features'. You are advised to do your programming progressively in these
stages. An Activity Plan has also been specified for you to follow. Refer to the 'Grading Criteria' on page 5 to have
an idea of how the different components are graded.
1. 1. BACKGROUND
A company intends to build computerised drinks-vending machines to enlarge its business portfolio. You have been tasked to develop a
Java applet that simulates the operation of such a machine to determine if it will meet their needs.
2. 1. BASIC REQUIREMENTS
The machine should have a wide range of drinks available. A customer can choose a drink according to the following criteria:
a) a) Category of Drinks
� � Beverages
� � Soft Drinks
(For beverages, there is choice of whether sugar and/or creamer is required, for which there is an additional charge.)
b) b) Type of Beverages
� � Hot
� � Cold
Once a customer has specified the drink he wants, the amount payable is displayed. The unit prices to be displayed are as follows:
Drinks Price per Cup/Packet ($)
Beverage: Coffee 1.00
Tea 1.20
Milo 1.40
Horlicks 1.35
Chrysanthemum 1.00
Ginger 0.80
Soft Drinks: Apple 1.40
Orange 1.40
Pineapple 1.50
Carrot 2.00
Longan 1.20
Bandung 1.00
(For beverages, a request for sugar or creamer attracts an additional charge of $0.10 each. Creamer is not applicable for
chrysanthemum and ginger.)
The customer may then confirm his order by entering the amount payable (this symbolises his payment for the drink). Whenever the
payment input is not correct, an appropriate error message is displayed, whereupon the customer has to re-enter the amount again.
When the correct amount is paid, the required drink is dispensed.
For any drink that is out of stock, a message is shown, stating that it is not available. Each time a drink is dispensed, the stock for that
drink is updated (For beverages, the stock is stored in units of servings for each cup.) To simplify the testing, you may start the simulation
by setting the stock for each drink to 10 packets or cup-servings.
3. 2. ADDITIONAL FEATURES
In addition, the simulator can have the following features:
a) a) Smart Graphical User-Interface (GUI)
You may build upon the basic requirements by recommending alternative drinks of the same category, whenever a requested
drink is not available (as signified from the stock). In this case, only drinks which are available (i.e., in sufficient stock) are
displayed for the customer to choose. And if only soft drinks are available, the selections for creamer and sugar should be disabled.
b) b) Multiple Orders
A customer could order more than one drink. The system could allow him to specify as many drinks as he wants, prompting him
for an appropriate payment, and then dispensing the drinks accordingly, subject to availability. This may also entail the extension
of the graphical user-interface.
c) c) Sales Analysis
Periodically, the total revenue accumulated since the last collection is printed in descending order of sales for each drink sold,
together with a grand total. The cash is then cleared from the machine. This feature requires password-protection.
d) d) Replenishment of Stock
Periodically, the stock is checked to determine how much of each drink needs to be replenished. For this purpose, a list of the
drinks with the corresponding quantity on hand is printed in ascending order of stock level. Drinks with insufficient stock are
topped up to a level of 10 servings or packets. This feature also requires password-protection.
e) e) Any other relevant features
You are limited only by your creativity. You can add any other relevant features for this project. Please consult your tutor before
you proceed.
To qualify for the full marks for this section, you need to implement 2 features, at least one of which must be either (a) or (b) above.
4. 3. ACTIVITY PLAN
Suggestions for Getting Started
There are many ways that you could complete this assignment. The most important part is to think about the entire project first so that
it is easy to integrate the various pieces. You should also consider what type of graphics you want to incorporate.
a) a) Analysis
1. Understand the program specification and the requirements before attempting the project.
b) b) Program Design
2. Work out the GUI components (e.g., TextFields, CheckBoxes, ChoiceBoxes, Buttons, etc.) needed to get the user input.
3. 3. Work out the main logic of the program using modular programming techniques; i.e. use methods appropriately. E.g., tasks that perform
4. 4. a well-defined function or those that are repeated should be coded as methods. For example, you can write the methods, displayBill(),
5. 5. makePayment(), computeTotal(), dispenseDrink(), etc. You need to think carefully about the return type and the parameters of each
6. 6. method.
7. 7. You are required to use arrays appropriately for this assignment. Marks will be deducted for inefficient use or non-usage of arrays.
c) Implementation & Testing
8. 8. Write the method definition of each method ONE at a time.
9. 9. Test your program logic to make sure that it works. In the interim, you can use �g.drawString(�);� or �System.out.println(�);� to print
10. 10. out intermediate results so that you can see whether your program is working correctly. You may not want to bother about error-checking
11. 11. at this point. You should test each method as soon as it is written, as it is much easier to debug your program in this way.
5. 4. DELIVERABLES
By Monday, 25th February before 5:00 p.m., hand in the following to the School of ICT Administrative Office at Block 31, level 8:
� � A copy of the printout of your .java file.
� � A diskette labelled with your name, group, student ID. The diskette should contain ALL the necessary files (.java, .html, and .class)
to run your applet.
� � The above in an envelope topped with the Assignment Completion Report (see pages 6, 7 & 8). Page 6 is for you to paste on top
of your envelope whilst pages 7 and 8 are for you to document your Test Plan, and write your comments (including any
special instructions to run your program) - to be inserted into the envelope.
In your .java program, you are to include a blocked comment at the top stating:
q q Your name, group, student ID.
q q Assumptions (if any) or any deviations from the specified requirements.
q q Any features that you would like to highlight.
6. 5. WALK-THROUGH OF PROGRAM
Monday 25th February at 9:30 a.m. SHARP
In the walk-through, you will be asked to give short, written answers to some questions about your program. These questions will assess
your basic understanding of the code that you are handing in. If you fail to display adequate understanding of your own program, you can
be down-graded by up to two letter grades from what you would have normally received. It is also possible that you will be called to
perform a demonstration cum explanation of your work if it is suspected that you have copied someone else�s work. Lesson: do your own
work and you will have no problem!
7. 6. GRADING CRITERIA FOR PROGRAMMING
Correct and robust implementation of basic features 55 %
Additional features 20 %
Programming style:� � Program design� � Appropriate use of arrays� � Appropriate use of variables, methods, and parameters� � Proper usage of control structures (e.g. if/else, loops) 15 %
Good programming practice:� � Meaningful variable names � � Proper indentations� � Useful and neat comments 5 %
Adequate (black-box) testing:� � Suitably-designed test plan 5 %
Total: 100 %
PROBLEM SOLVING & PROGRAMMING II
(Dip IT/MMC/EI, Year 1, Semester 2)
Assignment Completion Report (to be attached to cover of envelope)
Name: ___________________________________ Group: ________
ID: ___________________ Date & Time submitted: ____________
Requirements % Done (0-100) Remarks
BASIC FEATURES
� � Can choose category (and select appropriate additives)
� � Can choose drink (with error checking)
� � Can display amount payable
� � Can indicate availability of drink (with error checking)
� � Can accept payment for drink (with error checking)
� � Can dispense drink
� � Can update stock
ADDITIONAL FEATURES
� � Smart GUI
� � Multiple Orders
� � Sales Analysis (with password checking)
� � Stock Replenishment(with password checking)
� � Any other relevant features
Test Plan
Using black-box testing, record your test specification and the results according to the following format (the examples here are provided
for your reference only):
Test No. Purpose Test Shot/Data Expected Result Actual Result
E.g. 1a) Check whether beverage can be selected Click on �Chrysanthe-mum� button Checkbox for �Sugar� but not �Creamer� appear �Sugar� and checkboxes appeared
E.g. 1b) Check whether chrysanthemum with sugar can be ordered Select sugar and click on �Order� button Amount payable appears as �$1.10� (i.e., $1.00 + $0.10) Amount payable shown as $1.10
E.g. 1c) Check whether correct payment can be accepted Enter �1.00� in �Payment� textfield Error message �Insufficient payment - $0.10 short� appears Confirmation message �Drink being dispensed� appeared � ERROR!
E.g. 1d) Re-test 1c), after amending program As above As above Error message �Insufficient payment - $0.10 short� appeared
etc.
etc.
Remember to hand in this test plan together with the other deliverables in the envelope.
Have you�
1. 1. Checked to make sure program still works properly even with windows resized?
2. 2. Tested your program thoroughly, as if you're trying to break it?
Any comments about this assignment? Any special instructions to run your program? Write it here.public class testing1 {
String gg;
public void testing3() {
System.out.print(gg); }
// this is are constructor for the object and method we are going to make
next code
class testing {
public static void main(String[] args) {
testing1 tes = new testing1();
tes.gg = "hello there";
tes.testing3(); //here we have made a object and a method
hope this helps -
How can i wrote configuration file in Log4j
iam new log4j .i have seen one small programme in log4j examples folder ..i e. shown below
Sort.java
=====
package examples;
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.Logger;
import org.apache.log4j.Priority;
Example code for log4j to viewed in conjunction with the {@link
examples.SortAlgo SortAlgo} class.
<p>This program expects a configuration file name as its first
argument, and the size of the array to sort as the second and last
argument. See its <b>source
code</b> for more details.
<p>Play around with different values in the configuration file and
watch the changing behavior.
<p>Example configuration files can be found in <a
href="doc-files/sort1.properties">sort1.properties</a>, <a
href="doc-files/sort2.properties">sort2.properties</a>, <a
href="doc-files/sort3.properties">sort3.properties</a> and <a
href="doc-files/sort4.properties">sort4.properties</a> are supplied with the
package.
<p>If you are also interested in logging performance, then have
look at the {@link org.apache.log4j.performance.Logging} class.
@author Ceki Gülcü */
public class Sort {
static Logger logger = Logger.getLogger(Sort.class.getName());
public static void main(String[] args) {
if(args.length != 2) {
usage("Incorrect number of parameters.");
int arraySize = -1;
try {
arraySize = Integer.valueOf(args[1]).intValue();
if(arraySize <= 0)
usage("Negative array size.");
catch(java.lang.NumberFormatException e) {
usage("Could not number format ["+args[1]+"].");
PropertyConfigurator.configure(args[0]);
int[] intArray = new int[arraySize];
logger.info("Populating an array of " + arraySize + " elements in" +" reverse order.");
for(int i = arraySize -1 ; i >= 0; i--) {
intArray[i] = arraySize - i - 1;
SortAlgo sa1 = new SortAlgo(intArray);
sa1.bubbleSort();
sa1.dump();
// We intentionally initilize sa2 with null.
SortAlgo sa2 = new SortAlgo(null);
logger.info("The next log statement should be an error message.");
sa2.dump();
logger.info("Exiting main method.");
static void usage(String errMsg) {
System.err.println(errMsg);
System.err.println("\nUsage: java org.apache.examples.Sort " + "configFile ARRAY_SIZE\n"+
"where configFile is a configuration file\n"+" ARRAY_SIZE is a positive integer.\n");
System.exit(1);
and
SortAlgo.java
==========
package examples;
import org.apache.log4j.Category;
import org.apache.log4j.NDC;
Example code for log4j to viewed in conjunction with the {@link
examples.Sort Sort} class.
<p>SortAlgo uses the bubble sort algorithm to sort an integer
array. See also its <b>source
code</b>.
@author Ceki Gülcü */
public class SortAlgo {
final static String className = SortAlgo.class.getName();
final static Category CAT = Category.getInstance(className);
final static Category OUTER = Category.getInstance(className + ".OUTER");
final static Category INNER = Category.getInstance(className + ".INNER");
final static Category DUMP = Category.getInstance(className + ".DUMP");
final static Category SWAP = Category.getInstance(className + ".SWAP");
int[] intArray;
SortAlgo(int[] intArray) {
this.intArray = intArray;
void bubbleSort() {
CAT.info( "Entered the sort method.");
for(int i = intArray.length -1; i >= 0 ; i--) {
NDC.push("i=" + i);
OUTER.debug("in outer loop.");
for(int j = 0; j < i; j++) {
NDC.push("j=" + j);
// It is poor practice to ship code with log staments in tight loops.
// We do it anyway in this example.
INNER.debug( "in inner loop.");
if(intArray[j] > intArray[j+1])
swap(j, j+1);
NDC.pop();
NDC.pop();
void dump() {
if(! (this.intArray instanceof int[])) {
DUMP.error("Tried to dump an uninitialized array.");
return;
DUMP.info("Dump of integer array:");
for(int i = 0; i < this.intArray.length; i++) {
DUMP.info("Element [" + i + "]=" + this.intArray);
void swap(int l, int r) {
// It is poor practice to ship code with log staments in tight
// loops or code called potentially millions of times.
SWAP.debug( "Swapping intArray["+l+"]=" + intArray[l] +
" and intArray["+r+"]=" + intArray[r]);
int temp = this.intArray[l];
this.intArray[l] = this.intArray[r];
this.intArray[r] = temp;
This program expects a configuration file name as its first
argument, and the size of the array to sort as the second and last
argument. See its <b>source
code</b> for more details.
please help me how can write that configuration file
thanksHi bala,
check that log4j manual I pointed to in yer previous thread.
This is a pot-boiler config file... Copy it into some file say "props.conf" and use it.
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%nCheers, -
Write some JAVA for me please, not working the way I wanted it too...
Here's what I am getting when I go to run it:
C:\Documents and Settings\Brad.HOME\Desktop\FINAL>java project1
Usage: project1 [Array File Path]
C:\Documents and Settings\Brad.HOME\Desktop\FINAL>
What I need is for it to ask me to enter the location of the numbers file and then calculate the Max, Min, Mean, etc off of that file I enter in. Right now it just says:
Usage: project1 [Array File Path]
-------------------------------java below-------------------------------------------------
import java.io.*;
public class project1 {
* Array File Path
private String location;
* set Location
* @param location String
public void setLocation(String location) {
this.location = location;
* Program initialization
public project1() {
int ar[] = new int[50];
ReadFile(location, ar);
sort(ar);
System.out.println("Minimum= " + ar[0]);
System.out.println("Maximum=" + ar[ar.length - 1]);
System.out.println("Mean= " + mean(ar));
System.out.println("Mode= " + modal(ar));
System.out.println("Median= " + median(ar));
System.out.println("Std Dev= " + stdDev(ar));
* Main program
* @param args String[]
public static void main(String args[]) {
if (args.length == 1) {
new project1().setLocation(args[0]);
else {
System.out.println("Usage: project1 [Array File Path]");
* Calculate the mean
* @param ar int[]
* @return double
public double mean(int ar[]) {
int sum = 0;
for (int i = 0; i < ar.length; i++) {
sum += ar;
return (sum / ar.length);
* Calculate the mode/modal
* @param a int[]
* @return int
public int modal(int a[]) {
int n;
int freq = 0;
int Mfreq = 0;
int Mn = a[0];
for (int i = 0; i < a.length; i++) {
n = a[i];
for (int j = 0; j < a.length; j++) {
if (a[j] == n) {
freq++;
if (freq > Mfreq) {
Mn = n;
return Mn;
* Calculate the median
* @param a int[]
* @return int
public int median(int a[]) {
if (a.length % 2 == 0) {
int x = a[a.length / 2];
int y = a[ (a.length + 2) / 2];
return (x + y) / 2;
else {
return a[ (a.length + 1) / 2];
* Calculate Standard Deviation
* @param a int[]
* @return double
public double stdDev(int a[]) {
int s2 = 0;
int s = 0;
for (int i = 0; i < a.length; i++) {
s2 += (a[i] * a[i]);
s += a[i];
return Math.sqrt( (s2 - (s * 2) / a.length) / (a.length - 1));
* Sort integer array
* @param a int[]
public void sort(int a[]) {
int tmp;
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a.length; j++) {
if (a[j] > a[j + 1]) {
tmp = a[j];
a[j] = a[j + 1];
a[j + 1] = tmp;
* Read integer array from specified file
* @param filename String
* @param ar int[]
* @return int
public int ReadFile(String filename, int ar[]) {
File infile = new File(filename);
int value, n = 0;
try {
BufferedReader reader = new BufferedReader(new FileReader(infile));
String line = null;
while ( (line = reader.readLine()) != null) {
value = Integer.parseInt(line);
ar[n++] = value;
return n;
catch (IOException e) {
System.err.println("Problem reading input file!");
System.exit(1);
return n;Please use code tags when posting code. There is a
button labeled code right above the text box
where you type in your post.
Your first problem occurs herepublic static
void main(String args[]) {
if (args.length == 1) {
new project1().setLocation(args[0]);
else {
System.out.println("Usage: project1 [Array File
y File Path]");
}This code executes when you first launch the
application. It checks to see if there were any
arguments in the comman line. If the number of
arguments is not equal to 1, then you get the Usage
output. You must launch the program with one
argument.I tried java project1 C:\\Temp.txt, but it still ends up with a NullException handler. I edited the code and added a catch for it so it returns File doesn't exist, but I swear it does and I'm pointing to it correctly... -
Hi,
I have constructed two fpga vi's for cRIO FPGA and tried to run them parallel in a host vi but when I run the host vi then the fpga vi's did not work properly.
I attach the vi's. What is the problem with these codes?
Attachments:
trigger.vi 57 KB
host.vi 375 KB
fpga1.vi 46 KBHi,
Unfortunately for you, this thread is correct and you can only have 1 LabVIEW FPGA VI running at a time.
However, here are some tips that may help you out:
It is possible to load different FPGA personalities during run time. Therefore, if you can separate your application into two different applications, you can load them on the FPGA while it is running ( only takes about 1 second to switch the FPGA to another personality)
Instead of putting the multiple FPGA VIs into a top level VI, have you tried to copy the block diagram from one into the other? In other words, combine them into a single VI with multiple parallel loops?
If you are having trouble with space on the FPGA after combining the FPGA block diagrams into one there are many documents online that will help you optimize the FPGA VI. For Example
Combine boolean indicators into a single U32( will save a significant amount of space)
Reduce the usage of arrays on your FPGA VI ( if you have them). There are other methods of storing this data such as a FIFO or the memory on the FPGA
Since you are using the digital only board and if memory serves me right, you can read the port instead of each boolean individually. This would save you some diagram space as well as some FPGA space.
Last but not least, consider contacting a systems integrator to assit with the development of your FPGA VI or the system as a whole. I know of one that does great work with FPGA's: www.viengineering.com .
Mike
V I Engineering -
I use a series of <1 or 0> values in a two-dimension array, and use a boolean[][] variable to store them. But the size of each element on the stack is static, isn't it, so if I need the 1/0 values as binary strings, I might as well use an int[][] variable? I mean, it wouldn't take up any more memory or any more system resources to process? The difference actually is of little importance in my program, but I hope I'm not the only one to find the question interesting.
~HWhat ever you are actually looking for, the answer is "it depends". See
http://java.sun.com/docs/books/vmspec/2nd-edition/html/Overview.doc.html#22909 and
http://java.sun.com/docs/books/vmspec/2nd-edition/html/Overview.doc.html#6654
What comes to memory usage, boolean arrays (equivalent to byte arrays) are smaller than int arrays. That means that the stack size, which may vary, can be smaller if you use boolean arrays. -
Congrats on the new OSS site, some suggestions...
Adobe folks: congratulations on this new open source site. It looks well done, and a good step for Adobe. I have a few suggestions:
(1) svn via https. Many of your customers will be behind corporate firewalls that may implement a transparent HTTP proxy. Some of these proxies (Symantec's enterprise firewall offerings, for example) do not understand Delta-V WebDAV methods used by subversion breaking svn over http. Consider using https to get around this and to marginally increase security (most svn users will cache ssl certificates, preventing a hypothetical, but unlikely man-in-the-middle injection of evil code into a checkout).
(2) Wiki-type offerings. Much of the site is very much producer-to-consumer distribution model; there may be value in increasing community contribution (e.g. documentation) above and beyond the forums.
(2) Some kind of source browsing (like Trac, for a good example of this done well in commercial open-source projects, look at Apple MacOSForge pages such as this: http://trac.calendarserver.org/projects/calendarserver ).
Sean UptonI didn't attempt to preserve formatting in that post intentionally to illustrate some poor code I've encountered.
Everyone has their preference, I've found that in lengthy programs the vertical scrolling gets ridiculous really fast. Right from the start a program that consists of five functions and twenty if statements gets 25 extra line breaks, add else blocks and it gets a little silly.
I can't see the benefit: the visual que from a rapid access point of view actually favors omitting extraneous line breaks:
eg:
if()
else
// 8 lines
vs.
if() {
} else {
//5 lines
b Next issue then:
function f(a:Array /* of Number */):Array /* of Object */
This I have an actual legitimate issue regarding rapid development and corporate implementation guidelines that are pretty prevalent (at least in my 11 or so years of development)
b case in point:
For a particular change order made to some integral part of a hypothetical proprietary business application.
// Change order #011198
// Client[Client Name] requested return value changed to unsigned integer from array.
// 12/5/2008 2:30pm montana p [email protected]
function f(a:Array /* of Number */, i:uint ):uint /* of Object */
return uint;
function f(a:Array /* of Number */):Array /* of Object */
return array;
b ^ this obviously doesn't work, and costs more money to do since the programmer must take the time to edit out the nested comment blocks, or use // single line comments
b The preferred method is:
// usage: f(Array of Number);
function f(a:Array):Array { /* of Number */
return array;
The resultant change:
// Change order #011198
// Client[Client Name] requested return value changed to unsigned integer from array.
// 12/5/2008 2:30pm montana p [email protected]
// usage: f(Array of Number, uint);
function f(a:Array, i:uint):uint {
return i;
// usage: f(Array of Number);
function f(a:Array):Array {
return array;
b this method has the added benefit of adding rudimentary documentation for the function call itself
There's always room for improvement. Saying "we already have so much code formatted x way so we shouldn't change our practices", even if there may be value to doing so, is no good. I understand the hesitance. However, if there is evidence supporting a particular design pattern's
inherent value, it should be considered notwithstanding existing methodologies.
thank you for your time, I look forward to more amazing work from the adobe team.
(sorry about not taking the time to format this post a little nicer...back to work) -
Nested IPE (In Place Element) usage when accessing Cluster/Array data via DVR
I am sharing data across several VIs and loops via a DVR, and accessing the data via a DVR IPE. The data is a cluster of arrays. The diagram below (VI attached) illustrates the structures invloved, but not the structure of the application.
(The diagram above does not include initialization of the arrays, as it is intended only to illustrate the Cluster1 data type. Array lengths could be 100.)
The DVR (DVR1) is passed to multiple VIs of the application at startup.
Each VI executes loops that either read or write particular elements of each array (fArray1 or fArray2).
I believe the DVR IPE (B1-DVR) provides blocking so that only one task can modify the data (Cluster1) at any time.
Case 1 illustrates how I currently WRITE to array elements. The outer IPE (block B1) is rolled into a VI (not shown) that takes DVR1, Index, and Value as inputs.
Cases 2 - 4 illustrate 3 additional methods that remove one or both of the inner IPEs (B2-Cluster and B3-Array).
Case 2: IPE B3 (Array Index/Replace Elements) is replaced with a non-IPE 'Replace Array Subset'.'
Case 3: IPE B2 (Unbundle / Bundle Elemnts)' is replaced with a non-IPE cluster 'Unbundle'/'Bundle'.
Case 4: removes both B2 and B3.
I implemented case 1 a long time ago. When I had to do the same thing again recently, I did case 4. When I stumbled across my earlier implementation, I was a bit suprised
Which of the 4 cases should take the least time (or resources) to execute? I think case 4 has as few array allocations as any of the other 3.
The attached image did not capture the Buffer Allocation marks, so I marked the ones that differed with a red "B".
I am only interested in differences in how the arrays are handled, so I see no signioficant differences.
Is this one of those cases where LV doesn't need my help?
Incidently, I recently wrote a small app with shared data and decided to try FGVs to share array data. For small arrays, 10^7 iterations, and an FGV based array-element read followed by a element write, the FGV was faster. 1.2us per read/write for FGV vs 3us per r/w for an DVR/IPE based read/write (like above).
Peter
LV 2011 SP1, Windows 7 64-Bit
Attachments:
IPE.vi 9 KBOption 1 is a definite no and as far as I know it has been NI's explicit intention to steer clear from it. I believe there's an idea in the IE which asks for this.
I agree that option 2 makes sense, but I don't think it should be something the user specifies. Either LV can detect it automatically or it can't, but I doubt NI would let you have an option which creates the possibility for this kind of bug.
I'm not sure, but the mark as modifier option on the IPES might be the option you're looking for. I know that it exists and I know very roughly what it does, but the documentation for it is very limited and I never actually played around with it, as usually I don't need these kinds of optimizations.
You may well be right that a new option on the IPES is desirable and you should probably add it to the idea exchange.
As for NIWeek, I'm not going this year, so I have no idea what kinds of sessions are around, but it's a great place to find people who know what they're talking about and ask them about it directly. Certain people in LV R&D would probably be ideal for this and if you ask relevant people, you might even get their names. I'm sure buying them a beer would also help to loosen their tounges. If you ask me, this type of interaction is the main value of the conference, not the sessions themselves.
Try to take over the world! -
Hi,
this thread is based on my post in the LabVIEW idea exchange.
I put my VIs in the attached .rar file.
Regards
Marc
CLD
Solved!
Go to Solution.
Attachments:
Inplace_VI.ZIP 21 KBThat would be a good explanation. There was a thread on something very similar to this recently. Can't remember exactly the topic but Daniel's answer certainly triggered some memories of a very similar discussion taking place.
I think it had to do with LV assigning a Array created as a constant as Read-only so in order to make changes to it it needs to be copied to a new memory location, thus leaving the constant unchanged.
I wonder how it performs in other LV versions.
Shane.
PS: Found the thread. HERE.
Message Edited by Intaris on 08-20-2009 03:23 AM
Say hello to my little friend.
RFC 2323 FHE-Compliant -
Vector or Array List better usage
Hi form
For storage of large Object's Which is a better management API
Vector OR ArrayList
Please some one Enlightern me
with regards
KarthikPlease some one Enlightern meObjects in Java are always handled using references (pointers) to the actual object values (which reside on the so called heap).
So from the point of the size of the objects, Vector and ArrayList are equivalent. No object values are stored in them, only references to objects and references always have the same size. -
Memory usage of excel stays high after Macro is executed and excel crashes after trying to close it
Hi,
I'm trying to resolve an issue with an excel based tool. The macros retrieve data from an Oracle database and do calculations with the data. They also open and write into files in the same directory. The macros all run and finish the calculations. I can
continue to use and modify the sheet. I can also close the workbook, however excel memory usage I see in the windows Task manager stays elevated.If I close Excel it says: Excel stopped working and then it tries to recover information...
I assume something in the macro did not finish properly and memory was not released. I would like to check what is still open (connection, stream or any other object) when I close the workbook I would like to have a list of all still used memory. Is there
a possibility to do so.
Here the code I'm using, its reduced to functions which open something. Functions
get_v_tools() and get_change_tools() are same as get_client_positions().
Public conODBC As New ADODB.Connection
Public myPath As String
Sub get_positions()
Dim Src As range, dst As range
Dim lastRow As Integer
Dim myPath As String
lastRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row
Sheets("SQL_DATA").range("A2:AD" & lastRow + 1).ClearContents
Sheets("SQL_DATA").range("AG2:BE" & lastRow + 2).ClearContents
Sheets("SQL_DATA").range("AE3:AF" & lastRow + 2).ClearContents
k = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
Sheets("ToolsList").range("A2:M" & k).ClearContents
'open connection
Call open_connection
lastRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row
If lastRow < 2 Then GoTo ErrorHandling
'copy bs price check multiplications
Set Src = Sheets("SQL_DATA").range("AE2:AF2")
Set dst = Worksheets("SQL_DATA").range("AE2").Resize(lastRow - 1, Src.columns.Count)
dst.Formula = Src.Formula
On Error GoTo ErrorHandling
'new prices are calculated
newPrice_calculate (lastRow)
Calculate
myPath = ThisWorkbook.Path
'Refresh pivot table in Position Manager
Sheets("Position Manager").PivotTables("PivotTable3").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
myPath & "\[Position_Manager_v1.0.xlsm]SQL_DATA!R1C2:R" & lastRow & "C31" _
, Version:=xlPivotTableVersion14)
ErrorHandling:
Set Src = Nothing
Set dst = Nothing
If conODBC.State <> 0 Then
conODBC.Close
End If
End Sub
Sub open_connection()
Dim sql_data, sql_data_change, sql_data_v As Variant
Dim wdth, TotalColumns, startRow As Integer
Dim rst As New ADODB.Recordset
Errorcode = 0
On Error GoTo ErrorHandling
Errorcode = 1
With conODBC
.Provider = "OraOLEDB.Oracle.1"
.ConnectionString = "Password=" & pswrd & "; Persist Security Info=True;User ID= " & UserName & "; Data Source=" & DataSource
.CursorLocation = adUseClient
.Open
.CommandTimeout = 300
End With
startRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row + 1
sql_data = get_client_positions(conODBC, rst)
wdth = UBound(sql_data, 1)
Sheets("SQL_DATA").range("A" & startRow & ":AA" & wdth + startRow - 1).Value = sql_data
'Run change tools instruments
startRow = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
sql_data_change = get_change_tools(conODBC, rst)
wdth = UBound(sql_data_change, 1)
Sheets("ToolsList").range("A" & startRow & ":M" & wdth + startRow - 1).Value _
= sql_data_change
'open SQL for V tools instruments
startRow = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
sql_data_v = get_v_tools(conODBC, rst)
wdth = UBound(sql_data_v, 1)
Sheets("ToolsList").range("A" & startRow & ":L" & startRow + wdth - 1).Value = sql_data_v
conODBC.Close
ErrorHandling:
If rst.State <> 0 Then
rst.Close
End If
Set rst = Nothing
End Sub
Private Function get_client_positions(conODBC As ADODB.Connection, rst_posi As ADODB.Recordset) As Variant
Dim sql_data As Variant
Dim objCommand As ADODB.Command
Dim sql As String
Dim records, TotalColumns As Integer
On Error GoTo ErrorHandling
Set objCommand = New ADODB.Command
sql = read_sql()
With objCommand
.ActiveConnection = conODBC 'connection for the commands
.CommandType = adCmdText
.CommandText = sql 'Sql statement from the function
.Prepared = True
.CommandTimeout = 600
End With
Set rst_posi = objCommand.Execute
TotalColumns = rst_posi.Fields.Count
records = rst_posi.RecordCount
ReDim sql_data(1 To records, 1 To TotalColumns)
If TotalColumns = 0 Or records = 0 Then GoTo ErrorHandling
If TotalColumns <> 27 Then GoTo ErrorHandling
If rst_posi.EOF Then GoTo ErrorHandling
l = 1
Do While Not rst_posi.EOF
For i = 0 To TotalColumns - 1
sql_data(l, i + 1) = rst_posi.Fields(i)
Next i
l = l + 1
rst_posi.MoveNext
Loop
ErrorHandling:
rst_posi.Close
Set rst_posi = Nothing
Set objCommand = Nothing
get_client_positions = sql_data
End Function
Private Function read_sql() As String
Dim sqlFile As String, sqlQuery, Line As String
Dim query_dt As String, client As String, account As String
Dim GRP_ID, GRP_SPLIT_ID As String
Dim fso, stream As Object
Set fso = CreateObject("Scripting.FileSystemObject")
client = Worksheets("Cover").range("C9").Value
query_dt = Sheets("Cover").range("C7").Value
GRP_ID = Sheets("Cover").range("C3").Value
GRP_SPLIT_ID = Sheets("Cover").range("C5").Value
account = Sheets("Cover").range("C11").Value
sqlFile = Sheets("Cover").range("C15").Value
Open sqlFile For Input As #1
Do Until EOF(1)
Line Input #1, Line
sqlQuery = sqlQuery & vbCrLf & Line
Loop
Close
' Replace placeholders in the SQL
sqlQuery = Replace(sqlQuery, "myClent", client)
sqlQuery = Replace(sqlQuery, "01/01/9999", query_dt)
sqlQuery = Replace(sqlQuery, "54747743", GRP_ID)
If GRP_SPLIT_ID <> "" Then
sqlQuery = Replace(sqlQuery, "7754843", GRP_SPLIT_ID)
Else
sqlQuery = Replace(sqlQuery, "AND POS.GRP_SPLIT_ID = 7754843", "")
End If
If account = "ZZ" Then
sqlQuery = Replace(sqlQuery, "AND AC.ACCNT_NAME = 'ZZ'", "")
Else
sqlQuery = Replace(sqlQuery, "ZZ", account)
End If
' Create a TextStream to check SQL Query
sql = sqlQuery
myPath = ThisWorkbook.Path
Set stream = fso.CreateTextFile(myPath & "\SQL\LastQuery.txt", True)
stream.Write sql
stream.Close
Set fso = Nothing
Set stream = Nothing
read_sql = sqlQuery
End FunctionThanks Starain,
that's what I did the last days and found that the problem is in the
newPrice_calculate (lastRow)
function. This function retrieves data (sets it as arrays) which was correctly pasted into the sheet, loops through all rows and does math/calendar calculations with cell values using an Add-In("Quantlib")
Public errorMessage as String
Sub newPrice_calculate(lastRow)
Dim Type() As Variant
Dim Id() As Variant
Dim Price() As Variant
Dim daysTo() As Variant
Dim fx() As Variant
Dim interest() As Variant
Dim ObjCalend as Variant
Dim newPrice as Variant
On Error GoTo Catch
interest = Sheets("SQL_DATA").range("V2:V" & lastRow).Value
Type = Sheets("SQL_DATA").range("L2:L" & lastRow).Value Id = Sheets("SQL_DATA").range("M2:M" & lastRow).Value Price = Sheets("SQL_DATA").range("T2:T" & lastRow).Value
daysTo = Sheets("SQL_DATA").range("K2:K" & lastRow).Value
fx = Sheets("SQL_DATA").range("U2:U" & lastRow).Value
qlError = 1
For i = 2 To lastRow
If (i, 1) = "LG" Then
'set something - nothing spectacular like
interest(i, 1) = 0
daysTo(i , 1) = 0
Else
adjTime = Sqr(daysTo(i, 1) / 365)
ObjCalend(i,1) =Application.Run("qlCalendarHolidaysList", _
"CalObj", ... , .... other input parameters)
If IsError(ObjCalend(i,1)) Then GoTo Catch
'other calendar calcs
newPrice(i,1) = Application.Run( 'quantLib calcs)
End If
Catch:
Select Case qlError
Case 1
errorMessage = errorMessage & " QuantLibXL Cal Error at: " & i & " " & vbNewLine & Err.Description
ObjCalend(i,1) (i, 1) = "N/A"
End Select
Next i
Sheets("SQL_DATA").range("AB2:AB" & lastRow).Value = newPrice
'Sheets("SQL_DATA").range("AA2:AA" & lastRow).Value = daysTo
' erase and set to nothing all arrays and objects
Erase Type
Erase id
Erase Price
Set newPrice = Nothing
Is there a possibility to clean everything in:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
End Sub
Thanks in advance
Mark -
Platform is WIN_XP Pro and machine is a P4 at 2.5Ghz with 512 Mb ram.
LV7.1 + PCI 6229
I am using 50ms Timed loop for running a state machine inside it
and also a whole lot of other things like reading / writing
DAQMx functions; file I/O functions and such. As the
project involves a main and sub-panlel set up local variables
could not be elimnated fully and there should be something like 150 of
them. But not all are accessed always - maybe about 15 of them at any
given time depending on the SM staus.
Problem :
Once started the "Finished late" indication is off and
the actual timing alternates between 49 to 52 ms. The CPU
usage is around 25%.
But as time goes by, the system gets unstable : After 15 minutes
or so, the Finished Late indication is always ON and the CPU usage is
gradually tending towards or exceeds 100%.
Obviously the machine control timing now gets affected and things slow
down badly. Closing the application ands restarting repeats the above
cycle.
I am at a loss to understand what is happening ? WIll
breaking down the single Timed Loop to multiple ones help ? WIll
that be an efficient way of parallel threading ?
I can post the code but its quite large and will do it as a last resort.
thanks
Raghunathan
Raghunathan
LV2012 to Automate Hydraulic Test rigs.Hello,
It sounds like an interesting problem. It would be worth some experimentation to figure out what's going wrong - attempting to decouple major "pieces" of the code would be helpful. For example, you could try breaking your code into multiple loops if that makes sense in your architecture, but perhaps you could even eliminate all but one of the loops to begin with, and see if you can correlate the problem to the code in just one of your loops.
Another concern is that you mention using many local variables. Variable read operations cause new buffer allocations, so if you're passing arrays around that way, you could be hitting a problem of forcing your machine to perform many allocations and deallocations of memory. As arrays grow, this can be a bigger and bigger problem. You can use other techniques for passing data around your block diagram, such as dataflow if possible (just simple wires), or queues where dataflow can't dicatate program flow completely.
Hopefully looking into your code with the above considerations will lead you in the right direction. In your case, removing code so that you can identify which elements are causing the problem should help significantly.
Best Regards,
JLS
Best,
JLS
Sixclear -
/ usage questions...
Hello.
I have 2 questions:
1. I have noticed that my / partition's used space increased by ~10M from the last time I've checked it, from 111M to 121M. What could be the cause of that? (see the info below...)
2. The output of df and du is not what I am expecting it to be. I.e. there are differences between the disk usage reported by these 2 commands on the / partition. What could be the cause of this? (see the info below...)
Any reply or any RTFM re-dirrectioning is appreciated.
TIA
Info:
[root@guns /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/ide/host0/bus0/target0/lun0/part5
189M 121M 68M 65% /
none 235M 0 235M 0% /dev/shm
tmpfs 235M 4.0K 235M 1% /tmp
/dev/ide/host0/bus0/target0/lun0/part2
31M 5.2M 24M 18% /boot
/dev/ide/host0/bus0/target0/lun0/part6
2.4G 713M 1.7G 30% /usr
/dev/ide/host0/bus0/target0/lun0/part7
1.9G 374M 1.5G 20% /var
/dev/ide/host0/bus0/target0/lun0/part8
57G 35G 23G 62% /home
/dev/ide/host0/bus0/target0/lun0/part9
957M 486M 472M 51% /opt
[root@guns /]# ls
bin boot dev etc home lib mnt opt proc root sbin sys tmp udev usr var
[root@guns /]# du -sh bin/ dev/ etc/ lib/ mnt/ proc/ root/ sbin/ sys/ tmp/ udev/
2.8M bin/
0 dev/
5.5M etc/
64M lib/
0 mnt/
481M proc/
12M root/
5.2M sbin/
du: cannot access `sys/bus/pci/drivers/Intel(R) 830M/845G/852GM/855GM/865G Framebuffer Driver': No such file or directory
0 sys/
4.0K tmp/
0 udev/
Here's my dmesg output in case it helps...
Linux version 2.6.11.7-ARCH (root@earth) (gcc version 3.4.3) #1 SMP Sat Apr 9 13:37:54 PDT 2005
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000001dffc000 (usable)
BIOS-e820: 000000001dffc000 - 000000001dfff000 (ACPI data)
BIOS-e820: 000000001dfff000 - 000000001e000000 (ACPI NVS)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
479MB LOWMEM available.
On node 0 totalpages: 122876
DMA zone: 4096 pages, LIFO batch:1
Normal zone: 118780 pages, LIFO batch:16
HighMem zone: 0 pages, LIFO batch:1
DMI 2.3 present.
ACPI: RSDP (v000 ASUS ) @ 0x000f6b10
ACPI: RSDT (v001 ASUS A7VI-VM 0x30303031 MSFT 0x31313031) @ 0x1dffc000
ACPI: FADT (v001 ASUS A7VI-VM 0x30303031 MSFT 0x31313031) @ 0x1dffc080
ACPI: BOOT (v001 ASUS A7VI-VM 0x30303031 MSFT 0x31313031) @ 0x1dffc040
ACPI: DSDT (v001 ASUS A7VI-VM 0x00001000 MSFT 0x0100000b) @ 0x00000000
ACPI: PM-Timer IO Port: 0xe408
Allocating PCI resources starting at 1e000000 (gap: 1e000000:e1ff0000)
Built 1 zonelists
Kernel command line: root=/dev/hda5 vga=773 ro
Local APIC disabled by BIOS -- you can enable it with "lapic"
mapped APIC to ffffd000 (013e3000)
Initializing CPU#0
PID hash table entries: 2048 (order: 11, 32768 bytes)
Detected 807.525 MHz processor.
Using pmtmr for high-res timesource
Console: colour dummy device 80x25
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 480548k/491504k available (4086k kernel code, 10360k reserved, 1236k data, 288k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay loop... 1597.44 BogoMIPS (lpj=798720)
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: After generic identify, caps: 0183f9ff c1c7f9ff 00000000 00000000 00000000 00000000 00000000
CPU: After vendor identify, caps: 0183f9ff c1c7f9ff 00000000 00000000 00000000 00000000 00000000
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 64K (64 bytes/line)
CPU: After all inits, caps: 0183f9ff c1c7f9ff 00000000 00000020 00000000 00000000 00000000
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
Enabling fast FPU save and restore... done.
Checking 'hlt' instruction... OK.
ACPI: setting ELCR to 0200 (from 0e00)
CPU0: AMD Duron(tm) Processor stepping 01
per-CPU timeslice cutoff: 182.83 usecs.
task migration cache decay timeout: 1 msecs.
SMP motherboard not detected.
Local APIC not detected. Using dummy APIC emulation.
Brought up 1 CPUs
CPU0 attaching sched-domain:
domain 0: span 1
groups: 1
domain 1: span 1
groups: 1
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xf10c0, last bus=1
PCI: Using configuration type 1
mtrr: v2.0 (20020519)
ACPI: Subsystem revision 20050228
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 *9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 *9 10 11 12 14 15)
ACPI: PCI Root Bridge [PCI0] (00:00)
PCI: Probing PCI hardware (bus 00)
PCI: Via IRQ fixup
ACPI: PCI Interrupt Routing Table [_SB_.PCI0._PRT]
ACPI: PCI Interrupt Routing Table [_SB_.PCI0.PCI1._PRT]
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
pnp: PnP ACPI: found 12 devices
PnPBIOS: Disabled by ACPI PNP
SCSI subsystem initialized
PCI: Using ACPI for IRQ routing
** PCI interrupts are no longer routed automatically. If this
** causes a device to stop working, it is probably because the
** driver failed to call pci_enable_device(). As a temporary
** workaround, the "pci=routeirq" argument restores the old
** behavior. If this argument makes the device work again,
** please email the output of "lspci" to [email protected]
** so I can fix the driver.
pnp: 00:02: ioport range 0xe400-0xe47f could not be reserved
pnp: 00:02: ioport range 0xe800-0xe80f has been reserved
pnp: 00:02: ioport range 0xe200-0xe27f has been reserved
Simple Boot Flag at 0x3a set to 0x1
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16ac)
apm: overridden by ACPI.
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
devfs: 2004-01-31 Richard Gooch ([email protected])
devfs: boot_options: 0x1
Installing knfsd (copyright (C) 1996 [email protected]).
SGI XFS with ACLs, security attributes, no debug enabled
SGI XFS Quota Management subsystem
Initializing Cryptographic API
Applying VIA southbridge workaround.
PCI: Disabling Via external APIC routing
vesafb: framebuffer at 0xf0000000, mapped to 0xde880000, using 1536k, total 32768k
vesafb: mode is 1024x768x8, linelength=1024, pages=41
vesafb: protected mode interface info at c000:7f88
vesafb: scrolling: redraw
vesafb: Pseudocolor: size=8:8:8:8, shift=0:0:0:0
Console: switching to colour frame buffer device 128x48
fb0: VESA VGA frame buffer device
ACPI: Power Button (FF) [PWRF]
ACPI: CPU0 (power states: C1[C1] C2[C2])
ACPI: Processor [CPU0] (supports 16 throttling states)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Linux agpgart interface v0.100 (c) Dave Jones
agpgart: Detected VIA Twister-K/KT133x/KM133 chipset
agpgart: Maximum main memory to use for agp memory: 409M
agpgart: AGP aperture is 64M @ 0xf8000000
[drm] Initialized drm 1.0.0 20040925
intelfb: Framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G chipsets
intelfb: Version 0.9.2
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
spurious 8259A interrupt: IRQ7.
VP_IDE: IDE controller at PCI slot 0000:00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci0000:00:07.1
ide0: BM-DMA at 0xd800-0xd807, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:pio
Probing IDE interface ide0...
hda: Maxtor 6Y080L0, ATA DISK drive
hdb: HL-DT-ST GCE-8481B, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: HL-DT-STDVD-ROM GDR8163B, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
Probing IDE interface ide2...
Probing IDE interface ide3...
Probing IDE interface ide4...
Probing IDE interface ide5...
hda: max request size: 128KiB
hda: 160086528 sectors (81964 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(33)
hda: cache flushes supported
/dev/ide/host0/bus0/target0/lun0: p1 p2 p3 p4 < p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 >
hdb: ATAPI 40X CD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
hdc: ATAPI 52X DVD-ROM drive, 256kB Cache, UDMA(33)
libata version 1.10 loaded.
mice: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard on isa0060/serio0
psmouse.c: Failed to reset mouse on isa0060/serio1
input: PS/2 Generic Mouse on isa0060/serio1
psmouse.c: Failed to enable mouse on isa0060/serio1
md: linear personality registered as nr 1
md: raid0 personality registered as nr 2
md: raid1 personality registered as nr 3
md: raid10 personality registered as nr 9
md: raid5 personality registered as nr 4
raid5: measuring checksumming speed
8regs : 1080.000 MB/sec
8regs_prefetch: 1020.000 MB/sec
32regs : 812.000 MB/sec
32regs_prefetch: 764.000 MB/sec
pII_mmx : 2168.000 MB/sec
p5_mmx : 2904.000 MB/sec
raid5: using function: p5_mmx (2904.000 MB/sec)
raid6: int32x1 332 MB/s
raid6: int32x2 410 MB/s
raid6: int32x4 265 MB/s
raid6: int32x8 253 MB/s
raid6: mmxx1 675 MB/s
raid6: mmxx2 1136 MB/s
raid6: sse1x1 644 MB/s
raid6: sse1x2 1058 MB/s
raid6: using algorithm sse1x2 (1058 MB/s)
md: raid6 personality registered as nr 8
md: multipath personality registered as nr 7
md: md driver 0.90.1 MAX_MD_DEVS=256, MD_SB_DISKS=27
device-mapper: 4.4.0-ioctl (2005-01-12) initialised: [email protected]
NET: Registered protocol family 2
IP: routing cache hash table of 2048 buckets, 32Kbytes
TCP established hash table entries: 16384 (order: 6, 262144 bytes)
TCP bind hash table entries: 16384 (order: 5, 196608 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
NET: Registered protocol family 1
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
ACPI wakeup devices:
PCI0 PCI1 UAR1 UAR2 USB0 USB1
ACPI: (supports S0 S1 S4 S5)
devfs_mk_dev: could not append to parent for md/0
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
ReiserFS: hda5: found reiserfs format "3.6" with standard journal
ReiserFS: hda5: using ordered data mode
ReiserFS: hda5: journal params: device hda5, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda5: checking transaction log (hda5)
ReiserFS: hda5: Using r5 hash to sort names
VFS: Mounted root (reiserfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 288k freed
Adding 96380k swap on /dev/discs/disc0/part3. Priority:-1 extents:1
Adding 96348k swap on /dev/discs/disc0/part10. Priority:-2 extents:1
kjournald starting. Commit interval 5 seconds
EXT3 FS on hda2, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
ReiserFS: hda6: found reiserfs format "3.6" with standard journal
ReiserFS: hda6: using ordered data mode
ReiserFS: hda6: journal params: device hda6, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda6: checking transaction log (hda6)
ReiserFS: hda6: Using r5 hash to sort names
ReiserFS: hda7: found reiserfs format "3.6" with standard journal
ReiserFS: hda7: using ordered data mode
ReiserFS: hda7: journal params: device hda7, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda7: checking transaction log (hda7)
ReiserFS: hda7: Using r5 hash to sort names
ReiserFS: hda8: found reiserfs format "3.6" with standard journal
ReiserFS: hda8: using ordered data mode
ReiserFS: hda8: journal params: device hda8, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda8: checking transaction log (hda8)
ReiserFS: hda8: Using r5 hash to sort names
ReiserFS: hda9: found reiserfs format "3.6" with standard journal
ReiserFS: hda9: using ordered data mode
ReiserFS: hda9: journal params: device hda9, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda9: checking transaction log (hda9)
ReiserFS: hda9: Using r5 hash to sort names
Real Time Clock Driver v1.12
8139too Fast Ethernet driver 0.9.27
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI interrupt 0000:00:0e.0[A] -> GSI 10 (level, low) -> IRQ 10
eth0: RealTek RTL8139 at 0xded90000, 00:50:fc:cd:88:dd, IRQ 10
eth0: Identified 8139 chip type 'RTL-8100B/8139D'
Forcing 10Mbps half-duplex operation.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 9
PCI: setting IRQ 9 as level-triggered
ACPI: PCI interrupt 0000:00:07.5[C] -> GSI 9 (level, low) -> IRQ 9
PCI: Setting latency timer of device 0000:00:07.5 to 64
usbcore: registered new driver usbfs
usbcore: registered new driver hub
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
USB Universal Host Controller Interface driver v2.2
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 9
ACPI: PCI interrupt 0000:00:07.2[D] -> GSI 9 (level, low) -> IRQ 9
uhci_hcd 0000:00:07.2: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
uhci_hcd 0000:00:07.2: irq 9, io base 0xd400
uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ACPI: PCI interrupt 0000:00:07.3[D] -> GSI 9 (level, low) -> IRQ 9
uhci_hcd 0000:00:07.3: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#2)
uhci_hcd 0000:00:07.3: irq 9, io base 0xd000
uhci_hcd 0000:00:07.3: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usb 1-2: new low speed USB device using uhci_hcd and address 2
usbcore: registered new driver hiddev
usb 2-2: new full speed USB device using uhci_hcd and address 2
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
input: USB HID v1.10 Mouse [Logitech USB Mouse] on usb-0000:00:07.2-2
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
Disabled Privacy Extensions on device c05d68a0(lo)
Vendor: USB MASS Model: STORAGE DEVICE Rev: 0.10
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
usb-storage: device scan complete
eth0: no IPv6 routers presentThe PC was indeed turned off between the two checks.
However the first check was not performed right before the shutdown, but few hours before it.
:idea:
(...) varying from browser cache data increase to a cronjob like updatedb, or even you installing or downloading something.
When I've read these words I have started to "scroll" back in my memory buffer and eventually I've remembered that the only thing I did as superuser was to download some Firefox extensions which (surprise or not...) summed up to ~12M.
So we have the answer for this one too thanks to your hints
PS: That's exactly the reason why I've made a small / partition - to keep a close eye on it's usage and to ring some allarms when needed.
Again, thank you. -
Extensive (very very very extensive) memory usage of host application with CS extension
Hi!
I tried this only under Photoshop CS5 and InDesign CS5 under Windows 7.
When you open and close CS extension panel, the memory taken by Photoshop (InDesign) increases by 6-30MB!
In case of the simple HelloPhotoshop (HelloInDesign) panel from the examples, compiled in release mode, when you open it and close, - it's about 6-10MB each time you do it. And in case of a more complex panel, which uses AIR, etc. it's about 30MB per one panel close/open.
When I use some panels in 5-10 minutes Photoshop (InDesign) increases its memory pool from 600MB up to 1,2 GB. And more. And this memory is never freed, only until Photoshop (InDesign) shutdown.
I tried freeing all my arrays, killing display objects, etc. - nothing helped. Even a simple HelloPhotoshop (HelloInDesign) that does nothing eats memory.
By the way, InDesign eats memory a lot faster .James, thank you for the very fast answer! I did various tests on the weekend on my computer and computer of my friend.
And I can say, that Debug flag doesn't affect memory consumption. They still eat memory. My steps to reproduce are as follows:
(Windows 7 32 bit)
Photoshop CS5:
1) set HKEY_CURRENT_USER\Software\Adobe\CSXS2Preferences\PlayerDebugMode to 0
2*) check HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\CSXS2Preferences (just in case)
3) Compile HelloPhotoshop example to ZXP and install via Extension manager
4) restart computer
5) Run Photoshop CS5 - Memory consumption: 100 096 KB
6) Open HelloPhotoshop and close it 10 times
7) Memory consumption: 155 840 - 5,574 MB per one close/open
Maybe a garbage collector is expected to run and free this memory, but it never happened in my case. The memory pool was increasing to 1 GB when I was working with one of my panels - with no documents open in Photoshop
In InDesign I tried the same thing with HelloInDesign ( I had to close the panel completely and then open with Window | Extensions | HelloInDesign)
Memory consumption on start: 118 516
Memory consumption after 10 open/close cycles: 197 516
It's 7,9 MB per one close/open
It's the simpliest panel test. When I'm using AIR libraries the memory usage is increasing a lot faster. -
Problem with memory usage and CPU usage
Hello,
i have a problem with the memory usage and cpu usage in my project!
My application must run for more than 24 hrs. The problem is that the longer it runs the bigger is the memory and cpu usage!
It starts with ~15% CPU usage and ~70 MBytes memory usage. After ~ 24hrs the CPU usage is ~60% and the memory usage is ~170 MBytes!
After 3 days the CPU usage is almost about 70% and the memory usage is about 360 MBytes!
What can I do to reduce this huge recource usage?
Thank you!Hi Pahe,
I think the issue is memory usage, since CPU usage can increase due to greater memory requirements.
Anyway, it's difficult to debug without seeing your code, can you post it (possibly for LV 7.1 compatibility)? Or just post a JPEG of the piece of code that can give problems...
I guess you're appending data to an array instead of replace data elements, but I can't be sure...
Have a nice day!
graziano
Maybe you are looking for
-
GR/IR Clearing account query
Hi SAP Gurus, We have business scenarios where GR/IR account gets debited and credited with different amounts. We want to clear even those cases using program SAPF124 by maintaing the required tolerances. Also in SPRO we can maintain the GL to which
-
Marking videos as watched in iOS 8
After upgrading to iOS 8 a bunch of my videos 'in the cloud' marked themselves as unwatched. I don't want to download 10GB+ of videos just to skip to the end and have them marked as watched. Is there any way to mark them as watched?
-
My Sony TRV 990E connects fine to iMac, Powerbook - but there is no way to make it work with the new G5 Quad (7800GT) Tried everything - all tricks. iSight works fine... Does anybody know of issues???
-
Functional specification documents..
HI guys, I am new to SAP HCM.. i was wonderingg as to when is the need to write a Function spec document? It would be great if you could give an example.. Also, what is the difference between Functioal Spec doc and functioal design document?? Thanks
-
IPhoto no good in Leopard anymore
I've got iPhoto v.2 that came w/ my computer four years ago. Just updated to Leopard and SURPRISE! Leopard doesn't support iPhoto 2. No disclaimers before I bought the software of course. Is there anyway to continue saving and editing my photos w/Leo