Skip to main content

Posts

VBA MAcro to generate "table of contents with hyperlinks" automatically in a ppt

VBA MAcro to generate "table of contents with hyperlinks" automatically in a ppt: Function TableOfContent(count As Integer) 'count is the no. of slides in ppt Dim var As Integer Dim i As Integer, scount As Integer Dim strSel As String, strTitle As String, strb As String, strtemp As String, str As String Dim arr() As String Dim index As Integer, indexcount As Integer, slidecount As Integer Dim summary As Slide Dim para As Integer Dim slideOrder() As Integer 'To generate the Table of contents slide ReDim slideOrder(count - 2) 'Collect all the IDs of the selected slides For i = 1 To count - 2 slideOrder(i) = i + 2 Next 'Iterate over the slides in Index order slidecount = UBound(slideOrder) For scount = 1 To slidecount If ActivePresentation.Slides(slideOrder(scount)).Shapes.HasTitle Then 'Build up the ToC Text strTitle = ActivePresentation.Slides(slideOrder(scount)).Shapes("UseCase").TextFrame.TextRange.Text + ": ...

error in eclipse on import org.eclipse.jetty.server.Server;

When you find error in line import org.eclipse.jetty.server.Server; it means eclipse doesn't contain jetty.jar. Right click on project -> properties on left pane -> java build path right pane -> add external jar under libraries tab link it to all the jar files of jetty folder. can download jetty from : http://www.eclipse.org/jetty/downloads.php now rebuild the project.

To halt background using Jdialog

To make background screen or main canvas inactive or non-clickable, add the property of modality to dialog box. Set the feature using jdialog.setmodal(true). Now, the screen will halt at the point when this line is encountered. So, will ask for input from user. Exploiting the feature of madal dialog box, previous screen can be hold on.

No output in codeblocks

If you are able to build your cpp/c file but not able to run using codeblocks, then your system lacks the presence of MinGW. Download MinGW from sourceforge.net and after a restart you'll be able to run your c/cpp program.

Singleton Class

Using Singleton class, we allow creation of asingle object only for a given class. How to create it?? - Make constructor private - Create a reference of class and make it static - Call the constructor through a function which is public and static - put condition inside this function to call the constructor only once by checking if the reference had been initialized or not. Note: If we have two threads accessing the same code then it's possible that we get two objects in two different threads which are competing to get that object. So we can synchronize the code snippet inside the function for assuring the creation of a single object only.

Memory Leak

Memory Pools are just a section of memory reserved for allocating temporarily to other parts of the application. So, memory leak occurs when you allocate some memory from the heap(or a pool) and then delete all references to that memory without returning it to the pool it was allocated from. Basically, we are left with less memory to allocate because we have not freed the memory and keep on allocating it.

Structure padding

Structure Padding Most processors require specific memory alignment on variables certain types. Normally the minimum alignment is the size of the basic type in question, fo instance this is common char variables can be byte aligned and appear at any byte boundary short (2 byte) variables must be 2 byte aligned, they can appear at any even byte boundary. This means that 0x10004567 is not a valid location for a short variable but 0x10004566 is. long (4 byte) variables must be 4 byte aligned, they can only appear at byte boundarys that are a multiple of 4 bytes. This means that 0x10004566 is not a valid location for a long variable but 0x10004568 is. Structure padding occurs because the members of the structure must appear at the correect byte boundary, to achieve this the compiler puts in padding bytes (or bits if bit fields are in use) so that the structure members appear in the correct location. e.g. struct ex{ int i; //assuming int to take 2 bytes char c; int j; }; Here, size of struc...