Introducing AfsaneDB (Beta) – Now Available on Play Store!

Dive into the world of classic literature with AfsaneDB. Explore timeless masterpieces in an elegant and user-friendly app, designed for book lovers like you.

Showing posts with label Technical. Show all posts
Showing posts with label Technical. Show all posts

Monday, 13 January 2025

Setting Up OCR for Windows and Linux: A Comprehensive Guide

Automating repetitive tasks like extracting text from images can save valuable time (unless you don't value it, in that case it will save some invaluable time). This process, known as Optical Character Recognition (OCR), is a powerful tool for converting text in images into editable formats. Here, I’ll walk you through setting up custom OCR solutions for both Windows (that we all have) and Linux (used in office mostly) systems, complete with keyboard shortcuts for seamless integration.

Most of my OCR use in personal work is for Urdu, but professionally - it is required for English as well. Using Google lens is a fine option - exept that you hate repeating those clicks and key presses just to copy some text from image. And to be honest - I kind of feel bad even for giant corps like Google when I unnecessarily utilize their 'precious' resources.

Why not use a browser extension you ask? Well, because it's limited to browser - and we do need text from other apps as well. You can argue that one can take a screenshot of that app and then go to browser and run OCR, but if you have opened a browser and afford to take a screenshot just for that, why not run Google lens instead of an extension. You get the point.


Background

OCR technology is invaluable for tasks such as digitizing printed documents, extracting text from screenshots, or processing scanned images. By automating OCR, you can:

  • Instantly access extracted text.
  • Improve productivity.
  • Simplify your workflow.

This guide provides a step-by-step walkthrough for setting up OCR on Windows and Linux, ensuring a smooth and user-friendly experience.


Introduction

Why Automate OCR?

Manual text extraction is time-consuming and error-prone. Automating the process ensures:

  • Faster access to text data.
  • Minimal effort for repetitive tasks.
  • A consistent and reliable workflow.

How It Works

We’ll create scripts for Windows and Linux that:

  1. Capture an image or utilize an existing one.
  2. Perform OCR using Tesseract (an open-source OCR engine).
  3. Copy the extracted text directly to the clipboard.

Setup

Prerequisites

Before getting started, ensure you have the following:

  1. Tesseract OCR

    • Download and install from Tesseract’s official page.
    • Install necessary language packs (e.g., -l eng for English, -l ara+eng for Arabic and English).
  2. Clipboard Utilities

    • Windows: Use nircmd for clipboard operations.
    • Linux: Install xclip for clipboard management.
  3. Screenshot Tools

    • Windows: Use built-in snipping tools or third-party software.
    • Linux: Install flameshot for advanced screenshot functionality.

Procedure

For Windows

1. Create the OCR Script

Create a batch file named sstoocr.bat and save it in a convenient location:

@echo off
:: Save clipboard to image
start nircmd/nircmd.exe clipboard saveimage screenshot.png

:: Run Tesseract OCR on the image
tesseract screenshot.png output -l ara+eng

:: Copy extracted text to clipboard
type output.txt | clip

:: Optionally, clean up
:: del screenshot.png
:: del output.txt

2. Assign a Shortcut

  1. Place the script on your desktop.
  2. Right-click the script and select Create Shortcut.
  3. Right-click the shortcut, go to Properties, and under the Shortcut tab, assign Ctrl + Alt + O as the shortcut key.

3. Use the Script

  1. Copy an image to the clipboard or take a screenshot.
  2. Press Ctrl + Alt + O.
  3. The extracted text will automatically be copied to your clipboard.

For Linux

1. Create the OCR Script

Create a shell script named flameshot_ocr.sh:

#!/bin/bash
flameshot gui --raw | tesseract -l eng stdin stdout | xclip -selection clipboard

Make the script executable:

chmod +x flameshot_ocr.sh

2. Assign a Shortcut

  1. Open your desktop environment’s keyboard settings.
  2. Add a custom shortcut:
    • Command: /path/to/flameshot_ocr.sh
    • Shortcut: Ctrl + Shift + O

3. Use the Script

  1. Press Ctrl + Shift + O to open the Flameshot GUI.
  2. Select the area to capture.
  3. The text will be extracted and copied to your clipboard.

Conclusion

By following this guide, you can set up a streamlined OCR solution for both Windows and Linux. With a simple keyboard shortcut, you’ll have quick access to extracted text directly on your clipboard, saving time and effort.

Feel free to customize these scripts to better suit your needs. Happy automating, and may your workflows become ever more efficient!

Wednesday, 26 April 2023

Building an App Builder - Strategies, Limitations and Available Tools

As a budding app developer, creating an app builder for mobile devices is an exciting idea which I'm giving a lot of thinking since early 2019. However, there are several strategies, and limitations that need to be considered before embarking on this journey. In this blog post, I will explore these aspects in detail.

This would be a brainstorming session for me, where I'd just put all that I've found while researching this subject.

Techniques

Scratchware

Scratchware was an interesting project but is now deprecated. Its technique was unique, where the app was built on the device itself, without any internet connection. However, other app builders mostly build the app on the server. Therefore, it is not necessary that the build part should be on the server.

Scratchware was based on MIT App Inventor as per their website before the deprecation. Showing ads before each build, and giving options to arrange items (buttons, cards, inputs, labels etc.) in rows and columns were really awesome features. For logic, it used Scratch Programming blocks.

APK Editor

Another app builder that is worth mentioning is APK Editor, which uses ARSCLib. Another similar one is APK Explorer Editor, which offers a full version via Fdroid.Other repos for Apk Editor might be using apktool.jar. Apktool is also being used in many Android apps, like revanced. How are they able to run.jar tools is a mystery for me yet, as executing jar requires JRE while Android runs on Dalvik Virtual Machine.

A workaround (or not?) is to use jar library via custom Cordova plugin. Plugin docs suggest it can be done easily. See this suggestion from a stackoverflow answer:

Add lib-file element to your plugin.xml:

<platform name="android">

  <lib-file src="AztecReader.jar" />

</platform>

Anyway, ApkEditor recompiles the app on the device itself, without any internet connection. This approach proves that building an app builder on a mobile device is possible without the need for a server.

Cordova-like Environment

Creating a Cordova-like environment on a mobile device seems difficult. Even though initializing an empty Cordova app within the user's device is possible using Node Mobile or AndroidJs, compiling the APK will be tricky as it would need gradle, java jdk, android build tools, apksigner, etc. The end-users may not have these tools installed on their devices, making it difficult for them to compile the app.

Termux

Java runtime, etc., would be possible using Termux in android, but that would require end-users to have Termux installed, which may be a challenge.

Using a Sample App as a Base

Another approach could be to use a sample app as a base and replace its content at runtime using a user-defined config file. This approach is similar to the Cordova-like environment but is more simplified and straightforward.

Meta-data

One of the most popular strategies for creating an app builder is to use meta-data. In this strategy, the "app" you define is meta-data in a higher-level definition that is interpreted in a host wrapper app. This approach makes it easier to create apps as the app builder is more of a code generator.

Desktop - HTML to APK

A tool I found, and tested but never used in production or even to build anything remotely of any use for myself is Website to APK which is a desktop-based tool. The interface looks like it's built using the C# Windows Form Application. The options are really great, and it's user-friendly. 

Softonic's dev bio hyperlink suggests Pravesh Agrawal as the developer. Web, Github, Twitter.

It seems to be using all the standard tools in the background (probably running a bash script for build instructions). Options to select a URL or a local folder are awesome, along with an icon, splash screen, and setting up Admob ids in presumably pre-configured ad spaces. 

This perfectly depicts the "meta-data" type or a "base app" already set, which is modified based on the user's input. 

Available Tools

There are several tools available for creating an app builder on mobile devices. Some of these tools include: 

AppSheet: AppSheet uses a meta-data strategy to create an app builder. It interprets the higher-level definition in a host wrapper app, making it easier to create apps.

A sample response to the question "Building an App Builder - how do they do it?" on stackoverflow as a reference:

I work at AppSheet. There are two basic approaches an app builder can follow: (a) act as a code generator, or (b) implement an intepreter. In the former case, it spits out code that gets compiled into an executable package that can be installed and run on a device. In the latter case, the "app" you define is meta-data in a higher-level definition that is interpreted in a host wrapper app. Each has its strengths and weaknesses. AppSheet uses the latter approach. — Praveen Seshadri

Thunkable: Thunkable uses a simple drag-drop interface and loads of pre-defined templates and customizations. As far as I remember, It also uses Sratch for programming logic similar to Scratchware.

Andromo: Andromo is an online app builder that lets you create Android apps without any coding. It has a user-friendly interface that makes it easy to build apps.

BuildFire: BuildFire is another online app builder that offers a drag-and-drop interface for creating Android apps.

Conclusion

I'm not really sure which strategy would work the best, but a couple of them looks promising to me. For Android on Android, editing the APK and recompiling might be the easiest one. Although I've to dig deeper to understand how APK editor and the likes do it. It's not just unzip and re-zip of the package, which often results in app corruption. 

A desktop app might be simple, but dependencies should be bundled within the executable in that case, otherwise, it'd again feel like something built for advanced users.

References

Scratchware Pro continued on GitHub

How do I build a Cordova 8.x cordova.jar to include in existing Android app?

Integrating Hybrid App (Cordova) with Native App (Java android app) — Part 1 by pankajbhandari08

Decompile and Modify APKs on the go with APKTool for Android [XDA Spotlight] introduces apktool by Andro Black

Android Studio: Add jar as library? Directly or using mavenCentral as per one of the comments

Including .jar file into cordova plugin with suggestion to add lib-file in plugin

Thursday, 31 December 2020

iPhone Users! Here's a Web App for Qaafiyah Expert

Tldr;

If you are in a hurry, here's the link to Qaafiyah Expert - Web:

The Web App and its Journey

Right from the beginning when I launched an android app for Qaafiyah Expert (an app to assist Urdu poets with rhymes, meter, dictionary, diary, designing and much more), people were requesting the same for iPhone users. As I was using the cross-platform approach for the app, building the same thing for iPhone wouldn't have taken so long. But the problem was, apple AppStore's pricing. I couldn't afford it. Well, most of us can't.

Anyway, after some research on pricings, I decided to go for a PWA (Progressive Web App), which is an installable app, but you don't need to pay a single penny to Google or Apple whatsoever. 

It does bring some drawbacks, but there are alternatives for most of the incompatible native-app functionalities. For a naïve user though, PWAs and native Android/ios apps are indistinguishable. For instance:

  • Visiting a Progressive Web App asks you to "Add it to Home Screen", which is alternative to "Installing an app"
  • It does have an icon, just like a native app
  • It can work offline using service workers etc.
This PWA for Qaafiyah Expert had been hosted on my domain 'q.shakeeb.in' for quite a while now, as you can see in the "first commit" here. But some of the features were not working as expected, so I didn't announce it "officially." Now that the android app has been completely rewired, performance is improved and speed is optimized, I decided to use the new code-base, modified it for the web-app and deployed it. iPhone users can now finally use this app.

If you are an android user though, I strongly recommend the android version, which has some cool extra features and obvious UX advantages.

Once again, here's the link to the web-app:

Qaafiyah Expert - Live Demo

Hope this will assist in your poetry-writing journey. 

Rab raakha! 👋

Thursday, 24 December 2020

Rekhta Content Scraper by Shakeeb Ahmad | For Programmers Only

Note: This is not yet available for non-programmers. Soon I'll make an easy-to-use version for all, iA.

This scraper with Node.js works for both prose and poetry. Check the GitHub repo for installation instructions.

You would need a text file with all the links you want to download the contents from. To get the list of links, you could manually collect all which interests you, or use the following to scrape all links from an author/poet page.

Bookmarklets - One Click Solution to get the links etc.

Rekhta loads 50 links at a time, and if user scrolls, it adds more content to the DOM. This extra fetch has not been automated in my code yet. (Well I tried, but parsing it wasted so much time that I preferred using manual scroll. Just let the page load, then press "end" on your keyboard. Wait for a moment, it will add all the remaining links.)

Anyway, once you have the complete list on the page, you can use the bookmarklets below to copy all of them with a click.

I've been testing this in browser console for a while now, i.e. open browser console, then paste the script, then change the page text to only what I need, then select and copy them manually. 

Later on I decided to use magic of bookmarklets to automate these tasks I've been doing repeatedly: 

  • Copy all the links from the Poet/Author page.
  • For LitUrdu specifically, turn them into an "object" with required properties (title, author, link, description, text) and copy it.
  • Use the "object" to automatically fill-in text-boxes on new Blogger post.
Ultimate plan is to use Blogger API and post it directly, but this bookmarklet approach doesn't hurt much because most of the things I'm doing are just a click away.

Bookmarklets
Drag and drop the links to the bookmarks bar in your browser. (Ctrl+Shift+b to toggle the bar)
Use on author/poet's page to copy all the links to their enlisted work
Use on individual poem/story page to copy an object with properties (title, author, link, description, text). Modify as per your needs.
Use on a new Blogger post after pasting the "object" from rekhta in console. This will fill in all the required fields in the new post automatically.

Saturday, 3 October 2020

Magic of Browser Bookmarks - Automate Simple Tasks using JavaScript

Automation using Bookmarklet

As I promised in #LearnedToday, I'm going to show you how much you can achieve with this little bookmark feature in the browsers.

Ever wondered how to easily remove citations from a Wikipedia page? 

What are bookmarks?

The bookmarks in the browsers are to save the links to the pages you wish to visit again, or you just find them useful and save them for later. 

Instead of creating a text file "Imp Links" and saving all the links there (I've done it a lot), you could use the browser's bookmark feature.

The shortcut to bookmark a webpage in most browsers is ctrl+b.

What more can they do?

To sum up, they can run JavaScript on a page. So instead of opening the browser console to do run a couple lines of code, you could create a bookmark and click that instead.

Example?

Whenever I needed to copy something from Wikipedia, I usually had to deal with the references/citations they have. You must've seen those, with squared brackets around numbers, something like this [1] or with a disclaimer like [citation needed], etc. I needed to remove all those. 

Initially, I used to do it in MS Word manually, by Find and Replace. I don't remember that now, doesn't matter anyway. 

Finally, I came to know about these browser bookmarklets, and then a simple regex was enough to do the work for me.

Now I have a simple bookmark. I go to any Wikipedia page, select the text I need, and click the bookmark. Viola! Citations are removed.

How to create a bookmarklet?

Got to Bookmarks Manager

1. Click three vertical dots in the upper right corner > Bookmark > Bookmark Manager

Or chrome shortcut: ctrl+shift+o

Or type in the address bar: chrome://bookmarks/

2. Click three vertical dots in the upper right corner of Bookmark manager (Shows tooltip: Organize) 

3. Add new bookmark

4. It will show a popup with two fields: Name and URL. 

5. Give any appropriate name, and in the URL bar, paste the JavaScript code you want to execute.

6. Click Save. 


You have your bookmarklet ready. 

Show/Hide Bookmarks bar with ctrl+shift+b. Clicking on the name of your bookmark will run the underlying code. 

Any easier way to do this?

If you don't want to go through all those steps, there's a simple tool called Bookmarkleter. Paste your JS code, it will generate a link that you can drag and drop to the bookmarks bar. 

For example, drag and drop the following link to your bookmarks bar. This will allow you to change fonts on any website. 

Which bookmarklets am I using?

  1. Citation Remover: Removes citations from a Wikipedia page. Drag&drop this link to the bookmarks bar: Citation Remover
  2. Set Font: If a website is using bad font, use this. As I use Urdu a lot, and Urdu without Nastaleeq font looks ugly. So I apply any font to the page available in my system. Payami Nastaleeq is the default one for me.
  3. Calci: A tiny calculator which returns results of simple arithmetic operations.
  4. StyleStripper: Strips all CSS styles from a webpage. Helpful if I don't want to load an entire page I want to copy something from. Also works on most of the sites which disable copying using JavaScript. Click StyleStripper and you can copy the text. 

Misc. bookmarklets I created

QuoraSkip: Skip Quora-enforced 'login' popup by removing added elements and blur overlay.

To those who requested, don't complain now. (Abuzar :D) I have shared it finally. More such tips will follow. Keep visiting! And I know you will. :wink:

Rab Raakha!

Friday, 2 October 2020

PDF to Single Image - A Tutorial by 17 Year Old Me

Back in the days when I had a small Nokia phone, I wanted to do EVERTHING in that tiny device. It wasn't actually mine but because I was going to college, I was more "in need" of it than my sister.

Nokia-C1-01 Phone I had in my Engineering
Source: gsmarena.com [1]

The one on your right with maroon border. That was it.

Anyway, with a screen of 144x160px, I wanted to read PDFs which were stored in our desktop + laptop. Lots of books, of almost all genres I was interested in. Interestingly enough, the same neatly arranged folders are copied over to every computer I have used. So I still have all those books, plus what was added later on.

Initially, the idea to "read PDF on phone" was for the Quran, so that I could read it in the Indo-Pak Naskh font. Actually I had a Quran app in it, full text with super fast search engine, but the font used in that wasn't good enough for long tilaawat. In fact, even after getting android phone I've been searching something as fast as that app. I had been a fan of that guy who built it. Just looked it up, he goes by the name of Raza Mahi. His "Mahi Dictionary" was awesome too. All java .jar applications are things of the past now, but he has also moved on and started to build the similar apps for Android now. Good for him. I've linked his website in the references. [2]

So where was I? Yes. As I had difficulty reading the Quran in that app, I selected a PDF copy of Quran which had Arabic text in one column and its Urdu translation side-by-side. I cropped-out the translation part (making the text narrow enough to fit on my phone) and then started thinking about a way to achieve the result.

Necessity is the mother of invention they say, so I came up with two methods (discussed in the booklet below). Will attach the Quran files too for the record. Wow! Time flies. Seems like yesterday to me.

Later on when I converted many books to 'single image' using the same method, I compiled a short tutorial in the form of a booklet. I've left the whole text as is, without any correction in grammar or sentence structure, because

  1. It's a reminder of my journey (read the booklet and see for yourself how writing styles change)
  2. It's cute. ;)
Here's the summary of the two methods discussed in the booklet:

Method 1: Microsoft Office OneNote + MS Paint
Method 2: PDF to Images + IrfanView

Read the booklet and know how to use them. And remember it's an OLD tutorial.

DOWNLOADS

PDF to Single Image Tutorial (Booklet) : Read online or download

https://archive.org/details/PDFToSingleImageShakes.Ahmad

IrfanView: I came to know later on that this was very popular image-manipulation tool back then, and still is. Its first release was in June 1996. Now it's more powerful than ever. Check its Wikipedia page.[3]

https://www.irfanview.com

PDF to Images Converter: I still use it. Small size, works smoothly.

https://www.weenysoft.com/free-pdf-to-image-converter.html


Enjoy!


Reference

[1] Specifications of Nokia C1-01 via gsmarena [link]

[2] Raza Mahi Team - Old Apps [link]

[3] IrfanView on Wikipedia [link]

Friday, 24 April 2020

Cicada 3301 - A Mystery in the Cyber World

How I came across this?

So the year was 2017 I suppose, I was newly introduced to the dark web, and started watching creepy-pastas spread over the internet. It was interesting. Fascinating yet controversial. 

That's what makes it go viral, doesn't it? We all love conspiracies.

Considering my history of watching those videos, the YouTube suggestion algorithm one day decided to show me a video by LEMMiNO titled "Cicada 3301: An Internet Mystery" [link below]. And that short video introduced almost all concepts I'd studied in Cyber Security.

Let me appreciate that guys editing skills first of all.What a lovely piece of craft, indeed! 

When I watched the video, the curiosity made me search for more details related to it. I visited the Reddit threads related to it myself and the related onion links too. (Taken down, of course.)

Here's a small introduction of what this mystery was, thanks to Wiki, Reddit and several other resources. 

What’s Cicada 3301?

The most elaborate and mysterious puzzle of the internet age. — The Washington Post
Cicada 3301 is a nickname given to an organization that on three occasions has posted a group of puzzles to recruit code-breakers from the internet.

Different Rounds

The puzzle had few rounds. Nobody from the public knew that the next round exists, let alone guess it's date or format. It was because there was no official (signed message) from Cicada.

  1. The first internet puzzle started on January 4, 2012 on 4chan and ran for about one month.
  2. A second round began one year afterward January 4, 2013.
  3. And then a third round following the confirmation of a fresh clue posted on Twitter on January 4, 2014.

The stated intent was to recruit “intelligent individuals” by presenting a series of puzzles which were to be solved.

No new puzzles were published on January 4, 2015. However, a new clue was posted on Twitter on January 5, 2016. In April 2017 a verified PGP-signed message was found:
Beware false paths. Always verify PGP signature from 7A35090F.
That message explicitly denies the validity of any unsigned puzzle, as recently as April 2017.
The puzzles focused heavily on:

  • data security
  • cryptography
  • steganography
  • internet anonymity
  • surveillance

Speculations

It has been called “the most elaborate and mysterious puzzle of the web age” and is listed as one of the “top 5 eeriest, unsolved mysteries of the internet”, and much speculation exists on its function.
Many have speculated that the puzzles are a recruitment tool for the NSA, CIA, MI6, a “Masonic conspiracy” or a cyber mercenary group. Others have claimed Cicada 3301 is an alternate reality game.

No company or individual has taken credit for it or attempted to monetize it, however.

The Cicada 3301 Puzzle

Before diving into the main points, let me clear what it’s on the very surface level. It’s a puzzle which is posted on the web with the intentions of recruiting “highly intelligent individuals”.

Solving which supposedly gets you recruited to the NSA, MI6, Hacker groups and therefore the speculations go on and on; although no official prize has ever been announced.

It all started on January 4th, 2012. An elaborate puzzle appeared on message boards and forums which read:

This image when opened using a text editor gives out a Caesar cipher string of semi-readable text, which when deciphered results in an Image URI.

The chase then continued, one clue leading to another. The puzzles used all sorts of techniques in cyber-security including cryptography, steganography etc. They even dropped some clues on physical addresses.

Finally the website closed with a line saying
“We want the best, not the followers”. 
Soon there was a month of silence and then this Image was posted on the sub-reddit on Cicada.


According the Cicada they have found the people they were looking for. But the community out there was not satisfied because of the lack of ending to what was this all about. And many termed it as a wild goose chase and waste of time

But little did we know, this was just the beginning. After an year another quiz dropped on the forum.

The second and third round went similarly. A detailed analysis can be watched in this video.
. . .
by
Shakeeb Ahmad
Abuzar Gaffari
Ashwini Ghonse
Mustafa Al-Hammadi

[This is a truncated version of a 10-page long blog submitted to the institution.]

Sunday, 5 April 2020

LTE - Types, Features and Working

WHAT IS IT?

Assuming this is a new term for you and you have no idea what this is, “what on earth does this mean” is the first thing you should ask. Let’s know the full form first. LTE stands for Long-Term Evolution.
Ok. But evolution of what? I don’t know either. According to sources, this naming conventions were a part of advertising the technology and appeal to the customer base. Alright, enough of the intro, let’s know it’s simple explanation borrowed from Wikipedia:
Long-Term Evolution (LTE) is a standard for wireless broadband communication for mobile devices and data terminals.
You still don’t get it, did you? Remember 2G and 3G technologies? This LTE is the next stone in that journey. So the architecture was purely ased on the 3G technology by UMTS. Much of the LTE standard addresses the upgrading of 3G UMTS to what will eventually be 4G.
What’s the major difference between LTE and the third generation (3G)? Well, a large amount of the work is aimed at simplifying the architecture of the system. But is it 4G? We’ll discuss this in the end of this blog. For now, let’s jump to its classification.

TYPES

There are basically 2 mobile data transmission technologies based on 2 major factors, viz:
How data is uploaded and downloaded
What frequency spectra the networks are deployed in
So, based on these two factors, we have two types of LTE.
1. Long-Term Evolution Time-Division Duplex (LTE-TDD)
2. Long-Term Evolution Frequency-Division Duplex (LTE-FDD)
Before proceeding with this, let’s know some basics of GSM and CDMA so that you know what these “divisions” are. Afterwards, you’ll be able to digest this easily.

GSM, CDMA and LTE

GSM and CDMA are two different ways to accomplish the two things. LTE is newer.
The way GSM solves (1) is by something called TDMA (time division multiple access). When you're in a phone call, you're phone is scheduled a bunch of time slots when your phone either sends or receives data. These exclusive to your phone and different from other phones in the cell so there's no interference. This way, multiple phones can talk to the cell tower (seemingly) at once (the bursts of time are super short so you don't notice them).
CDMA deals with (1) in a completely different way. It breaks up the channel into codes/signals (Code division random access). This is a little hard to explain without some math, but there's a notion called orthogonality. If two signals are orthogonal you can pull one signal out without getting interference from the other. Every user is assigned a different code/signal and these are (approximately) orthogonal to each other. This is a more advanced technique and generally thought of as advantageous since there isn't as much waste (TDMA needs little bits of extra time between users to make sure there's no overlap, for example).
The way (2) is accomplished is also very different. In fact there are many different ways it is done even within GSM or CDMA. The way data is sent along depends a lot on how good the quality of the radio signal and other factors. That's a whole other thing. But the options for GSM and CDMA differ.
3G and 4G are kind of marketing terms that come from "3rd generation" and "4th generation". They refer to families of standards, but not specific methods to accomplish (1) or (2).
Now you know the basics, let’s get back to types of LTE.

LTE-TDD and LTE-FDD

LTE-TDD Uses a single frequency, alternating between uploading and downloading data through time while LTE-FDD paired frequencies to upload and download data.
Despite the differences in how the two types of LTE handle data transmission., LTE-TDD and LTE-FDD share 90 percent of their core technology. This makes it possible for the same chipsets and networks to use both versions of LTE.
Several companies produce dual-mode chips or mobile devices, including Samsung and Qualcomm.

FEATURES


  • Peak download rates up to 299.6 Mbit/s and upload rates up to 75.4 Mbit/s
  • Cost effective
  • Low data transfer latencies
  • Lower latencies for handover and connection setup time 
  • Higher network throughput
  • Improved support for mobility, exemplified by support for terminals moving at up to 350 km/h
  • Orthogonal frequency-division multiple access for the downlink, Single-carrier FDMA for the uplink to conserve power
  • Support for inter-operation and co-existence with legacy standards (GSM/GPRS or W-CDMA-based UMTS )
  • Uplink and downlink Carrier aggregation.
  • Packet-switched radio interface
  • It’s because of these features that most carriers supporting GSM networks can be expected to upgrade their networks to LTE at some stage


MADE OF?

What is LET made of? That means it’s working backbone consists of these things, most of which we have already discussed above. For the concepts you might not find familiar, I’ve attached link to resources so that you can have an idea of what they are.
OFDM (Orthogonal Frequency Division Multiplexing) for Downlink
SC-FDMA (Single Carrier FDMA) for Uplink
MIMO (Multiple Input Multiple Output)
E-UTRAN (for Network)

VOICE CALLS IN LTE

One of the major problems they faced designing LTE was how to handle voice calls using it. LTE was primarily meant for (internet) data transfer, so the transfer of voice data to integrate with telecom operators was an issue.
With the adoption of LTE, carriers had to re-engineer their voice call network. The reason behind this was that the LTE standard supports only packet switching with its all-IP network. On the other hand, voice calls in GSM, UMTS and CDMA2000 are circuit switched.
3 different approaches sprang up to handle this:

1] Voice over LTE (VoLTE)

VoLTE networks support both voice and data at the same time, without hampering the other. Whereas, the traditional LTE networks may or may not support data and voice together, or may affect the quality of the voice call

2] Circuit-Switched Fallback (CSFB)

LTE just provides data services. When voice call is to be made, it will fall back to the circuit-switched domain.
Advantage: Operators can provide services quickly.
Disadvantage: Requires longer call setup delay.

3] Simultaneous Voice and LTE (SVLTE)

Handset works simultaneously in the LTE and circuit switched modes.
LTE mode providing data services and the circuit switched mode providing the voice service. This is a solution solely based on the handset, which does not have special requirements on the network.
Disadvantage: The phone can become expensive with high power consumption.

IS IT 4G?

Now the controversy (not a big one, I know… but still, it is there.)
Contrary to popular belief, LTE at the current stage was not always considered 4G. ITU (International Telecommunication Union) determines what can be considered 4G and they initially had defined all the standards which a technology had to meet. LTE couldn’t meet those requirements.
Therefore, LTE is popularly known as 3.95G.
LTE-Advanced did make the cut through. But the business and telecom operators had allegedly “influenced” the ITU to update their standards so that they can advertise their services as 4G to attract users.
As a result, there is a slight disagreement between the businesspeople and technophiles on definition of 4G. technophiles consider the original ITU guidelines as a standard for 4G.

CONCLUSION

To solve “How to get many people to share a piece of spectrum”, LTE uses OFDMA which increases throughput
Hope you get at least the gist of what’s been explained in this blog. If not, jump over to the pages linked in the article or post comment if you are reading this on ShakesVision.

SHAKEEB AHMAD
April 05, 2020

Saturday, 29 February 2020

Qaafiyah Expert (Android) - Release


Links:


Download Qafia expert
Qaafiyah Expert is a simple tool which contains

  1.  A rhyme generator, with support of diacritics, filter for Urdu poetic meters and 3 scripts for search. Works offline.
  2.  A lightweight diary with offline "save" support.
  3.  An online portal for awesome literary posts, updated periodically.


For those who were waiting for this

Why did it take so long?

Like always, I'd list many reasons (excuses?)
  1. God's wish.
  2. Learning android development takes some time.
  3. The basic structure had been completed in September 2019, which I had had on my mobile phone. I used to suggest qawaafi to people asking for them using the tool. But I wasn't satisfied. At the time of Windows software version (in 2016) I was new in the programming world. Not a pro now either, but whatever I've learned in these years, I thought to improve at least few things in it and add few features of my own interest. So, the app has seen many phases before being released to the public. The basic version had the same options I'd put in Windows app.
Now, those who used to constantly poke me via email or social media to provide the basic version at least, may say unspeakable things to me; but as I've said many times:
I have a constant urge to present the things in the best way possible.
So I delayed it. Although I've recently read in a gyaani's article that this bug of perfectionism should be killed ASAP.

One more reason for releasing it late is that nobody likes to update the app too many times. So, changing few things and releasing an update would do no good. And Google PlayStore, MashaAllah, bombards you with questions in every release, making it further difficult.

Requests

The app is still in the dev mode, so if you find any bug or want something to be included in the next version, please leave a review. If the response is good, I'll try to roll out next release soon.

Few features in upcoming versions

  • App interface language switch, for those who don't know Urdu script (Complete Internationalization)
  • Meanings and thesaurus on word-click
  • Taqti (Poetic Meter calculation)
  • Poetry workshop
I've two requests for you. First, to report bugs if you find any and if you want any other feature to be included in this app (other than the 4 mentioned above) then comment on the Play Store's rating page.
Second, If you have an idea for a new app, go to "online" section of this app and submit your idea on "Ek app aisi bhi."

I've few app ideas of my own interest, have to finish them too. Remember me in your supplications. 

Shakeeb Ahmad
February 16, 2020
Telegram: ShakesVision

Saturday, 18 March 2017

Programming Challenge #1: Add Up To Second Number

Hello programmers. I am starting a series of programming challenges for beginners here. I'll post the problems with some explanation, screenshot of the final output and a little bit of hint if it is really needed. Solve your problems using any programming language you are comfortable with.

Here goes the first problem.

Programming Challenge #1: Add Up To Second Number

Details: Write a program which asks users to input two numbers. Your task is to add all the consecutive numbers from first number to second.
Example: 
Input 1: 1
Input 2: 10
Answer: 55

Additional Task(optional): Show the numbers being add. 

Final Output Screenshot:

Tuesday, 3 January 2017

Qaafiyah Expert - A freeware tool for poets by Shakeeb Ahmad

Android app for "Qaafiyah Expert" has been released. See Details.


What if you'll get lots of rhyming words just with a click of a button? Here it is. Qaafiyah expert is to do exactly that. 

I actually did that for myself, but I thought it'll be really good to share it with my friends. So, I refined the code, added some more functions and features like number of characters a Qaafiyah should have, saving them in a text file and auto-selecting the Urdu keyboard etc. and shared on some websites. And the response this tool got was unbelievable for me.

This application was my first step towards "Urdu Application Programming". I am thankful to my beloved chacha(that's what I call him) Aijaz Ubaid (Haidrabad) whose dictionary is used as the back end of this application. I would also like to thank Mr. Rana to tell me the power of C# language using which this application is programmed.

DETAILS

Back end: Flat File Database (FFD

Programming Language: C#.Net

IDE used: Visual Studio 2010

.Net Framework Version Required: Version 4

Interface Language: Urdu

Developer: Shakeeb Ahmad

Note: Qaafiyah is the word for "Rhyming word" in Urdu. Though this tool is designed specifically to give you Rhyming words in Urdu, you can also use it for Hindi if you know the Arabic Script (in which Urdu is written). You can also transliterate from Hindi to Urdu if you don't know the script and paste it in the text box of the software which says Talaash KareN(Search).

Following is the description of the tool along with screen shots. As the tool is intended to be used by Urdu audience, the description is given in Urdu.












 قافیہ ایکسپرٹ1.1
ضروریات:
•    ڈاٹ نیٹ فریم ورک۴ .Net Framework4) (
•    اردو کی بورڈ
•    سافٹ ویئر کو درست طور پر دیکھنے کے لیے آپ کے کمپیوٹر پر جمیل نوری نستعلیق فانٹ کی موجودگی کو یقینی بنائیں۔  













سہولیات:
۱۔ سافٹ ویئر لوڈ ہونے سے پہلے Splash Screen کے منظر (جو تین سیکنڈز تک موجود رہتا ہے) کو اوپر موجود ”x“ کی سائن پر کلک کر کے بند کیا جا سکتا ہے۔

(Psychologically, people love you… [oh sorry, your ‘software’] if you give this option to them)
 













۲۔مین  سافٹ ویئر لوڈ ہوتے ہی آپ کے کمپیوٹر کا ”اردوکی بورڈ“ خود بخود سیلیکٹ ہوجاتا ہے۔( Altr + Shift وغیرہ کی کوئی ضرورت نہیں)نیز کرسرCursor  ”تلاش“ کے بازو والے ٹیکسٹ باکس میں آ موجود ہوتا ہے۔
۳۔ دائیں سے بائیں اور نستعلیق کی سپورٹ تاکہ سافٹ ویئر کا انٹر فیس گراں نہ گزرے۔
۴۔  تمام متن کو کاپی کرنے کی سہولت جسے آپ با آسانی کسی اور جگہ پیسٹ کر سکیں۔
۵۔ نیز آپ کے قافیوں کو بطور ٹیکسٹ فائل محفوظ کرنے کی سہولت۔














۶۔ ٹیکسٹ فائل کو خود کار طور پر مناسب نام دینے کی سہولت تاکہ بعد کے ریفرنس میں آسانی ہو۔
•    ”تمام دکھائیں“ کے آپشن کے ساتھ آنے والے نتیجہ/رزلٹ کو قافیے کے اخیر حروف کے نام سے محفوظ کیا جائے گا۔ مثلاً ”اط کے قافیے“
•    ”تعین کریں“ کے آپشن کے ساتھ آنے والے نتیجہ کو قافیے کے اخیر حروف اور آپ کی تعین کردہ سیٹنگز کے ساتھ محفوظ کیا جائے گا۔ مثلاً ”ام کے قافیے-صرف 4حروف“
یہ محض ایک آپشن ہے، ظاہر ہے آپ خود کار طور پر آنے والے نام کو اپنی پسند کے نام سے تبدیل کر سکتے ہیں۔













۷۔ ”قوافی میں حروف کی تعداد کتنی ہو؟“ کے تحت ”تعین کریں“ کے آپشن پر کلک کرتے ہی کرسر Cursor ٹیکسٹ باکس میں آ موجود ہوتا ہے اور  آپ کا کی بورڈ لے آؤٹ (جو پہلے اردو تھا) خود بخود انگریزی میں بدل جاتا ہے تاکہ آپ حروف کی تعداد کو با آسانی بغیر کی بورڈ چینج کیے ڈال سکیں۔ واپس قافیوں کے ٹیکسٹ باکس میں جاتے ہی کی بورڈ پھر اردو ہو جاتا ہے۔
۸۔ نتیجہ کے طور پر حاصل ہونے والے قوافی کی تعداد ”کل ریکارڈز کی تعداد“ میں دیکھی جا سکتی ہے۔
طریقہ کار:
•    کسی لفظ کا قافیہ معلوم کرنے کے لیے ٹیکسٹ باکس میں اس کے آخر کے حروف داخل کریں اور ”تلاش“ کا بٹن دبا دیں۔













•    مثال:  اگر آپ نے ایسے تمام قوافی معلوم کرنے ہیں جو ”اط“ پر ختم ہونے ہوں(مثلاً  ”نشاط“)تو ٹیکسٹ باکس میں ”اط“ داخل کریں اور تلاش کا بٹن دبا دیں۔ سافٹ ویئر تمام قوافی کی لسٹ ظاہر کر دے گا۔
•    ان قوافی میں سے مناسب الفاظ کا انتخاب (بحیثیتِ شاعر) آپ کا کام ہے۔
•    زیادہ قوافی موجود ہونے کی صورت میں سافٹ ویئر تلاش میں وقت لے گا، اس میں پریشان ہونے کی ضرورت نہیں۔ جب تک ماؤز پوائنٹر Mouse Pointer لوڈ نگ ظاہر کرنے والا دائرہ بناتا رہے،  آپ سمجھ جائیں کہ ابھی تلاش جاری ہے۔
•    بائیں جانب موجود ”قوافی میں کتنے حروف ہوں“ کے آپشن میں آپ کو یہ سہولت دی گئی ہے کہ آپ قافیوں کے حروف کے تعداد کا تعین کر سکیں۔ ڈیفالٹ آپشن ”تمام دکھائیں“ کو سیلیکٹیڈ رکھا گیا ہے۔ اگر آپ چاہتے ہیں کہ حروف کی تعداد کا تعین کریں تو ”تعین کریں“ کے ریڈیو بٹن پر کلک کر دیں۔  اس کے بعد ڈراپ ڈاؤن لسٹ میں سے ایک آپشن چنیں(پہلے آپشن “زیادہ سے زیادہ“ کو ڈیفالٹ رکھا گیا ہے) بازو میں دیے گئے ٹیکسٹ باکس میں حروف کی تعداد ڈالیں اور ”تلاش کریں“ کے بٹن پر کلک کر دیں۔ آپ کا رزلٹ فلٹر ہو چکا ہوگا۔













•    مثال: ”اش“ پر ختم ہونے والے تمام قافیے جو کم از کم تین حروف پر مشتمل ہوں(زیادہ سے زیادہ کتنے بھی حروف ہو سکتے ہیں) کے لیے درج ذیل سیٹنگز رکھیں۔
1.    تلاش کے بٹن کے بازو والے ٹیکسٹ باکس میں”اش“ لکھیں۔
2.    ”قوافی میں کتنے حروف ہوں؟“ کے ذیل میں ”تعین کریں“ کے ریڈیو بٹن پر کلک کریں۔
3.    ڈراپ ڈاؤن لسٹ میں سے ”کم از کم“ کو منتخب کریں۔
4.    حروف کی تعداد کے ٹیکسٹ باکس میں ”3“ کا عدد ڈال دیں۔
5.    ”تلاش کریں“ کے بٹن پر کلک کر دیں۔
Known Bugs:    
Counting ‘a’raab’ as one character.
اگلے ورژن میں ممکنہ اضافے :
۱۔ اردو کی بورڈ کی غیر موجودگی میں بھی اردو ٹائپ کرنے کی سہولت دی جا سکتی ہے :
    اول: براہ راست کی بورڈ سے
    دوم: آن سکرین On Screen کی بورڈ سے
۲۔ ڈکشنری (اعراب کے ساتھ) اور موجودہ ڈکشنری کا امتزاج کیا جا سکتا ہے۔
( یاد رہے کہ موجودہ ورژن میں بھی ڈکشنری کو بدل کر اعراب والی ڈکشنری کو استعمال کیا جا سکتا ہے جس سے سافٹ ویئر میں کوئی تبدیلی کیے بغیر اعراب کے ساتھ قافیے دیکھ سکیں گے۔ لیکن دونوں ڈکشنری کے سنگم میں زیادہ سہولت بھی ہوگی اور معرب اور غیر معرب الفاظ کی مطابقت سے سافٹ ویئر کو اسے اڈاپٹ کرنے کے قابل بنانا ، ناگزیر ہوگا۔)

مزید کسی اضافے کی تجویز اگر آپ کے ذہن میں ہو تو ضرور بتائیں۔
کسی بھی قسم کی تجاویز اور مسائل کے لیے اس ای میل پتہ پر رابطہ فرمائیں:
shakes ڈاٹ ahmad ایٹ gmail ڈاٹ com
یا فیس بک پر:
fb.com/shakes.ahmad
قافیہ ایکسپرٹ کے بارے میں اپنی رائے ضرور دیں۔
والسلام
دعا گو و دعا جو
شکیبؔ احمد

Friday, 9 December 2016

One of The Greatest Workshops I've Ever Attended

Mr. Aniruddha Pathak [Photo taken from Facebook]

REPORT- TWO DAY WORKSHOP ON SOFTSKILLS

By: Shakeeb Ahmad

Background


“Yes sir!” I turned towards Prof. Abhijit as he called my name.

“Do you know about tomorrow’s workshop?” He asked.

“No” I said.

“We have arranged a workshop tomorrow at 10:30 am in the seminar hall…you know…at first floor. It’s related to T&P.” He informed.

“Ohh Okey sir.” I replied.

And that’s it. I had no idea about the workshop that how it would be. I was thinking it as any normal workshop or seminar we had attended so far. But now I admit…it was not normal. It was one of the most perfect one I’ve ever attended.

***

During the Session


‘Mr. Aniruddha Pathak’ was what he has introduced himself along with a long list of qualifications, certifications and courses. It would be perfectly normal if he had the tone which most of the people having the similar qualifications have. But he had very friendly, smooth and pleasant tone that I still remember his voice; echoing in my ear, full of encouragement and energy.

The very first thing he did was encouragement and motivation. About 15 to 20 minutes, he continued and filled all of the students with hope, enthusiasm and the belief of you-can-do-it.

He introduced all the steps an organization takes to recruit freshers. From resume to interview, he explained them in a nutshell. Then the journey started from self introduction. He explained all necessary points to be included in an ideal self intro along with Dos and Don’ts. Questions were constantly being asked from students, showing their high level of interest in the session.

The difference between resume, CV and bio data was then explained and the topic shifted to how an ideal resume should be. The format of resume was discussed so deeply that no other topic except GD (Group Discussion) and PI (Personal Interview) was discussed in that much depth. He said that projects are very important in your resume as a fresher.

“What else is there in a fresher’s resume except his project” he said. Without a break, he continued sharing his experiences, stories and tips to guide students make their resume better. He insisted students to include their extra curricular achievements, language proficiency and computer proficiency in resume.

Adding a tip, he said “Including your passport number in resume shows your readiness to move across the globe.”

Next topic was grooming. He explored each and every detail from hairs to shoes, for both- boys and girls. After grooming, he switched to Body Language where he discussed topics like hand shaking, eye contact, gestures and postures, even the details of how to stand, walk and sit along with Dos and Don’ts of all. He continued adding flavor in all details by sharing various real life experiences and made all session full of laughs and hence interesting.

The session was then handed over to Ms. Mamta who guided the students on “Email Writing” and “Paragraph Writing”. She explained the use and difference of BCC and CC, concluding as “Try to avoid using BCC”. Then she discussed the format of both email writing and paragraph writing. She explained the limits of time and words in paragraph writing. Giving different tips to the students, she said “You are not a student of fifth standard, so make sure your words in paragraph writing or email writing should match your age.”

Day two was more exciting for students than day 1. Pathak sir started the session with the topic KYC (Know Your Company) or 3C (CCC- Company, Customer, Competition). He frequently gave important questions which might be asked in HR round during his quick session. Students were noting down the questions and their sample answers.

Session was then handed over to ___ sir whose topic was “Public Speaking”. He shared various experiences and motivated students. Explaining how important speaking is, he said “Humans are the only one who can speak. No animal is given the words or the ability to speak like us. This shows we are made to speak… Its makes no sense being shy to speak.” He made one girl stand and ask her some questions, and then made it clear to all students that he is going to remember this girls, only because she had spoken to him. He also shared some tips to fight stage fright.

A small session was taken by Rozeena mam. She asked different HR questions to students, motivated them and given chocolates to appreciate and encourage the students.

The final session was on Group Discussion and Personal Interview, again by Pathak sir. After explaining difference between discussion and debate, he discussed types of GD and normal time duration given for GD. He said topics have no bound in GD and you have to be well prepared. Sharing the biggest Don’t of Group Discussion, he said “Never ever take name of any religion, caste or community in group discussion.”

Finally, he explained the types of interview. And then a detailed analysis of what and why people do mistakes in interview. He discussed what to do before, during and after the interview. Once again, the explanation was full of interests and his own interesting experiences, which filled the room all with smiles and laughs.

After the session, students were divided into groups to take their GD, and even when it was already end of the official college day (at 5:30) all students waited and participated in the activity with full interest. This was enough to know how successful workshop was.

***

I feel…


Can you guess the students remembering very small details of what was explained to them? Such were the students who attended the workshop. I don’t think I’ve ever seen that big quantity of students who were well aware of their abilities and qualities. A confident smile was on their faces, and bright eyes saying yes to any situation they might face in their near future. The only reason behind all this was Mr. Aniruddha Pathak.

I have read a considerable number of books on psychology, soft skills, personality development, leadership, confidence building, verbal and nonverbal communication including gestures and postures etc. Therefore, it’s in my nature that I analyze everyone. And I can say definitely, Pathak sir was one of the most successful public speaker I’ve ever seen. During his introduction, he had also mentioned psychology, and his all sessions are witness to his mind reading ability. He was just perfect with student’s psychology and hence all of the students were listening to him without getting bored. He knew the ways to make his speech attractive. The way he appreciated, motivated and encouraged students to do something special in their life was the first impression he left on student’s hearts and students started loving him. He said that we have to pen down our story by our own. And those who don’t write their story start giving excuses.

I liked one point the most, written that in bold at very top of my notebook, “Don’t run for selection in interviews, aim for not to get rejected. That’s it!”

And a wow statement “If you got selected, then balle balle, if not, then say with proud, ‘it’s your loss boss, you’ve lost the candidate like ME.”

He was explaining sometimes like a father explains his son. I liked the tips given to girls very much, which seemed like a very caring father giving some greatly loving tips to his daughter. Very hearth touching.

Needless to say, the jokes and the stories were the best parts from all the sessions he took. They never allowed students to get bored. This style was very much similar to Dale Carnegie, who frequently shares his own experiences in his books, which forces the reader to finish the book in one sitting only. The workshop was very useful, interesting, informative and motivating. We are more confident and more serious about our career objective than before. I am very thankful to all trainers, to our whole staff, T&P incharge Mr. Abhijit and especially to our principal Mr. K. V. Shirsagar for this useful workshop.

SHAKEEB AHMAD
FINAL YEAR, CSE