Thursday, January 17, 2019

PHP Code to have different number of rows in first page of PDF file generated by FPDF Library

A few years back, I had published this post to explain about resolving the Wrap text issue in FPDF table cell. At the end of the post, I had specified a sample code for adding new page using addPage() on every n-th row using modulo operator.
It was working fine without any issue. But this approach won't be useful if we need different number of rows in first page of PDF than other pages. For example, in our timesheet application, the PDF report will be having some summary information at the first page of file. So, obviously the first page can hold less number of rows comparing to other pages. So, just using Modulo operator won't help in this situation. Either we need to start writing the rows from the second page, or if we want to start from first page, we have unnecessarily waste some space in all other pages.

I thought of updating the code to handle this scenario. Initially I thought it can be done very easily. After making some attempts, I realized the complexity of this scenario. I tried various approaches. But every approach is failing with any one of various test scenarios. We can imagine a lot of test scenarios.
For example,
1. Total number of rows is 0
2. Total number of rows is 1.
3. Total number of rows is less than the desired First page row count.
4. Total number of rows is exactly equal to the addition of desired first page row count and desired other pages row count or multiples of it.
5. "Greater than" instead of "Equal to" in the 4th scenario.
6. "Less than" instead of "Equal to" in the 4th scenario.

Finally I came up with below code. Based on my testing, it is working fine in all test scenarios, except when the first page row count is greater than the row count of other pages. Practically this scenario won't happen. So, I can say that it is working fine in all practical situations. Please let me know if you find any issue with this code.

$otherpagesrowcount=20; //should be greater than first page count
foreach ((array)$data as $row)

if($j==$firstpagerowcount || $m==$otherpagesrowcount || $j==count($data))

if ($j>$firstpagerowcount)

$m=0; //start fresh



Read more ...

Saturday, January 12, 2019

The Danger of using Ad Blockers. Let us Stop using Ad Blockers to keep Free Internet.

The Internet is filled with a lot of useful information in various formats including Text, Audio, Video, Slideshows, eBooks and Mobile Apps. Most of these Contents are available Free for anyone to access them at any time from anywhere.

Apart from this Free Content, a lot of useful Tools are also available for Free on the Internet.

We refer Internet for learning any Technology or to know about any places or to communicate with others, even many people are getting their Jobs with the help of the Internet.

Online News Providers are giving news with deep analysis and quickly than traditional News Providers. All these things are possible because of the Hard work of a lot of Developers and Bloggers who are getting compensated from online Advertisements for their Work. This Ad-based Free Internet Model is giving benefits to everyone.

For Example, this blog is showing Google Adsense ads which will automatically show advertisements based on the content you read. So, obviously the ads will be relevant to you, and Google will mark the Advertisements with labels like "Ads by Google" so that you can easily separate it from the actual content. In summary, you as a Reader will be getting free content without any major inconvenience. And, I will be paid by Google for showing the Ads. And, the Advertisers will be getting relevant potential customers to their website by spending the Money effectively, and Google will get the commission for developing and running the ad delivery system.
Read more ...

Tuesday, January 1, 2019

Published Free Android App "Christian Calendar 2019"

A few weeks back, I have posted about our web application for generating Motivational Calendar with our own events.
For promoting this web application, I published an Android app "Motivational Quotes Calendar 2019" which is created with the help of our Calendar Generator.
Since our Bible Quotes Android App is downloaded by a significant number of People, I thought promoting any App related to Bible can be easily promoted with the help of Admob's free in-house ads.

At first, prepared the initial list of Christian Events for the Year 2019 by referring to various websites. And, improved the list by getting suggestions/feedback by sharing the initial list with relevant social media groups.

Read more ...

Saturday, December 29, 2018

How to Choose a Custom iPhone App Development Company

The world is constantly evolving at a breakneck pace when it comes to technology. We’re all constantly connected. In fact, over 94% of Americans now own a smartphone of some kind, and 44% of those people select an iPhone as their device of choice. 

These days, you can find everything from the weather, to dinner reservations, to diet specifications through an app on an iPhone. The general public may not give a second thought as to who the best iPhone development company is, but for those of us working in the technology realm, it’s of top importance.

Apple, in particular, is ahead of much of their competition in the smartphone market. Apple’s iOS streamlines many of its most important features, leading to a smooth and easy user experience and appeal to the masses.

So, you’ve got a brilliant idea for a cutting-edge app that will change the way people spend all of their days. Ok, so maybe you aren’t this ambitious, but regardless, you’ll need custom iPhone application development to turn your dreams into a reality. But how should you go about choosing the best iPhone app development services for you?

Choosing the wrong app development company can turn even the most groundbreaking idea into a technological dumpster fire. Luckily for you, we’ve been there before, so we compiled this tell-all list to help you decide which iPhone application development services are worth your time, and which ones will cause you to spin your wheels like a never-ending game of Candy Crush.

Read more ...

Friday, December 28, 2018

Relation of Heat and Computer Speed

A few days back, my Computer was not starting properly. The power supply switch indicator was glowing, and I could hear the fan sound from CPU. But there was no light indication from Mouse and Keyboard which are connected to USB ports.

Since I am using Linux Operating System "Ubuntu", I could easily come to the conclusion of some Hardware issue, without the need to suspect an OS issue.

So, I opened the CPU box and I have noticed that the heatsink fan was not rotating properly, it was creating noise sometimes by slightly hitting on the heat sink.

The Computer started properly without any issue after replacing the Heat Sink.

It made me think about the relation between the Heat Sink and Computer operation. Since the computer was not starting without proper Heat Sink, I could understand that the Computer is sensing the operation of Heat Sink. After reading many forum posts, I came to know that modern Computers adjust their operation based on the Heat to save the processor from burning event.  That means if your computer is getting heated, it will automatically reduce its operating speed to reduce the heat generation from the high-speed operation of the processor.

From this incident, I learnd that to increase our Computer speed, we need to provide proper Heat Sink and other heat reduing systems.

Read more ...

Follow By Email