Reporting. So simple with VBA

reporting I have to prepare a daily, weekly, monthly, quarterly report… This is what managers do. Why? Why writing reports is more important than leading people or solving problems or proposing ideas?

Reports are important but in most cases reporting can be automated. We have to stop for a while and start working smart.

  • Can we talk about my idea?
  • Unfortunately I have to prepare a report. I have no time.
  • What report?
  • I have to prepare a financial statements. Download time logs from our experts, copy and paste them from hundreds of e-mails. Horrible…
  • Why don’t you use your brain and computer for doing all these things?

Let’s look at an example of an application that downloads attachments and move e-mails from Inbox to a separate folder. Here I will describe a procedure that may be used to download attachments from our e-mails.

Continue reading

Programming in the office. Why?

hard_job_payWhy programming might be important for people working in the office? We can work efficiently, better… we surely hear this propaganda. In practice… how to start when we haven’t got a break to learn during the day? One may say: learn at home in your free time! Easy…

Do we like our job to be engaged in a such a way? What we will do after we’ll improve our skills? Do we have other tasks or responsibilities? Do we believe that we will be appreciated by our company? Many questions and doubts…

However, we may look at these questions in a different way. Let’s imagine…. we are working with the spreadsheets. We have to prepare a financial statement to our customers. Many financial statements… Collecting the data¬† from number of databases, computing a financial balance…. and merging cells, coloring rows in a spreadsheet manually… Then we wake up with a well designed tool that is able to do all these things automatically ;)

Will you like your job more armed with this tool? How many your ideas were rejected due to the lack of time? How many time will be saved thanks to your engagement and programming skills?

Dream is only a dream but spreadsheet that colors rows and merges cells might be quite real ;) Click! Good point to start is googling for “how automatically …. in spreadsheet”. Your turn to learn programming :)

Learning programming? Let’s build a robot.

Learning programming might be very time consuming. It requires patience and systematic work. Numbers, numbers and command line… or toys and robots ;)


My robot: raspberry pi, motor driver, toy and batteries

How to build a robot and have a fun with programming? What about using a tiny, low cost computer that may be connected with a toy car and a motor?

The Raspberry Pi fits to these requirements perfectly. Even a child can play with a hardware!

Raspberry PI might be used in many different applications. Sky and imagination is our limit. Motion detectors, weather stations, minecraft server, router, private network and many others…

To build a robot you need to follow the link. Have a fun!

C++ Algorithm Library

I would like to present you a C++ library that contains several popular numeric, text-processing, graph algorithms. I encourage you to download and use it. I will be grateful for any comment about the implemented solutions. I will continue the implementation of this library in the future, so I encourage you to follow the changes.

C++ Algorithm Library contains

  • basic and extended euclidean algorithm
  • basic and strong prefix-suffix array computation algorithm
  • max suffix computation algorithm
  • morris-pratt pattern matching algorithm
  • knuth-morris-pratt pattern matching algorithm
  • manacher’s algorithm for finding palindromes
  • union-find class
  • graph class – neighbor list and matrix representation
  • kruskal minimum spanning tree algorithm

Each algorithm was tested in separate unit-test. Unit tests are appended to repository.

OFDM modulator. Parallel processing.

Parallel processing is a non-trivial method to speed up our applications. Our computers have often two or more cores today. It is also possible to use some coprocessors like GPU or FPGA. All of this staff allows to run complex systems in the real-time.

In this post I will show you how to simply implement parallel processing in the OFDM modulator. Let’s take a look at the listings below.

void Cworking_Application_Layer::cworking_process_OFDM_modulation( Cworking_Matrix_Data& cworking_input, Cworking_Matrix_Data& cworking_output )
  /* For each symbol */
  #pragma omp parallel for
  for ( size_t cworking_symbol = 0; cworking_symbol < cworking_input.cworking_symbols; cworking_symbol++ )
    /* Create temporary symbol vector */
    Cworking_Complex_Vector cworking_symbol_output;

    /* ------------------------ OFDM Modulation ------------------------ */

    /* Calculate IFFT */
    this->cworking_dsp.muged_1D_ifft( cworking_input.cworking_radio_frame[ cworking_symbol ], cworking_symbol_output );

    /* ------------------------ OFDM Modulation ------------------------ */

    /* Store output into matrix */
    for ( size_t cworking_subcarrier = 0; cworking_subcarrier < cworking_symbol_output.length; cworking_subcarrier++ )
      /* Store single sub-carrier */
      cworking_output.cworking_radio_frame[ cworking_symbol ].array[ cworking_subcarrier ] =
      cworking_symbol_output.array[ cworking_subcarrier ];

    /* Clean memory */
    delete [] cworking_symbol_output.array;

Continue reading

Multi-layered architecture. OFDM modulator.

In previous article I briefly describe multi-layered architecture design pattern. In this post I want to show you some code which implement multi-layered architecture.

/* Main program */
int main()
	/* Declare layers */

	/* Infrastructure layer */
	Cworking_Infrastructure_Layer cworking_infrastructure;

	/* Application layer */
	Cworking_Application_Layer cworking_application;

	/* Presentation layer */
	Cworking_Presentation_Layer cworking_presentation;

	/* Declare input data */
	Cworking_Matrix_Data cworking_input_data;

	/* Declare modulated data */
	Cworking_Matrix_Data cworking_modulated_data;

	/* Declare output data */
	Cworking_Matrix_Data cworking_output_data;

	/* Initialize input and output data */
	cworking_infrastructure.cworking_allocate_matrix( cworking_input_data  );
	cworking_infrastructure.cworking_allocate_matrix( cworking_modulated_data );
	cworking_infrastructure.cworking_allocate_matrix( cworking_output_data );

	/* Load and parse input file */
	cworking_infrastructure.cworking_create_random_data( cworking_input_data );

	/* Plot chart */
	printf("\n-----------------------Input frame-----------------------\n\n");
	cworking_presentation.cworking_show_data( cworking_input_data );

	/* Run application */
	cworking_application.cworking_process_OFDM_modulation( cworking_input_data, cworking_modulated_data );

	printf("\n-----------------------Modulated frame-----------------------\n\n");
	cworking_presentation.cworking_show_data( cworking_modulated_data );

	/* Run application */
	cworking_application.cworking_process_OFDM_demodulation( cworking_modulated_data, cworking_output_data );

	printf("\n-----------------------Demodulated frame-----------------------\n\n");
	cworking_presentation.cworking_show_data( cworking_output_data );

	/* Clean memory */
	cworking_infrastructure.cworking_delete_matrix( cworking_input_data  );
	cworking_infrastructure.cworking_delete_matrix( cworking_modulated_data );
	cworking_infrastructure.cworking_delete_matrix( cworking_output_data );

	return 0;

In this listing we could distinguish infrastructure, application and presentation layers.

Infrastructure layer is responsible for data delivery. In this case it creates random radio frame with QPSK symbols. Furthermore infrastructure layer allocates and cleans memory.

Application layer is responsible for OFDM modulation and demodulation processes. OFDM modulator it is nothing other than the IFFT algorithm. Similarly OFDM demodulator it is exactly the FFT algorithm. Fast Fourier Transformation and its inverse version are implemented in separate digital signal processing library available on my GIT Hub profile [click].

Presentation layer prints the input, modulated and demodulated frames. Demodulated frame should be exactly the same as the input frame. Full code of this example is available also on my GIT Hub profile [click]. I encourage you to download the code. It will be still developed and I hope that in an interesting way.