BRC Infra – Sree Hemadurga Sivhills, Landline Connection Issues

Hello readers! This is a post by one of the residents but it may resonate with voices of a lot of people here (location). There may be a lot of issues and they do exist in every other society/gated community and the difference maker is how the issue is resolved by the administration.

As of today we are looking for things for example:

  1. Water Softener
  2. Parking Allocations
  3. Car stickers
  4. There are many more…

But what this post is about? Its about adding one more option to currently what is being provided for internet to us – beam; as well as we need a Landline option – BSNL.

I will not talk about things other than BSNL here otherwise this post will never end. Lets talk about BSNL only and I would like residents to read, correct the mistake and provide comments whatsoever. I’ll include it in the post!

We are a crisil 5 start gated community where eventually 700 odd families will be staying. In a community this big what residents, current or prospective, look for is how good the facilities are, how quickly the issues are resolved and how the administration attend to them.

One of the many things that a lot of current residents need is a landline connection, and they probably need BSNL connection and not beam landline. I have heard beam is going to provide us landline.

In other words, if I am not wrong they want to launch landline and they want to experiment starting with us. I hope that’s not true!

My question to BRC administration is:

  1. If we, the residents/owners, need a BSNL connection to our homes what is stopping you to allow them inside BRC Sree Hemadurga Siv(a)hills. I have heard BSNL has laid optical fiber upto BRC gate but BRC is not allowing them to come inside.
  2. Another thing that I hear is BRC is allowing them in but, BSNL guys are not coming and looks like they want “something” from BRC
  3. Third story I hear is BRC and Beam has some contract that doesn’t allow any other competitor enter here. (That contract is not legal ;))

By the way, long time back I asked maintenance team about landline connections and I was told BSNL cables are being laid. Soon I should get!

Whatever the reasons may be, I just want to know why there is an issue giving the residents and owner what they want.

One of the resident’s here is an ex-employee of BSNL and he should help us in getting the “fiber to the home“. That way we will get another internet option and a landline option; and if beam sooner or later comes with its own landline they may experiment their development on us.

I would like to know, if possible in detail, what the issues are that BRC might have been facing in providing us BSNL connections. We need to go ahead and solve them together.

On a lighter note,

It will be very difficult if BRC admin starts controlling what brand of salt we should eat and what water we drink.

 

Chennai Rains: Are Private Organizations Doing Enough For Their Employees?

As can be seen in the following links:

The Chennai is full of water flowing over its roads and it is getting too difficult for the commuters to reach places. The cab services, other public transport services are hit and schools are shut.

Is that enough? This write up is not to be critical about the governance but about the private sector companies who doesn’t seem to be sensitive about their employees.

No holidays are declared, no temporary shuttle services are being introduced. The companies are not changing their work hours and there is not flexibility.

Here is a slide from Times of India that shows the mayhem caused by the rains in Chennai:

http://photogallery.indiatimes.com/news/india/heavy-rains-disrupt-life-in-tamil-nadu/articleshow/49765889.cms

I am not sure but I have heard that there’s a tsunami alert also but I don’t know how reliable that information is. But coming to the point

How many private companies has declared holidays? I don’t know. That is what should be done now. We should ask HRs of various companies and find out:

  1. What are the plans they must be having in their mind
  2. Are they changing their office hours
  3. Are they declaring a holiday

After we know the answers we will be able to figure out about the attitude of different companies towards its employees. We will that way be able to find out which of these companies also give importance to their employees apart from the revenues and returns.

Lets hope that the businesses still got some respect and sensitiveness towards humans.

Standard Template Library – STL

STL is just a name/acronym for Standard Template Library. What is it? It is a library of classes that are actually class templates and are present under ‘std’ namespace. That means these libraries come with C++ by default.

Like printf is a standard function, vector is a standard class template.

The important class templates I’ll write about are:

  • vector
  • list
  • set
  • map

All of these classes are derived from one class called container class. As the name suggests the container classes contain one  or more objects that may represent a data structure. In other words, container classes are wrapper over certain data structures and make a programmers life easier as he/she doesn’t need to write every time complex data structures.

You need to use std:: or using namespace std to use all of them

Vector – #include <vector>

It is a wrapper over a dynamic array and has methods to facilitate the allocating, deallocating or resizing the array with ease. Programmer doesn’t need to care about the different implementations with respect to array!

vector<string> v;
v.push_back("one");
v.push_back("two");
for (vector<string>::iterator iter = v.begin(); iter != v.end(); ++iter)
{
cout << *iter << endl;
}

List – #include <list>

Like vector, list is also a container class but the internally its not an array but a linked list. A programmer needs to carefully choose among different  container types based on the use of it.

list<string> l;
l.push_back("one");
l.push_back("two");
for (list<string>::iterator iter = l.begin(); iter != l.end(); ++iter)
{
cout << *iter << endl;
}

Set – #include <set>

set<string> s;
s.insert("one");
s.insert("one"); // <-- This line will not affect the set... set doesn't let duplicate element to be inserted
s.insert("two");

You can iterate over the set like in the vector and list

Map –  #include <map>

map<string, pair<int, int> > m;
m.insert(pair<string, pair<int, int> >("create", pair<int, int>(0, 124)));
m.insert(pair<string, pair<int, int> >("create", pair<int, int>(125, 203))); // <-- This line will not affect the map... map doesn't let duplicate **key** to be inserted.
m.insert(pair<string, pair<int, int> >("modify", pair<int, int>(125, 203)));
for (map<string, pair<int, int> >::iterator iter = m.begin(); iter != m.end(); ++iter)
{
// cout << *iter << endl; <-- This is a compiler error...
// A vector is an array of elements so type of *iter in case of vector returns an element which is actually string in the above vector example
//Same stands true with list and set too... you push_back or insert a string in all above cases...
//But in case of map you insert a pair<type1, type2> where type1 is string and type2 is pair<int, int>. In case of map iter is a composite object that looks like
// struct IterType {
//    type1 first;
//    type2 second;
//}
// So how do you print
cout << iter->first << endl;
// cout << iter->second << endl; <-- Now, this will give an error! I think I should leave it to you understanding why this will give an error
}

Multithreaded programming using pthreads

You may want to read about function pointers (https://shutterdeck.wordpress.com/2015/11/08/what-is-function-pointer/) before starting pthreads:

What is multithreaded program? Why do we need it?

Wikipedia says and I quote with some strike-through lines:

In computer architecture, multithreading is the ability of a central processing unit (CPU) or a single core in a multi-core processor to execute multiple processes or threads concurrently, appropriately supported by the operating system. This approach differs from multiprocessing, as with multithreading the processes and threads have to share the resources of a single or multiple cores: the computing units, the CPU caches, and the translation lookaside buffer (TLB).

What is a thread?

Thread can be defined a sub-process of a process that has a separate execution stack. Operating system schedules the thread execution and priority. The OS exposes APIs to create threads and pthreads is a library that is actually a wrapper over those APIs. How do we create threads using pthreads?

What is a “main” function in C++? Its a function which is an entry point of a compiled program. The “main” function is called first and all the user/programmer logic starts after that. If we don’t have threads in a program we call it a single threaded process (process is program in memory). That single thread is called main thread!

The main thread needs to spawn a thread if programmer needs to add one more thread to the program and in turn process. But how do we create that thread? Think how did you create the main thread? There was an entry point; the main function.

To start a thread you need to have an entry point too. With the help of C++ library a programmer gives a “main” function to enable an OS start a process (main thread). With the help of pthread library we can ask the OS to start a thread by passing an entry point of a thread!

The only difference is there is no fixed name like “main” for creating/starting a thread.

To create a thread you have to create a function and tell the OS  to start that function in a Thread. How do we do that? By calling this function from pthreads:

pthread_create()

You can have a look at the minimal program to create a thread…

http://timmurphy.org/2010/05/04/pthreads-in-c-a-minimal-working-example/

 

What is function pointer

A function pointer contains the address of the location where the code (in the code segment) of that function resides in a process. But what is a code segment? What is a process?

Process and Code Segment

Process is a program loaded in memory. As simple as this. An executable file is a program and when its run it becomes a process. Lets take an example of the following program.

int nextNumber(int n)
{
return n + 1;
}

int main()
{
const int t = 5;
int x = nextNumber(3);
printf("%d\n", x);
return 0;
}

After the above code is compiled it should generate an executable program which when run calls the function nextNumber and prints that number.

That means the function nextNumber exists somewhere in the program. Right? Infact the function main and the function printf exists in the program! The entire code gets compiled to native code and an executable is generated. Native code means the instruction set which the OS understands on which the program is compiled.

So this program has all the source code and compiled to native code and is present in the “code segment” of the program. In other words the section of the compiled program where the source code is present is called code segment. It is also called text segment.

What is Data Segment

Its that section of the program where the global and static variables are stored. The data segment is sub divided into initialised and uninitialized data segment.

static int  i = 5; // <-- This code will **NOT** be in code segment but goes into data segment; in initialised data segment

static int  j; // <-- This code will **NOT** be in code segment but goes into data segment; in uninitialised data segment

Now, when this program is run it becomes a process. The code segment and the data segment is loaded into the memory. When the program is executed it may allocate and deallocate memory.

A program does not have any memory. Its just a file with code and data segment which is capable of getting executed.

What is a Symbol Table

A symbol table is a table that contains mapping of a C++ symbol with the corresponding actual value when the program is run.

What goes into symbol table?

The functions and constant variables! It should look something like this…

Capture

So, what is a function pointer and what does the function pointer contain?

Function pointer is a pointer that points to a function! Like char* points to a char data type and float* points to float data type. A function pointer is a pointer that points to what type? “function”.

If there is a function

return_type creepy_function(arg1_type arg1, arg2_type arg2)

the “function pointer type” will look like

return_type (*new_function_pointer)(arg1_type arg1, arg2_type arg2) = NULL

new_function_pointer is a pointer to a function that returns a “return_type” and takes two arguments as shown.

The statement

new_function_pointer = creepy_function

will result in copying the address of the creepy_function in the new_function_pointer. The creepy_function will have a location in code segment when the program is run.

A far better explanation probably exists here => http://www.cprogramming.com/tutorial/function-pointers.html

My Two Cents about Online Retail Stores and E-Commerce

There was a time when I was afraid of buying anything online. I would go to a relevant shop, ask the shopkeeper about the different options, short list a few, go back home think, ask friends and family and then finally decide what I am buying. I would go to that shop again and probably some more for a better bargain, inspect the product and when I find everything alright I would pay the money and eureka. Phewww.

During those times, there were less resources, less options and (arguably) less cheaters. As of today, I am afraid of going to a shop and asking about options as either I don’t know him/her well (as I would know during those older times) or I won’t trust. Now most of the times I login to my facebook account post some crap, chat on WhatsApp or tweet about the grievances or even the personal issues (Miss you daddy:-| ) #sorry :P .

Anyways, when we talk about online retailers the names that come in mind are Flipkart, Amazon, eBay and snapdeal. There are more like homeshop18, infibeam and should be many more.

ADVENT

I believe we (me and people like me)  gave the online retailers a hard time during their initial days. We were not ready to buy a mobile phone online no matter how cheap price they were selling it for. It was hard for me to even imagine buying it online, giving my money before I get the product. There must be a “first time” for every online buyer. I was quite afraid as I remember when I ordered something for the first time on Flipkart. I kept checking emails every few hours, was little excited about this new experience as well as little skeptical about the product quality and looks. Well, the product reached and it was great, brand new untouched. My next product that I bought online was a TV and I was not that into fear as by that time flipkart had started cash on delivery.

TODAY

Now that I trust these websites I am fine ordering anything on it. Be it cash on Delivery or using Credit/Debit Card I don’t hesitate much before ordering. Now that I can read the reviews compare the products find the best bargain and offers I am comfortable buying stuff online.

All of these websites have one or more offers. Daily Deal, Big Diwali Day ;) , Lightning Deals, Buy More Save More and what not. Go have  a look at the website and they are designed and managed by cream geeks of the earth. These websites display their love and affection for their customers as if they have been launched for social service. But believe me they are just doing the business. These are big companies/businesses who aims at making profit every year and increase it year by year.

I believe they love their investors more than they care about us. It won’t be a surprise to me if I am cheated by any of the websites. As of now the online retailers’ war is for winning the trust of the user/customer and be such a brand everyone thinks of when talking about e-commerce. But that’s business, pure business and I am not saying its wrong.

I believe there will soon be a time when we will be depending on the online reviews of a product like we used to depend upon the shopkeeper. We will be cheated time and again by different online retailers. To buy from a good online brand we may need to shell out good amount and use their premium service. And we will be taking out our frustration out on another blogging website. No human will be there to listen to us or our thrashing. And we will call ourselves a developed nation.