Unable to see whole output list on screen in C++ (Not even using scroll) - c++

Ok, I just added a new feature to my student manager program (a console program written in c++) , it is a console application and my program print dates on which particular student is absent in a list format
by saying list format i mean 1 date on 1 line
this is how output looks like for student who is absent 5 times
1. 04/05/2016,Monday
2. 05/05/2016/Tuesday
3. 06/05/2016/Wednesday
(Assume dates are correct)
now since these are only 3 records that are printed on the screen, a user would not require scrolling down,
but in a case of 300 dates , it prints all dates but when i scroll up I'm not able to reach back to 1st date, for example, I'm only able to see last 147 Records only
and I'm not able to scroll my console window to 1st record.
I know many other ways to solve this problem (like displaying 10 records or 100 records at a time) but I want to know how can i solve this particular problem
please give answer considering me as a beginner. :)
Thank You.
(as far as code is concerned, i can assure you its nothing special, just a while loop that keeps on printing dates until certain terminating condition is met )

Related

iMacros formatting random numbers as currency, does not affect the same field each time

This has me stumped. Running a basic data input macro taking data from a CSV file. I have tried formatting the numbers as both general and numbers in excel. It seems to affect random fields - for example, on one run it will affect boxes 1, 3, and 7, and on run 2 it will affect boxes 2, 5, and 8.
For example, this is a line of code:
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:Zip CONTENT={{!COL1}}
In half of the boxes, the entry will be formatted as 58123, and the other half $58,123.00.
I believe this may be a bug related to the implementation of the firefox plugin I am using, as I just ran the code on the same form twice in a row. Same data, same page, no reloads or anything. It had the same issue both times, however the boxes it affected were different. Boxes that were formatted correctly the first time were formatted incorrectly the second, and vice versa. It may also be caused by the plugin being thrown off by boxes that format numbers as currency automatically, as the macro will just "paste" the value in the box without triggering the formatting script, so I would get results like this:
cost: 150
cost: $150
cost: 150
when all of them should read $150 and there is a JS currency formatting function applied to the box. The end result being that numbers that should be formatted as currency are not, and numbers that should not be formatted as currency are.
#chivracq
I slowed timing down to one event every 2s and it did not improve the issue. I am using iMacros 8.9.7 on firefox 47. Windows 10. iMacros FF v10 breaks support for several commands that I need, and Chrome has it's own particular issues with the sites I have to use. Unfortunately finance tends to be picky - surprised we got off of IE6, really. The first version of iMacros I purchased was v8 if I remember correctly, and most of the basic ideas/code were written back then and updated as needed. With iMacros being discontinued now I don't see a point in fixing the issues newer versions have - if I can't get this working I suppose I will have to learn a different automation framework.
My apologies for missing the wiki.
A snippet from my CSV would look like this:
12345678,1407 W Random St,Arlington,22205,800000,800000,10/10/2022,10/20/2022
I could snag some of their code from element inspector perhaps?

What is the moment when the sales order is fully formed with its lines and the entire posting process is finished?

I would like to know where in Dynamics ax 2009 a sales order (SALESTABL) is fully formed with all its lines (SALESLINE). I need to run a code snippet right after the order (and its lines) has been created. What I want to learn is actually like "after insert" in SQL. The piece of code I want to run will look at all the lines of the order in order and do an action.
That's sort of impossible, because a SO can be reopened or if you have an open SO and your user has added 1 line...well who knows if the user is done adding lines? How do you know when it's "complete"? You could go off of the point of confirmation, but not everyone does confirmations. You need to determine some "point" in business that you consider "complete" and then go from there. You could trigger an event after each SO line is created if your code is written to be idempotent?

Google Sheets, multi-tab, multi-criteria if statements

I'm building a staff allocation sheet for our production teams so that management can see (graphically) the peaks and troughs for each department. I've anonymised the data and shared it here: https://docs.google.com/spreadsheets/d/140w_v_ApksXH2q7h_dK5Iglm0VOTF1Zk9fq9jPxF5BM/edit?usp=sharing
What I am attempting to achieve is to have the week commencing dates across the top, the employees down the left (Based on a unique list of employees form the department tabs) and the individual cells populated with the relevant show number (I've manually entered the first two employees).
I had done this successfully by having hidden proxy columns for each show that pull a start and end date from the department sheet via and indirect lookup. Where this falls down is if an employee works on a production at two separate times, e.g. all of May and all of August but not between those months.
I initially attempted a series of nested ifs:
=if(and(indirect($A3&"!$B:$B")=$B:$B,
indirect($A3&"!$E:$E")<=AK$2,
indirect($A3&"!$F:$F")>AK$2,
indirect($A3&"!$C:$C")="SHOW #1"
),1,
if(and(indirect($A3&"!$B:$B")=$B:$B,
indirect($A3&"!$E:$E")<=AK$2,
indirect($A3&"!$F:$F")>AK$2,
indirect($A3&"!$C:$C")="SHOW #2"
),2,
if(and(indirect($A3&"!$B:$B")=$B:$B,
indirect($A3&"!$E:$E")<=AK$2,
indirect($A3&"!$F:$F")>AK$2,
indirect($A3&"!$C:$C")="SHOW #3"
),3,
. . .
if(and(indirect($A3&"!$B:$B")=$B:$B,
indirect($A3&"!$E:$E")<=AK$2,
indirect($A3&"!$F:$F")>AK$2,
indirect($A3&"!$C:$C")="SHOW #17"
),17,
0)))))))))))))))))
Hoping that this would calculate in each cell and return the correct result, however this did not work, that's when I discovered if() doesn't work with ranges in this context! I've effectively hit a wall on this.
I feel like I'm missing something obvious in this and would appreciate any help!!!

yahoo pipes trimming all item titles

After a lot of hard work, I have created two yahoo Pipes I will be using.
One of them has a minor problem however... I am trimming the title length down to leave enough room for a ... and a link to fit within a tweet.
It trims the first post correctly... however it trims all of the posts after that to 0 length (before adding a bit of extra text to the end).
The problem is I'm not using a loop for all items after a certain point, but the reason for that is the output is always items from a loop, and I need the output to be number at a certain point so that I can feed in that number asa variable to trim the length by. The pipe can be found here: http://pipes.yahoo.com/pipes/pipe.info?_id=3e6c3c6b2d23d8ce0cf66cb3efc5fb56
Typically, I am inserting any RSS feed in the top box, something like "new blog post:" in the middle and "#bussiness #hashtags" in the last box.
If you can see any way I can have this yahoo pipe work for all posts rather than just the top one, please let me know. its not a big deal as im only ever posting for the moment, the top post to twitter... however there may come a point where I need all of them looking the same.

How to iterate over all the page breaks in an Excel 2003 worksheet via COM

I've been trying to retrieve the locations of all the page breaks on a given Excel 2003 worksheet over COM. Here's an example of the kind of thing I'm trying to do:
Excel::HPageBreaksPtr pHPageBreaks = pSheet->GetHPageBreaks();
long count = pHPageBreaks->Count;
for (long i=0; i < count; ++i)
{
Excel::HPageBreakPtr pHPageBreak = pHPageBreaks->GetItem(i+1);
Excel::RangePtr pLocation = pHPageBreak->GetLocation();
printf("Page break at row %d\n", pLocation->Row);
pLocation.Release();
pHPageBreak.Release();
}
pHPageBreaks.Release();
I expect this to print out the row numbers of each of the horizontal page breaks in pSheet. The problem I'm having is that although count correctly indicates the number of page breaks in the worksheet, I can only ever seem to retrieve the first one. On the second run through the loop, calling pHPageBreaks->GetItem(i) throws an exception, with error number 0x8002000b, "invalid index".
Attempting to use pHPageBreaks->Get_NewEnum() to get an enumerator to iterate over the collection also fails with the same error, immediately on the call to Get_NewEnum().
I've looked around for a solution, and the closest thing I've found so far is http://support.microsoft.com/kb/210663/en-us. I have tried activating various cells beyond the page breaks, including the cells just beyond the range to be printed, as well as the lower-right cell (IV65536), but it didn't help.
If somebody can tell me how to get Excel to return the locations of all of the page breaks in a sheet, that would be awesome!
Thank you.
#Joel: Yes, I have tried displaying the user interface, and then setting ScreenUpdating to true - it produced the same results. Also, I have since tried combinations of setting pSheet->PrintArea to the entire worksheet and/or calling pSheet->ResetAllPageBreaks() before my call to get the HPageBreaks collection, which didn't help either.
#Joel: I've used pSheet->UsedRange to determine the row to scroll past, and Excel does scroll past all the horizontal breaks, but I'm still having the same issue when I try to access the second one. Unfortunately, switching to Excel 2007 did not help either.
Experimenting with Excel 2007 from Visual Basic, I discovered that the page break isn't known unless it has been displayed on the screen at least once.
The best workaround I could find was to page down, from the top of the sheet to the last row containing data. Then you can enumerate all the page breaks.
Here's the VBA code... let me know if you have any problem converting this to COM:
Range("A1").Select
numRows = Range("A1").End(xlDown).Row
While ActiveWindow.ScrollRow < numRows
ActiveWindow.LargeScroll Down:=1
Wend
For Each x In ActiveSheet.HPageBreaks
Debug.Print x.Location.Row
Next
This code made one simplifying assumption:
I used the .End(xlDown) method to figure out how far the data goes... this assumes that you have continuous data from A1 down to the bottom of the sheet. If you don't, you need to use some other method to figure out how far to keep scrolling.
Did you set ScreenUpdating to True, as mentioned in the KB article?
You may want to actually toggle it to True to force a screen repaint. It sounds like the calculation of page breaks is a side-effect of actually rendering the page, rather than something Excel does on demand, so you have to trigger a page rendering on the screen.