Tuesday, March 26, 2019

Some useful commands came across while having fun



[Windows] Delete folders recursively 
  • rmdir /s [directory_name]

[Windows] Which ports being used by what apps, and vice versa
  • netstat -aon | findstr '[port_number]'
  • If the port is being used by any application, then that application’s detail will be shown with PID as the last column
  • tasklist | findstr '[PID]'. Replace the [PID] with above
  • Follow the inverse odder to track which application uses which ports too

[Windows] grep a file content. /N is for showing line numbers 
  • type test.txt | findstr /N "text you wanna search in test.txt"
  • npm list -g | grep express
  • curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost:3000/data 
  • curl -d "param1=value1&param2=value2" -X POST http://localhost:3000/data (POST application/x-www-form-urlencoded)
  • curl -d "@data.json" -X POST http://localhost:3000/data (with data file) 

[Mac] 
  • Removes all .git files/folders -> $ find . | grep .git | xargs rm -rf

Tuesday, March 1, 2016

How to Configure Eclipse workspace to debug PHP projects with XDebug?

Here is a very clean and comprehensive article describing in details of setting up your eclipse workspace with Debugging enabled for php projects.

http://www.thecodingmachine.com/setting-up-a-xdebug-debugging-environment-for-php-wamp-eclipse-pdt/

Happy Coding :-)

Wednesday, November 11, 2015

Some GIT commands


git stash show -p stash@{1}
Shows  the diff of the 2nd most recent local stash with the current version. -p is for the diff, without which it will only show the file names of changed files


$ git checkout -b [name_of_your_new_branch]
$ git push origin [name_of_your_new_branch]
Create a branch and checkout into the new branch

Sunday, March 10, 2013

Speech for Undergraduates on "Computer Engineering vs Industry" in UOP

The beauty of the moments which let yourself back to the past and let you recall what you had been in old good days is that it just make you revisit through all your connected dots (If I speak Steve Job's language) and come up with an amazing story-line molded just like the way you wanted to have. In 8th March, '13, I happened to have such an amazing moment (which was a challenge a bit) that I of course enjoyed every bit of it. That was about expressing the self with my road map, experience,  insights and thoughts as an industrial professional & as a former undergraduate, for a very young, energetic and enthusiastic audience of Engineering Undergraduates (of ~500), which was  nowhere but in University of Peradeniya, the sweet little old place I used to love a lot.

It was started with a very casual, informal, friendly start-up speech (I love doing this always, specially when I have the ownership of hosting; that simply makes the audience so comfy with a little more motivation for the interaction, and to keep the enthusiasm and momentum going, as the environment is more friendly) in the usual loud voice, with a little bit of introduction of myself through undergraduate life, industrial experience, expertise and the fact of who am I right now. 

Defining the terminology "Engineering", "Industry", "Undergraduate", and "Role of a computer Engineer" at Industry's perspective was to be the effective kickoff of the speech. 

Expressing different domains of Computer Engineering in the industry in very details, along with hands-on use cases that I myself had gone through on each domain for last 6 years, Major projects/companies in the world I had interacted in order to conduct them took the major part and it was followed by some decorative discussion points such as the actual role of a computer engineer in each domain who owes the technical leadership and what's the real deal of the undergraduates in being able to be ready for such great challenges, and the major IT companies in the country & the value/trust gained internationally via the quality of their optimum computer-engineering solutions for each domain, etc... The middle part of the speech was to be considered as the core of the keynote. That ended up with this amazing example of brain wave measuring embedded system that I happened to touch a little bit long time back. Had many good feed-backs on that to be able to suppose that it was a hit within the audience.

Thirdly, some head-ups on how the engineers can be special in the industry, what is the kind of "perfect" model of a computer engineer that the industry's dying to look for; what qualities/talents typically expected, how(and what are the main approaches I may recommend) to build up the engineering thinking pattern & skills at the undergraduate level; and then, the current status of the local/foreign industry for all domains in computer engineering, brought a smooth and complete entry toward the end of the speech.

Finally, I had this 18th (secret & serious) slide prepared  with a couple of great sayings of two inimitable legends that inspired a "lot" on my way to who I am right now; Michael Jordan and Steve Jobs to add an extra motivation to the audience mixed with my own experience via the two of my ever most favorite fields of interests; Computing and Basketball... which declared the closure of the speech at a peak.

The feedback of the speech has been amazing (so far, at least :D) and I still enjoy every moment when I recall it. That was a big-break for me; which on the other hand, renewed the my confidence on public speaking and keynoting.. I had almost forgotten that I was pretty much into speaking earlier, probably this can be a point I will start re-thinking of it all the way back :-)

This Facebook Album shows some live actions of it.

Tuesday, January 15, 2013

Notepad++ Regular Expressions - Find/Replace

It's been a quite a while that I wanted to have a full blog post on Regular expressoins to be used on Notepad++ that could immensly help when it comes to string manipulations; which coudln't be done due to lack of time to pay on it; But here it comes.

Following are some of the tips on primitives of the REs on Notepad++
  • [ ] : The square brackets can be used to match ONE of multiple characters. For instance, [abc] matches any of the characters a, b or c. Hence, b[eo]n will match words like ben and bon, but not been or beon. Ranges can also be used, [a-z] is any lower case character and so on.
  • ^ : The caret can be used inside the square brackets to exclude characters from the match. For instance, hell[^o] means the string ‘hell’ will be ignored if followed by the letter ‘o’. Another example is [^A-Za-z] which will exclude all alphabetic characters. However, if not placed inside a set, ^ can be used to matches the start of a line.
  • $ : This matches the end of a line.
  • . : The period or dot matches any character.
  • \d : Matches any single digit.
  • \w : Matches any single alphanumeric characters or underscore.
  • \s : Matches whitespaces including tabs and line breaks.
  • * : The asterisk or star sign matches 0 or more times. For example, Ba*m matches Bm , Bam , Baam etc.
  • + : The plus sign matches 1 or more times. For example, lo+l matches lol , lool , loool etc.
  • \< : Matches the start of a word. For example, \< directly followed by 'sh' matches 'she' but does not matches 'wish'.
  • \> : Matches the end of a word. For example, sh\> matches ‘wish’ and does not matches ‘she’.
  • ( ) : The round brackets can be used in the Find & Replace function to tag a match. tagged matches can then be used in replace with \1, \2 etc. For example, If you write 123xxxRRR in the search and 123\1HHH in the ‘Replace with’ filed, the result will be: 123xxxHHH.
  • \ : The backslash can be used to escape regex characters. For example to match 1+1=2, the correct regex is 1\+1=2. Otherwise, the plus sign will have a special meaning.
Hope these examples to be helpful in real time :
  1. Find: Win([0-9]+) Replace with: Windows\1 Will search for strings like Win2000, Win2003 and changes them to Windows2000, Windows2003
  2. Find: [a-z]+(\d\d)\> Replace with: Windows\1 Will search for all alphanumeric followed by 2 digits only at the end such as Win98 and Win07 and changes them to Windows98, Windows07
  3. Fiind : –USD([0-9]+) Replace wtih :  : USD\1 of Entrace Fee NCAA finals–USD200peradult will produce Entrace Fee NCAA finals : USD200 peradult 
Cheers

Thursday, April 19, 2012

Next-Gen Technologies for Product Innovation

Formation and successive-introduction of better products or improvising on the original to achieve more productive outcome through a well-managed process for a significant competitive advantage of the business growth could be simply termed as, product innovation. It is essentially supported by many ingredients in which the Next-Generation Technologies play a vital and direct-influencing role.

Defining an innovation process, maintaining its transparency, introducing more collaborative SE-process, research/migration with Next-Gen technologies/platforms, being compliant with latest social media trends etc… would be some ultimate challenges for a typical organization working on product innovations. It has been proved that the support of Next-Gen technologies makes a higher contribution for product innovation, not only in terms of making products more prolific and high in performance, but turning the whole chain very cost-effective at their development/maintenance etc..., hence, adding value for the product owners.

Technologies are being enhanced and expanded every moment having the fact that “how to re-innovate technologies to gain the best outcome from current products” is addressed. Cloud computing platforms, scripting based RAD stacks, platform independent software frameworks, context-aware mobile computing, Next-Gen web etc…, which maximize the performance and scalability are the latest hits in the arena that have provided positive solutions for the mentioned challenges. Thus, one of the major intentions behind all these Next-Gen technologies has been to innovate the next chain of product(s) with the absolute gain of advantages from the technologies or/and to power the process of product re-innovation to yield maximum possible than what is being gained currently, in every aspect.

Next-Gen social technologies, for example, have been the latest trend that could possibly be the next showground to drive product innovations as it is capable of producing social knowledge and intellect on demand. High usage of social media with intended business purposes, listening to social web for required social intelligence/capturing new ideas and social media injections/integrations are some of the proven means which are paving the way for sustainable product innovations within any context. The series of rich and incredibly supportive social media tools, on the other hand, have made the tale of social and product innovations much easier than ever before.

With this exponential competition…, don’t wait for the best future-technology to drive your current product innovations…, instead, go for the best innovation with the best technologies available today… that would certainly find the way to be the best among the Next-Gen technologies as well.

Every generation's breakthroughs are proven false by the next generation's technology.
~ DAN BROWN, “The Lost Symbol”

So does “Product Innovation”.

Dhammika Sriyananda

Friday, December 2, 2011

Birth of Youtube......

History of a world's largest video sharing portal... 

At early 2005, there they had a little dinner party, at the apartment in San Francisco and nobody ever thought that something huge is just about to happen... So later sometimes, for a guy who was there wanted to share a video clip which happened to be taken at that party with one of other friends who apparently was absent to the party-time, But unfortunately there were not much ("any" to be exact) such leads to get this done, hence.... the root thought to give the birth of this giant web processing application came out from the 3 PayPal employees who happened to owe the whole story above, namely  Chad Hurley, Steve Chen, and Jawed Karim. 

This is the very first video uploaded to the YouTube, happened to be uploaded at 8:27PM on Saturday April 23rd, 2005. The video was shot by Yakov Lapitsky at the San Diego Zoo and uploaded by Jawed Karim. The video goes with the quote of "Me at the zoo"...



Today, YouTube has been the world's 3rd most popular website,(Over 3 billion videos viewed/day) and 48 hours of video are uploaded every minute, resulting in nearly 8 years of content uploaded every day; Over 12 million people are connected and auto-sharing to at least one social network; and 150 years of YouTube video are watched every day on Facebook; in every minute more than 500 tweets contain YouTube links. 

It's huge, its growing every day, even in a faster rate we can ever think about.. the current stats of the most popular/liked and viewed videos can be found in here anytime.... 

Click here to view the current status of most popular/liked and viewed videos

Take home message : Do more parting... Parties you do today may lead to miracles... may not create charms today... may be in the party of Tomorrow...... Just dont stop... At the end of the time, you will... at least.. will have the joy... though nothing much came out of it... ;-)