Category: Programming

All about programming

Mosquitto MQTT Install and Run part 1

Author: | Categories: IoT, Programming, Raspberry Pi 5 Comments
MQTT (Message Queue Telemetry Transport) is a publish subscribe messaging protocol for use on top of the TCP/IP protocol. It is designed for connections with remote locations where a small code footprint is required or the network bandwidth is limited. Mosquitto is an open-source message broker service that uses the MQTT protocol to send and […]

C# Round Robin Resources

Author: | Categories: Programming No Comments
The Problem: You have scarce / limited resources and you want to use these in and efficient way in your Code. E.g. You can only create N objects of certain class because of its limitation in terms of Resources or Licenses, and you want to share those Objects across M Consumers. The Solution: One way […]

Revision Count in Posts Admin Screen in WordPress

Author: | Categories: Programming, Wordpress No Comments
This Post discusses how you can add Revision Count in Posts Admin Screen in WordPress. In order to show Revision Count as a Column in Posts Page Admin Screen, add below filter and action in functions.php of your theme. // register custom column add_filter( 'manage_posts_columns', 'custom_posts_table_head' ); function custom_posts_table_head( $columns ) { $columns['revisions'] = 'Revisions'; […]

Add Custom Column in Admin Post List in WordPress

Author: | Categories: Programming, Wordpress No Comments
In this post I’ll show you how to add Custom Columns to WordPress Posts Management screen. Also I will show how to make those Columns Sortable. To add Columns in Posts Page in Admin Screen, add filter “manage_posts_columns” and action “manage_posts_custom_column” in functions.php of your theme. // register custom columns add_filter( 'manage_posts_columns', 'custom_manage_post_column_test' ); function […]

Post Views using Post Meta in WordPress

Author: | Categories: Programming, Wordpress One Comment
This Post discusses how you can track Post Views in WordPress without using Plugin by using Post Meta. Post Views can be shown in Home Page and along with the Post itself but I will show Post Views in Posts page on Admin Screen. In the end, I’ll make this column sortable. Open functions.php of […]

Pass Data to Partial View – ASP.NET MVC

Author: | Categories: Programming No Comments
There are many ways to pass Data to the Partial View. I’ll discuss here method which I use in my projects which is passing Strongly Typed Model to the View. View Models public class ParentViewModel { public Id { get; set; } ..... public ChildViewModel Child { get; set; } } public class ChildViewModel { […]

Navigation Menu using ViewModel ASP.NET MVC

Author: | Categories: Programming 7 Comments
There are many approaches to Generate Dynamic Navigation Menus in ASP.NET MVC Applications, in this post i will discuss one approach using ViewModels and Partial Views which I use in my Applications. First I’ll create a Hard coded Navigation then replace it with based on ViewModel. Lets say we want to create a menu like […]

Login with User Name instead of Email in ASP.NET MVC Identity

Author: | Categories: Programming 2 Comments
When an ASP.NET MVC Application is created with “Individual Accounts” authentication, it is set to use Email address to Register and Sign in instead of User Name, so in this Post I’ll show how to use User Name to Register and Login. Open AccountViewModels.cs in Models folder, add below code in LoginViewModel and RegisterViewModel [Required] […]

Control Raspberry Pi LEDs from Web and Mobile

Author: | Categories: IoT, Linux, Programming, Raspberry Pi 2 Comments
In this post, I’ll demonstrate controlling couple of LEDs connected to Raspberry Pi GPIO from Web. LEDs could be replaced with any devices so its a kind of basic IoT project too, so this core design can be extended to any scale and many devices can be controlled simultaneously. Programming is done in Python and […]

Get APK from Android Device

Author: | Categories: Programming No Comments
Sometimes you need APK file from the Android device. Easiest way is to use ADB. You need to connect android device to computer and have the required drivers of Android device installed along with Android SDK tools. Run below command to display all the packages installed on your device. adb shell pm list packages Find […]