C,C++/JAVA/BASH/ASM ARENA

वह प्रदीप जो दीख रहा है झिलमिल दूर नही है थक कर बैठ गये क्या भाई मन्जिल दूर नही है चिन्गारी बन गयी लहू की बून्द गिरी जो पग से चमक रहे पीछे मुड देखो चरण-चिनह जगमग से बाकी होश तभी तक, जब तक जलता तूर नही है थक कर बैठ गये क्या भाई मन्जिल दूर नही है अपनी हड्डी की मशाल से हृदय चीरते तम का, सारी रात चले तुम दुख झेलते कुलिश का। एक खेय है शेष, किसी विध पार उसे कर जाओ; वह देखो, उस पार चमकता है मन्दिर प्रियतम का। आकर इतना पास फिरे, वह सच्चा शूर नहीं है; थककर बैठ गये क्या भाई! मंज़िल दूर नहीं है। दिशा दीप्त हो उठी प्राप्त कर पुण्य-प्रकाश तुम्हारा, लिखा जा चुका अनल-अक्षरों में इतिहास तुम्हारा। जिस मिट्टी ने लहू पिया, वह फूल खिलाएगी ही, अम्बर पर घन बन छाएगा ही उच्छ्वास तुम्हारा। और अधिक ले जाँच, देवता इतन क्रूर नहीं है। थककर बैठ गये क्या भाई! मंज़िल दूर नहीं है।

Does your VPN gets disconnected and connected continuosly? One solution… May 1, 2014

Filed under: Uncategorized — whoami @ 14:46
Tags: , ,

Sometimes i work from home and one night i found that i am not able to work. Why? Its because my VPN ( Cisco anyconnect) was getting regularly connected and disconnected. Because of this i have to go office next day. It was happening when i am in my WIFI network and VPN was used. The problem does not seem to be there when WIFI was different. 

Then i found some solution w.r.t Cisco Anyconnect on forum and this solution was related to MTU(Maximum Transmission Unit). On windows after executing what suggested on the link. Got following outputs and as suggested look at the MTU value of one the interface and you can easily understand this can be problem root cause.

 

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\anurag>netsh interface ipv4 show subinterfaces

   MTU  MediaSenseState   Bytes In  Bytes Out  Interface
——  —————  ———  ———  ————-
4294967295                1          0     655724  Loopback Pseudo-Interface 1 ->>>>>> see the MTU value, its too large
  1500                1    4354621    1039320  Wireless Network Connection

C:\Users\anurag>netsh interface ipv4 show subinterfaces

   MTU  MediaSenseState   Bytes In  Bytes Out  Interface
——  —————  ———  ———  ————-
4294967295                1          0     655724  Loopback Pseudo-Interface 1
  1500                1    4356437    1040016  Wireless Network Connection

C:\Users\anurag>netsh interface ipv4 show subinterfaces

   MTU  MediaSenseState   Bytes In  Bytes Out  Interface
——  —————  ———  ———  ————-
4294967295                1          0     674120  Loopback Pseudo-Interface 1
  1500                1    4484953    1146481  Wireless Network Connection

C:\Users\anurag>netsh interface ipv4 set subinterface “loopback pseudo-interface 1″ mtu=1273 store=persistent
Ok.

C:\Users\anurag>netsh interface ipv4 show subinterfaces

   MTU  MediaSenseState   Bytes In  Bytes Out  Interface
——  —————  ———  ———  ————-
  1273                1          0     680252  Loopback Pseudo-Interface 1 ->>>>> reset to 1273.
  1500                1    4741288    1440863  Wireless Network Connection

So resetting the MTU value to some value say 1273 or even 1500 was the solution and this way i could work from home following day.

Thanks to the forum otherwise i would have needed to ask IT to help me !

Hope anyone facing similar problem try this solution. 🙂

 

Advertisements
 

Shortcut icon problem in Windows7 and fix November 22, 2013

Filed under: Uncategorized — whoami @ 18:39
Tags: , ,

Shortcut icon problem in Windows7 and fix

Today, on my laptop with Windows7 found a weird problem.

I was trying to run any program. The windows7 asked on how/from which program to open it. I clicked wrongly ‘wireshark’ and forgot to uncheck the ‘Always use the selected program to open this kind of file‘ and suddenly all the shortcut and startmenu icons changed to of type ‘wireshark’. So my mozilla firefox icon was of wirehsark, notepad start menu icon was of type wireshark and so on…..When i tried opening mozilla firefox it couldn’t. This was a big headache for me. I Started trying many things by searching web what is the problem and solution but nothing helped. Some sight suggested to delete old iconcache.db and recreate it using explorer.exe, but it didn’t help.

After almost wasting 2-3 Hrs, finally raised IT case to my department.

But when i came to home, again started searching for any solution, since it’s Friday today and IT case will come into action on Monday. And yeah guess what , finally one of the web browsing resolved my issue 🙂

Here is the solution.

In the above line, 2nd part of solution helped me. It was a registry related program that i downloaded and ran and it may have modified registry to make everything working 🙂

Issue resolved before it could be read be read by IT guy. So Relaxed Now ( Since i was fearing this issue might lead to reinstalling windows and then reinstalling and reconfiguring many essential programs )

Thanks to Aibek ! who posted that solution.

Please be careful while selecting any program to open a file/program and check/uncheck to apply.

————————————————————–

Problem snaps

icon_problem

This was the real culprit – i forgot to uncheck it

culprit

 

Young programmer – Inspirational Video June 30, 2013

Filed under: Uncategorized — whoami @ 09:28
Tags: , , , ,

Source – Code.org

 

My misconception about Compound assignment operators in C,C++ March 18, 2013

Filed under: Uncategorized — whoami @ 09:41
Tags: , , ,

Today i got cleared of a very big misconception about Compound assignment operators.

I had wrongly understood statements like

A -=b+c as A=A-b+cBut correct is A -=b+c is same as A = A – (b+c)

More explanation can be find here

I have built this wrong concept because in elementary C books there was rarely mentioning of three variables for compound assignment operator examples. Like

The last example(bottom) below i never came through 😦

expression

evaluation

value += increase;

value = value + increase;

a -= 5;

a = a - 5;

a /= b;

a = a / b;

price *= units + 1;

price = price * (units + 1)

 

Check your pointer skills. January 4, 2013

Filed under: Uncategorized — whoami @ 11:47
Tags: , , , ,

Good Evening !!!

Explain the following :-

1. int (*(*foo)(void ))[3]

2.char *const argv[]

3. char * const *argv

4. void (*p[10]) (void (*)() )

Things that you might know well:-

1. const char*

2. char* const

3. const char* const

4. const *char ->tricky

5. char const * -> similar as one of the above(guess which one?)

🙂

 

Apn ( access point name ) in message compression – rfc 1035 ( explained in 3gpp 23.003 rel9) October 29, 2012

When we are getting APN name in message from UE( Mobile ), the buffer contains apn ( e.g. myoperator.com  ) encoded in format defined in rfc 1035 . 3GPP spec 23.003( rel9) explains about this rfc. To convert this encoded apn back to readable apn name( e.g. myoperator.com) , we need to write our own routine.

Example of the encoded APN explained in rfc 1035 [page 30]

For example, a datagram might need to use the domain names F.ISI.ARPA,
FOO.F.ISI.ARPA, ARPA, and the root.  Ignoring the other fields of the
message, these domain names might be represented as:

       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    20 |           1           |           F           |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    22 |           3           |           I           |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    24 |           S           |           I           |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    26 |           4           |           A           |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    28 |           R           |           P           |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    30 |           A           |           0           |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    40 |           3           |           F           |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    42 |           O           |           O           |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    44 | 1  1|                20                       |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    64 | 1  1|                26                       |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    92 |           0           |                       |
       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
The domain name for F.ISI.ARPA is shown at offset 20.  The domain name
FOO.F.ISI.ARPA is shown at offset 40; this definition uses a pointer to
concatenate a label for FOO to the previously defined F.ISI.ARPA.  The
domain name ARPA is defined at offset 64 using a pointer to the ARPA
component of the name F.ISI.ARPA at 20; note that this pointer relies on
ARPA being the last label in the string at 20.  The root domain name is 
defined by a single octet of zeros at 92; the root domain name has no
labels.
 

Power of 2 – check whether a given natural number is power of two September 21, 2012

Filed under: Uncategorized — whoami @ 10:10
Tags: ,

How will you check whether a given natural number is power of 2?

There may be many ways to check it, but i m posting a simple way:

PROCEDURE :

1. Perform “AND”(&) operation on the given natural number N and number N-1 i.e   N&(N-1)

2. If the result of the above operation is zero, then the given natural number is power of two,
 else the number is not power of 2.

3. end