Prabhu Sunderaraman

Fullstack Engineer, Programmer, Writer, Trainer

prabhu.bits@gmail.com,     GitHub     Youtube     LinkedIn
  • Home
  • Profile
  • Books
  • Reading List
Browsing: / Home
Shortlink

HealthyCode

By Prabhu Sunderaraman on January 1, 2014 in HealthyCodeMagazine

Yes you read it right!!! It’s HealthyCode.
Our company is launching a monthly magazine called HealthyCode targeting the developer community.
The magazine will have articles on programming and development by popular writers, bloggers and passionate developers and programmers.

Have an eye on this space for more information about it.

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Scary Newsletter about Spring 4.0

By Prabhu Sunderaraman on December 16, 2013 in Spring

I woke up today morning with a mail alert from my tablet. Opened it only to see a newsletter from Spring source about the arrival of Spring Framework 4.0 next month.

My Spring 3.0 book cover page flashed my mind and when I thought about the 500 odd pages in the book, I went back to sleep again. :(

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Find Max – Scala Style

By Prabhu Sunderaraman on December 16, 2013 in Scala

Functional fever is driving me crazy. I have been trying to write/convert every piece of code to a functional style. For the last couple of weeks, I have been writing tons of code in Scala using pattern matching. In a flight some time back, when I was looking at some C code of calculating the largest number in a given array recursively, I started jotting down Scala equivalent of the same using Pattern Matching. And here’s what I scribbled.

def findMax(lst:List[Int]):Int = {
  lst match{
    case x::Nil => x
    case x::tail => {
       if(x < tail(0))
         findMax(tail)
       else
         findMax(x::tail.tail)
    }
 }
}
println(findMax(List(1111,23,4,5,74,6,578,8,9)))

After the flight, came home and showed the code to my Java developer friend, who looked at it and said it flew over his head. I felt extremely happy about it!!! :) ;). I also told him that there’s lot of code like that in my Git repo, only to make him run away.

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Publisher/Subscriber pattern in vanilla JavaScript

By Prabhu Sunderaraman on December 9, 2013 in JavaScript

I was discussing OpenAjax Hub which is an implementation of the publisher-subscriber pattern last week with my client. In the process, decided to quickly hand-toss my own implementation of the pattern.

Here’s an example where there’is a textbox and a button. When the user enters a value in the textbox and hits the button, the value is published to a list of subscribers. The subscribers are pre-registered with the button.

<html>
  <head>
    <script>
      var Bus = function(){
    	  var subscribers = [];
	  this.publish = function(eventName,arg){
		var handlers = subscribers[eventName];
		for(var i=0;i<handlers.length;i++){
			handlers[i](arg);
		}	
	}
	this.subscribe = function(eventName,handler){
		if(!subscribers[eventName])
			subscribers[eventName] = [];
		subscribers[eventName].push(handler);		
	}
     };
     var messageBus = new Bus();
     
     function init(){
	messageBus.subscribe("btnclick",handler1);
	messageBus.subscribe("btnclick",handler2);
    }
    function doSomething(){
	messageBus.publish("btnclick",document.getElementById("nametext").value);
    }
    function handler1(arg){
	document.getElementById("spn1").innerHTML = "<b>" + arg + "</b>";
    }
    function handler2(arg){
	document.getElementById("spn2").innerHTML = "<i>" + arg + "</i>";
    }
</script>
</head>
<body onload="init();">
	Name <input type="text" id="nametext"><input type="button" value="Do" onclick="doSomething()"><br/>
	<span id="spn1"></span><br/>
	<span id="spn2"></span><br/>
</body>
</html>

The code has a Bus class with publish/subscribe methods. The subscribe() method adds the handler functions to a collection and publish() method invokes the handlers.

Share this on: Mixx Delicious Digg Facebook Twitter
Shortlink

Sencha Architect 3

By Prabhu Sunderaraman on December 2, 2013 in Sencha Touch

I found some time last week to play with Sencha Architect 3. Two things that immediately caught my attention are Theming and IntelliSense.

Gone are those days when you had to work with Sencha Cmd to create custom themes, create SCSS files and change the CSS vars by referring to the API documentation. Against every component that you create, there’s a table that contains a list of CSS vars that can be changed right away in Sencha Architect 3. It makes life easier for customizing themes.

The Intellisense support while writing our code is a welcome addition and makes it easier to key-in.

I’m beginning to like this IDE.

Share this on: Mixx Delicious Digg Facebook Twitter
« Previous 1 … 32 33 34 … 64 Next »

Youtube Channel




Categories

  • JavaScript (48)
    • RequireJS (5)
  • Go (44)
  • Golang (44)
  • Ext JS (23)
  • Spring (22)
  • Mobile (21)
  • Scala (20)
    • Play (3)
  • Uncategorized (19)
  • Video Sessions (18)
  • GoG (17)
  • Sencha Touch (16)
  • jQuery (14)
  • Languages (13)
  • Java 8 (12)
  • React JS (11)
  • Kotlin (11)
  • HealthyCodeMagazine (9)
  • Video (9)
  • Objective-C (8)
  • NoSQL (8)
  • Android (7)
  • MongoDB (7)
  • GWT (6)
  • Tools (6)
  • HTML 5 (5)
  • Cloud (5)
  • General (5)
  • Micro services (5)
  • Java (5)
  • Books (4)
  • AWS (4)
  • Software Architecture (4)
  • .NET (3)
  • Elixir (3)
  • Docker (3)
  • Reactive (3)
  • NodeJS (2)
  • RoR (2)
  • Backbone (1)
  • AngularJS (1)

Archives

  • 2020 (49)
  • 2019 (7)
  • 2018 (34)
  • 2017 (15)
  • 2016 (7)
  • 2015 (18)
  • 2014 (31)
  • 2013 (55)
  • 2012 (100)

Search

Subscribe




Copyright © 2025 Prabhu Sunderaraman.

Powered by WordPress and News.