Saturday, November 14, 2015

The SSI Story, wrapped in the X Factor anecdote !

This is an old one now ! I've probably got late to put it here, or maybe I would have never put it. The motivation suddenly pricks me from within while I prepare for my final presentation and viva for the MS project that I undertook on LTE-Advanced: Carrier Aggregation ! I am reminded of another presentation that I once made, of a product that I used to solely support and take care of, that I never cherished but could never hate :) There was a codeathon event last winters, and I had prepared a presentation on this product called 'System Services Interface', that did lie close to my heart to an extent, even though I used to dream of playing other games. I made this while I was home for a winter break, and the team presented it on the finale ! We did not stand 1st, but this one did evoke smiles on a lot of faces. And the team did roll on the floor laughing - for the X factor points !








                                          





Details later ! I have a viva tomorrow morning, and my presentation ain't ready yet. Blahhh !

Sunday, May 3, 2015

Globals were always a no-no-no !


While reviewing your code, your architect wouldn't perhaps allow you to use a global. Did you know the many reasons why ? Read on ! 

  • Non-locality -- Source code is easiest to understand when the scope of its individual elements are limited. Global variables can be read or modified by any part of the program, making it difficult to remember or reason about every possible use.
  • No Access Control or Constraint Checking -- A global variable can be get or set by any part of the program, and any rules regarding its use can be easily broken or forgotten. (In other words, get/set accessors are generally preferable over direct data access, and this is even more so for global data.) By extension, the lack of access control greatly hinders achieving security in situations where you may wish to run untrusted code (such as working with 3rd party plugins).
  • Implicit coupling -- A program with many global variables often has tight couplings between some of those variables, and couplings between variables and functions. Grouping coupled items into cohesive units usually leads to better programs.
  • Concurrency issues -- if globals can be accessed by multiple threads of execution, synchronization is necessary (and too-often neglected). When dynamically linking modules with globals, the composed system might not be thread-safe even if the two independent modules tested in dozens of different contexts were safe.
  • Namespace pollution -- Global names are available everywhere. You may unknowingly end up using a global when you think you are using a local (by misspelling or forgetting to declare the local) or vice versa. Also, if you ever have to link together modules that have the same global variable names, if you are lucky, you will get linking errors. If you are unlucky, the linker will simply treat all uses of the same name as the same object.
  • Memory allocation issues -- Some environments have memory allocation schemes that make allocation of globals tricky. This is especially true in languages where "constructors" have side-effects other than allocation (because, in that case, you can express unsafe situations where two globals mutually depend on one another). Also, when dynamically linking modules, it can be unclear whether different libraries have their own instances of globals or whether the globals are shared.
  • Testing and Confinement - source that utilizes globals is somewhat more difficult to test because one cannot readily set up a 'clean' environment between runs. More generally, source that utilizes global services of any sort (e.g. reading and writing files or databases) that aren't explicitly provided to that source is difficult to test for the same reason. For communicating systems, the ability to test system invariants may require running more than one 'copy' of a system simultaneously, which is greatly hindered by any use of shared services - including global memory - that are not provided for sharing as part of the test.

Saturday, January 4, 2014

MAC It Is !

Dear MAC, I feel elated to let you know I was able to keep my promise of working on you sometime. It wasn't easy getting here all the way, trust me.

After working on LG handsets for almost two years, getting back to LTE eNodeB stack itself meant a lot of brainstorming and recollecting old things. And then there were other stories midway, which ofcourse came with a bunch of meaningful and meaningless lessons :) Before I could start with MAC, there was SSI and there was PDCP and there was eNodeB application and there was S1AP and what not. But demanding to work in MAC repeatedly was worth.

It's been 5 months now I get to explore MAC and it seems to be never ending. Everyday it has a new revelation. Is it MAC or is it a Gospel? :D Almost Blank Subframes in LTE-Advanced MAC fell in my plate like a hot chocolate fudge. And then came Semi Persistent Scheduling. This seems to be a rollar coaster ride, which I so badly wanted to take once upon a time, not knowing much that it comes with a pinch of salt. Enormous reading needed and a long way to go.

So much to reason out, so much to implement. I definitely enjoy this much coveted domain of mine, with a second thought of knowing deep down in my mind, that I had to do a lot of other things too. Is it going to be technology in my basket for the rest of my days here? :)

Reminds me of what Portia tells Nerrisa in The Merchant of Venice:

If to do were as easy as to know what were good to
do, chapels had been churches and poor men's
cottages princes' palaces. It is a good divine that
follows his own instructions: I can easier teach
twenty what were good to be done, than be one of the
twenty to follow mine own teaching. The brain may
devise laws for the blood, but a hot temper leaps
o'er a cold decree: such a hare is madness the
youth, to skip o'er the meshes of good counsel the
cripple.

I'd better get back to MAC now, loads to understand !

Thursday, March 25, 2010

LG KP500


The affordable touch handset LG KP500 is getting a pet-name - the LG Cookie. Despite the perky name, the latest LG handset offers a modern feature set that seems pretty enough for the estimated price of 170 euro before taxes and subsidies.

Creating new budget touchscreen handsets seem to be on the minds of manufacturers these days. Samsung has been riding the wave with its Star Series handsets first, and now with its Corby Series of handsets. In response LG brought out the Cookie sometime ago, and now it was time for a much needed upgrade if LG had to stay in the game. So, after a very bland Mobile World Congress session in Barcelona, LG has finally got its act together and launched the Cookie Pep. The Cookie Pep in every way seems to be the handset to replace the older and outdated Cookie. This seems all the more true considering the pricing of the Cookie Pep, which is quite similar to the older Cookie. The Cookie Pep looks all set to take on the competition and has even signed up three Bollywood stars to promote it. The Cookie Pep is called the Cookie Pop in other countries where it comes with an optional solar panel doing its green thing for nature. Sadly though green doesn't seem to be the theme for LG in India and so we have the Pep, which is a rather standard version. Let's see how the Cookie Pep warms up to the competition.


You can easily spot the family relation to the LG Renoir in the design of the LG KP500 Cookie. The Cookie uses the latest reincarnation of the proprietary LG Flash-based UI, which now is even more interactive and user-friendly. The interface is still thumb-optimized, but a stylus tucked in the body also assists handwriting recognition.
The built-in accelerometer of the LG Cookie allows for even more fun - it adds a physical dimension to the gaming experience, there is auto screen rotation for images, video and documents and finally, there's the landscape onscreen QWERTY keypad.

The other fun stuff to use your accelerometer for is aligning your home screen widgest - just shake the phone and you're done.

The LG KP500 Cookie is only 11.9mm thick, which presumably makes it the thinnest phone around with a tucked in stylus. The LG Cookie sports a 3-inch TFT touchscreen display and a 3 megapixel fixed focus camera. It doesn't have 3G support, but you have EDGE and quad-band GSM at your disposal.
The LG KP500 is indeed going to have a really attractive price point as promised. We duly expect this baby in our office for a review spin.


http://www.in.lge.com/cookiepep/cookie_main.html

Saturday, March 20, 2010

LG GX500

The current model I'm working on ! Lets have a look at it..
LG Electronics turned out to be preparing for the release of LG GX500 mobile. It is a monoblock without keyboard with full touch-screen design, which is equipped with a 3.0-inch WQVGA-resolution TFT touchscreen display, resolution of which is 400×240 pixels.The peculiarity of the novelty is the support of two SIM cards simultaneously. Such devices in the market are still few, although their number is growing and manufacturers pay attention to this trend.


Mobile devices that can operate simultaneously with two SIM cards are popular in market.Returning to LG GX500, it is worth noting that it has a 3 megapixel camera, a slot for microSD memory cards up to 4 GB and capacious 1500 mAh lithium battery. The phone measures are 109×53x13 mm. Judging by the characteristics, the price of the device is unlikely to “go off-scale”, although such decisions are usually more expensive than traditional ones, with one SIM card.

Saturday, March 6, 2010

C-Faqs

When DOCSIS had ramped down, we got time enough to walk through this. Good one, enjoy reading !
http://c-faq.com/

Useful VIM commands

Basics
:e filename Open filename for edition
:w Save file
:q Exit Vim
:w! Exit Vim without saving


Search
/word Search word from top to bottom
?word Search word from bottom to top
/jo[ha]n Search john or joan
/\<> the Search the, theatre or then
/\<> Search the
/\< ¦.\> Search all words of 4 letters
/\/ Search fred but not alfred or frederick
/fred\joe Search fred or joe
/\<\d\d\d\d\> Search exactly 4 digits
/^\n\{3} Find 3 empty lines
:bufdo /searchstr/ Search in all open files

Replace
:%s/old/new/g Replace all occurences of old by new in file
:%s/old/new/gw Replace all occurences with confirmation
:2,35s/old/new/g Replace all occurences between lines 2 and 35
:5,$s/old/new/g Replace all occurences from line 5 to EOF
:%s/^/hello/g Replace the begining of each line by hello
:%s/$/Harry/g Replace the end of each line by Harry
:%s/onward/forward/gi Replace onward by forward, case unsensitive
:%s/ *$//g Delete all white spaces
:g/string/d Delete all lines containing string
:v/string/d Delete all lines containing which didn’t contain string
:s/Bill/Steve/ Replace the first occurence of Bill by Steve in current line
:s/Bill/Steve/g Replace Bill by Steve in current line
:%s/Bill/Steve/g Replace Bill by Steve in all the file
:%s/\r//g Delete DOS carriage returns (^M)
:%s/\r/\r/g Transform DOS carriage returns in returns
:%s#<[^>]\+>##g Delete HTML tags but keeps text
:%s/^\(.*\)\n\1$/\1/ Delete lines which appears twice
Ctrl+a Increment number under the cursor
Ctrl+x Decrement number under cursor
ggVGg? Change text to Rot13

Case
Vu Lowercase line
VU Uppercase line
g~~ Invert case
vEU Switch word to uppercase
vE~ Modify word case
ggguG Set all text to lowercase
:set ignorecase Ignore case in searches
:set smartcase Ignore case in searches excepted if an uppercase letter is used
:%s/\<./\u&/g Sets first letter of each word to uppercase
:%s/\<./\l&/g Sets first letter of each word to lowercase
:%s/.*/\u& Sets first letter of each line to uppercase
:%s/.*/\l& Sets first letter of each line to lowercase

Read/Write files

:1,10 w outfile Saves lines 1 to 10 in outfile
:1,10 w >> outfile Appends lines 1 to 10 to outfile
:r infile Insert the content of infile
:23r infile Insert the content of infile under line 23

File explorer
:e . Open integrated file explorer
:Sex Split window and open integrated file explorer
:browse e Graphical file explorer
:ls List buffers
:cd .. Move to parent directory
:args List files
:args *.php Open file list
:grep expression *.php Returns a list of .php files contening expression
gf Open file name under cursor

Interact with Unix
:!pwd Execute the pwd unix command, then returns to Vi
!!pwd Execute the pwd unix command and insert output in file
:sh Temporary returns to Unix
$exit Returns to Vi

Alignment
:%!fmt Align all lines
!}fmt Align all lines at the current position
5!!fmt Align the next 5 lines

Tabs
:tabnew Creates a new tab
gt Show next tab
:tabfirst Show first tab
:tablast Show last tab
:tabm n(position) Rearrange tabs
:tabdo %s/foo/bar/g Execute a command in all tabs
:tab ball Puts all open files in tabs

Window spliting
:e filename Edit filename in current window
:split filename Split the window and open filename
ctrl-w up arrow Puts cursor in top window
ctrl-w ctrl-w Puts cursor in next window
ctrl-w_ Maximise current window
ctrl-w= Gives the same size to all windows
10 ctrl-w+ Add 10 lines to current window
:vsplit file Split window vertically
:sview file Same as :split in readonly mode
:hide Close current window
:­nly Close all windows, excepted current
:b 2 Open #2 in this window

Auto-completion
Ctrl+n Ctrl+p (in insert mode) Complete word
Ctrl+x Ctrl+l Complete line
:set dictionary=dict Define dict as a dictionnary
Ctrl+x Ctrl+k Complete with dictionnary

Marks
mk Marks current position as k
˜k Moves cursor to mark k
d™k Delete all until mark k

Abbreviations
:ab mail mail@provider.org
Define mail as abbreviation of mail@provider.org

Text indent
:set autoindent Turn on auto-indent
:set smartindent Turn on intelligent auto-indent
:set shiftwidth=4 Defines 4 spaces as indent size
ctrl-t, ctrl-d Indent/un-indent in insert mode
>> Indent
<< Un-indent

Syntax highlighting
:syntax on Turn on syntax highlighting
:syntax off Turn off syntax highlighting
:set syntax=perl Force syntax highlighting