Can You Really Trust A Framework ?

If you are a PHP developer you will probably be pushed by everybody to learn how to use a framework to develop your application. But nobody tells you in a clear way what you’re going to obtain doing this. For every developer who is in this phase of personal growth, this choice is never easy and the main reason is the fear of being conditionated by this link in a bad way. In the journey…

"Can You Really Trust A Framework ?"

Restoring Ubuntu (or any distro) Grub Bootloader After Windows Install

If your install of Linux is a dual boot setup with windows you have run into this problem before. You reinstall windows and suddenly you can no longer access your Linux partition or the Grub bootloader. You can always go through the entire install of Ubuntu again, or you can try to repair the bootload, but how do you repair the bootloader? Here we look for the way to restore grub after windows install. Well…

"Restoring Ubuntu (or any distro) Grub Bootloader After Windows Install"

A Simple Core Data Introduction

This guide assumes you are using Xcode 4 Core data is the feature of Cocoa that makes it the best tool for developing applications for the macintosh. It’s what makes Cocoa a better choice for developing full, feature rich applications than Java or Ruby (not that they’re bad languages) for the mac. The simple reason for this is it allows you to develop amazingly complicated applications in precisely 0lines of code. Even then, you can…

"A Simple Core Data Introduction"

Intro to Cocoa Bindings (As well as Key Value Coding)

Bindings are an incredibly useful feature of Cocoa. Cocoa bindings were introduced in Mac OS 10.3 allowing developers to create incredibly complex applications in very few lines of code and, as a result, eliminate many bugs from their software that would normally arise from the sheer mass of code a developer would normally have to write. Whilst learning Cocoa, bindings aren’t a necessary thing to learn about and many budding developers will skip over bindings…

"Intro to Cocoa Bindings (As well as Key Value Coding)"

Passing Arguments By Address In C++

For reference, I shall now refer to pass by address as PSA Let’s just get something out-of-the-way. Passing a parameter by address involves using pointers. Yes, those horrible little things that you hated/hate whilst you learnt/are learning C, C++. The idea of pointers is hard to understand and the most common thing novices will say is “Why learn pointers?” Well, this is one of those reasons to learn them. PBA relies completely on pointers and…

"Passing Arguments By Address In C++"

PostgreSQL ORM

PostgreSQL-ORM is an Object Relational Mapper (ORM) that complements Simple. It knows how to map high-level operations to PostgreSQL flavored SQL for Haskell types that are instances of the Model type-class, as well as perform join operations on associations between Model instances. Declaration Creating a Model in Haskell is easy. We simply declare a datatype using record syntax, include a field of type DBKey to hold the primary key and let Haskell Generics do the rest:…

"PostgreSQL ORM"

Getting Started Tutorial: Simple Basic Web Application

This getting started tutorial will get you up and running with a basic web application. At the end you will know how install Simple how to create a Simple application from scratch the structure of a Simple application how to add persistence with PostgreSQL. Guide Assumptions This guide assumes you have a working version of the GHC Haskell compiler, the cabal package manager and an up-to-date version of the PostgreSQL database. The best way to…

"Getting Started Tutorial: Simple Basic Web Application"

Simple Templates

Simple comes with support for the embedded templating language defined in the package simple-templates. Templates let you embed dynamic content in HTML, JSON or any other text format you return in your responses. Using with a Simple app Adding template support in your app is as easy as declaring an instance ofHasTemplates for your app settings:

HasTemplates has default definitions for all of its methods. However, in most cases you’ll probably want to override…

"Simple Templates"

The smpl Command-line Utility

Simple ships with a command-line utility, smpl, that helps bootstrap applications as well as run then in development mode. Synopsis

Global Options

Creating an application

Creates a new Simple application in the directory app_name. The Haskell module for the new application is the CamelCase derivation of app_name. For example, an app with the name test_app would be created with the module nameTestApp. By default, only minimal functionality is included in generated apps.…

"The smpl Command-line Utility"

What is a Kernel? – Explained

Hello, readers. After spending some time around Android or Linux forums or discussions, you must have come across the term “Kernel”. A kernel is not a unique part of Android or Linux OS but it is a very important part of every operating system including Windows, Mac OS, iOS, Blackberry’s QNX, Symbian, etc. Most of the people even some programmers/developers misunderstands kernel and operating system to be one and the same thing. So, What is a…

"What is a Kernel? – Explained"

Exchange Database Corruption Issue in Microsoft Exchange Server

Handling corruption in an Exchange server mailbox database is the worst nightmare for any Exchange administrator. In the event of Exchange database corruption, the Exchange services fail to start and all the business comes to a standstill. In such circumstances, the first step should be to identify the corrupt file. If the pub.edb file is corrupt, all data present in the public folders on the Exchange Server would become inaccessible. These folders are often replicated…

"Exchange Database Corruption Issue in Microsoft Exchange Server"

Visual Studio and the Entity Framework Diagram – Scaffolding Progress

Been a hectic first two weeks on the job! Seven days in, we have agreement on our first set of entities – and have seeded it with data and some sprocs to generate manufacturing work orders and assembly history. Now comes the fun part – the UI! Big challenge here – we are under extreme pressure to deliver in a short time frame a fairly smooth and intuitive UI. Since I work on a manufacturing…

"Visual Studio and the Entity Framework Diagram – Scaffolding Progress"

Installing a Windows Server 2012 Virtual Machine Windows 8 VMware Workstation

Here today we are looking to install Windows Server 2012 as virtual machine in VMware workstation I have a Windows 8 machine that’s great for browsing. Unfortunately, for anything serious development-related – not so much. (There’s that annoying lack of Local Users and Groups, for example, which crippled my BT2013 install.) First make sure you have Oracle’s VirtualBox set up. This is really quite painless and a very light install (as distrustful as I am of…

"Installing a Windows Server 2012 Virtual Machine Windows 8 VMware Workstation"

Born to Becoming A Great Programmer

Had someone recently ask me about programming and whether it would make a good career for her. I took a few minutes and put down my thoughts. I think the following are good thoughts for people interested in building a career in programming – be in the Microsoft stack or other areas:   Build your own identity and get social: I do think you have to build your own brand as a developer separate from…

"Born to Becoming A Great Programmer"

ASP.NET Ajax Control Toolkit

I’m embarrassed to say, I hadn’t visited the AJAX control toolkit suite for a while… with the advent of MVC and the abolition of Postbacks/session state (or so I thought), I was putting all that stuff in my rear view mirror. But, suffice to say, there are still times when you’re going to be using WebForms. So, here’s some of my favorite controls from this suite – and why: Accordion – panels collapse/expand. Animation –…

"ASP.NET Ajax Control Toolkit"

Merging tables with “Union” and “Union All”

I’m going to write about SQL Unions. This is a really handy function that lets you join 2 or more tables into one big “uber-table”. The syntax is quite simple. It’s either Union or Union All.  You would use these functions if you needed to join two (or more) tables that were the same structure but in completely separate databases. This is common in companies split into several businesses. The accounts or business package to…

"Merging tables with “Union” and “Union All”"

The Basic Principles of Select Queries

I am writing this update from outdoors, enjoying a glorious spring day on a beautiful terrace in Rome. This is about the basic principles of select queries. Incidentally I will be using the “AdventureWorks” database, which is a demonstration database provided by Microsoft. You can download the install file from here Probably the largest portion of my future updates will be using functions in select queries, so it’s worth covering that now and getting this…

"The Basic Principles of Select Queries"

Clear The Active Worksheet With a Click of a Button

Many times when we are working on a modelling problem using Microsoft Excel, we might be required to clear the sheet contents. For example, you are just starting out to solve a problem and need to clear the cells without deleting the whole sheet. Personally, I don’t prefer wasting time on taking my hands to the mouse and then press clear contents. A better option is to write use some already written VBA macro which…

"Clear The Active Worksheet With a Click of a Button"

How To Generate Pascal Triangle Variant Using VBA

In this tutorial, I will show a similar kind of trick to generate a variant of Pascal Triangle which seems to be a mix of forward and backward triangles. I am going to show how the output will look like. VBA CODE

PITFALLS OF THIS CODE This code works perfectly for all numbers which are odd.For example, when you click the Generate Triangle button in the excel workbook provided with this tutorial, you should…

"How To Generate Pascal Triangle Variant Using VBA"

Analytics Using MATLAB and Octave-Free Learning Series– Introduction & Basic Functions

MATLAB stands for MATrix LABoratory. It was designed to make matrix manipulation easy for scientific computations.According to Mathworks website,MATLAB is the high level interactive programming environment used by Millions of scientists, engineers, analytics professionals worldwide. Learning Octave & MATLAB are the best available tools for prototyping the algorithms of machine learning. This is what widely followed in Silicon valley as well. A lot of companies which work on artificial intelligence or machine learning algorithms first try…

"Analytics Using MATLAB and Octave-Free Learning Series– Introduction & Basic Functions"

How to Find Sum of all Primes below a Number

In this post I have written a program in Python which tries to find out the sum of all prime numbers below a number. I have implemented the solution in Python. This problem was originally posted on Project Euler and it asked to find the sum of all prime numbers below two Million. Seems exciting, right? Recently I have been experimenting with various problems related to prime numbers and trying to implement in Python. I…

"How to Find Sum of all Primes below a Number"

9 Best Programming Languages To Learn

Have you ever wondered how the apps you play in your smartphones work and how are they created? Ever thought how people create such amazing websites. I am sure that you must have given a thought about it at least once. Well the credit of all such applications goes to programming languages. But one gets confused on how to get started with these applications. Well if you are also are confused then this is the…

"9 Best Programming Languages To Learn"

Food Delivery System Project in C++

Structure of the Problem Requirements In this project we will implement the code of food delivery system in C++. The project consist of three modules , admin module, customer service module and user module. The admin module deal with Item’s prices, goods stock, food menu , and membership functions.  The Customer module deal with customer records functions and the user module deal with customers. In User module customer can signup sign-in and sign out. Here…

"Food Delivery System Project in C++"

5 Signs of Great Programmers

Great Programmers are also human like us but they have some special habits and rules in their life and the strictly follow them. Confidence and persistence make you great and the great programmers know it very well. Indeed programming is a thing which need your lots of concentration and energy but if you have confidence, sequence and passion to do it then definitely you will enjoy it a lot . According to my opinion if…

"5 Signs of Great Programmers"

Codewars Review for Gaining Code Experience

Since I had last posted about Codewars I have been spending more time trying out the challenges, and I realize now how valuable it is a tool to develop your coding skills. The last challenge I did required for me to create a function that would evaluate value x and return certain words based on whether the number is divisible by 3, 5, 3 and 5, or neither. I knew how to evaluate whether a…

"Codewars Review for Gaining Code Experience"

Star Wars’ hour of Javascript

I find a lot of coding learning devices that are mostly geared towards children. I am critical for most of these kinds of apps or tools because it does little for anyone that isn’t more than just a beginner. Although they are quite good at teaching programming logic, they are not going to help you learn how to write code itself. For myself and others it is most helpful to be physically typing code to…

"Star Wars’ hour of Javascript"

Writing, building, and running your C++ on a Mac

The very first wall that I had hit when I was looking for a C++ tutorial was that I struggled finding one that was OS X friendly. Most of the tutorials that I had found started out with installing software onto your PC and then explaining it based on how that program ran. I only have my iMac and Macbook right now (although the Macbook can run Ubuntu as well!), so finding something that would…

"Writing, building, and running your C++ on a Mac"

Recommending a C++ beginner’s tutorial

I struggled for a short while at first when I was trying to find a C++ tutorial that I liked, but I did and I’ve been using it for the past few days! This tutorial is at BeginnersCPP.com and it holds a pretty extensive collection of video tutorials that are suitable for beginners to the C++ language. I’m not sure if I would say that they would be right for beginners to coding in general,…

"Recommending a C++ beginner’s tutorial"

Programming in C++

I’ve made it far enough in my the BeginnersCPP.com tutorials that I was able to tackle the first of their code challenges! The goal was to write a program that could determine whether or not a number was a prime number. I did have to look up how to determine whether there would be remainders when dividing, but it turns out that was very similar to Python! This is what I came up with:

"Programming in C++"

Learn Python the Hard Way Course Review: Struggling with lists and arrays

I haven’t had a chance to post quite as frequently lately, mostly due to work or social obligations. Otherwise I have been pushing my way through the Learn Python the Hard Way course, but I’ve found myself struggling with the code in a way that I wasn’t before. I’m up to the point where we are discussing lists and arrays, and it has just been very technical and a little difficult to grasp. I’m determined…

"Learn Python the Hard Way Course Review: Struggling with lists and arrays"

Lrn app for on-the-go Review

I might be on the road this Thanksgiving but I won’t let that be an excuse to not continue to learn something new. I’ve had the Lrn app downloaded to my iPhone for a while now and decided to use this trip as a chance to try it out.   The app has options to learn a number of languages: HTML, CSS, JavaScript, Python, and Ruby. After you pick a language the lessons are separated into…

"Lrn app for on-the-go Review"

FreeCodeCamp.com Review

Now that I’m back home after a few days away, I’m back to trying and reporting on something new. After seeing a tweet about it recently I became curious about FreeCodeCamp.com. I’ve spent about an hour on there already going through their HTML 5 and CSS tutorial and liking it a lot so far. The website is made up of a large collection of short coding exercises that start with the basics and become more…

"FreeCodeCamp.com Review"

Differences between Depth-First-Search and Breadth-First Search

1. In General: The key difference between depth first search and breadth first search is the the order of visiting each nodes in a graph. In breadth first search, we start at a node, called root, visiting its all immediate neighbors before moving to another node. After moving to another node, we also trying ti discover all of its neighbors and so on. In other words, we are trying to go as WIDE as possible.…

"Differences between Depth-First-Search and Breadth-First Search"

Cache Long in Java

1. Compare two Java Strings In Java, if you want to compare two String, you know you should use equals instead of ==. To be more specific, here is the normal code to compare two String:

2. Compare two Long Long class is a wrappers of the primitive type long. The Long class contains a field long which is the value of a Long object and provides user with method to convert a Long…

"Cache Long in Java"

Make HTTP request using Java and Curl

Last week I was asked to make some tools that talked to a Rails app. Let say you have a Rails app that has a scaffold name Product and resides on www.your_app.com . If you want to create a new Product, you go to www.your_app.com/products/new, fill in the form in there, including typing in some information product name, choosing a photo to upload and finally hit Create. A new Product will be created. Now how…

"Make HTTP request using Java and Curl"

Java Unsupported Major Minor version 51 ERROR

I remember getting this error while running some Java.

Because it is annoying, let’s take a look at this. What does this error mean? It turns out to be an issue of version incompatibility. First of all, if you don’t know, here is some background on how Java is run. 1. The Java source code (the .java file) is compiled. This step generates a .class file with the same prefix as the .java. In…

"Java Unsupported Major Minor version 51 ERROR"

Git Undo a Commit after pushing it to a remote repository

Git Undo Commit Yesterday I made a mistake by git pushing a bad commit to a remote repository. Without going into details of how bad that commit was (or how bad I was), I want to present the situation focusing on git and how it can be fixed. 1. What is that mistake aka what did I do wrong? Here is the situation. I have a remote repository name heroku I make git commit -m…

"Git Undo a Commit after pushing it to a remote repository"

Rails: Replace a hand made authentication system with Devise

Yesterday I decided to replace a hand made authentication system with Devise: 1. What was the situation: I had a Rails app used SQL database and already had a hand made authentication system with the scaffold User and all the helper methods, the routing configuration … I wanted to replace it with Devise in order to be able to use all the features provided by it. 2. What to do: First of all, I wanted…

"Rails: Replace a hand made authentication system with Devise"

Why Women Don’t Do Programming?

Being a Programmer, the most confusing statement I hear is ” why are women not programmers”? Indeed women are very hard workers, sincere with their tasks, and get high grades in exams but still their existence in Programming and in field work is very low. There are many factors behind this and we try to discuss all these points with details and share the opinion of psycholinguists about it. The idea behind this article is…

"Why Women Don’t Do Programming?"

Compare Best Java HTML Parser Library

Today we will take a review to compare the Best HTML Parser Library. HTML Parsers dwells on the area where there is no standard operating conditions. There is no standard protocol to interact with web other than plain HTTP(S) protocol. And the HTML on the web is not strictly following fullest structure of the HTML format. Web browsers are very adaptive to incorrect or inappropriate HTML format. This makes life difficult for anyone who wants…

"Compare Best Java HTML Parser Library"

How to setup FTP Server Ubuntu 14.04

How to Setup FTP Server Ubuntu 14.04 I was following a tutorial to set this up on an AWS server and kept getting the same error: “Server sent passive reply with unroutable address. Using server address instead. Failed to retrieve directory listing.” I learned that FTP uses not only port 21, but another which is configured in your vsftpd.conf file. Here’s how to setup FTP Server Ubuntu 14.04. Install VSFTPD sudo apt-get update sudo apt-get install…

"How to setup FTP Server Ubuntu 14.04"

How to add alias commands in Ubuntu

How to… Use aliases for commands in Ubuntu I sometimes get tired of typing long commands over and over (for example, to install packages from apt-get) so I looked up how to create aliases (shortcut commands).  If you could type something like “gimme” instead of “sudo apt-get install” it can make life so much sweeter!  This was done using Ubuntu 14.04. Open .bashrc file for edit sudo vi ~/etc/.bashrc Add the following line: alias yourCommand=’oldCommand’ Eg.…

"How to add alias commands in Ubuntu"

Administering Multi Tenent MySQL Installations

Problem When we have many MySQL installation in same hardware and many MySQL instances running from different base directories,Administration can get into messy ebecause we need to remember each instance’s base directory, port, socket, data directory, error log file etc. ofcource DBA can maintain this information in a spreadsheet and copy / paste. it works if you have only few databases to manage. and things can get even messy if you are not regularly updating…

"Administering Multi Tenent MySQL Installations"

How to Repair Linux Boot Loader after Windows Installation

Gone are those days where dual booting required required understanding of chain loaders. even today XOSL worth mentioning. it got lots of features – i would say most feature rich boot loader i ever seen. nowadays GRUB2 is decent enough to dual boot Linux and windows and very intuitive enough for a layman. Oh Windows Overwrites MBR and Linux is gone! Windows versions i ever used, never given respect to other operating system residing in…

"How to Repair Linux Boot Loader after Windows Installation"

Python and MySQL : Setup without root privilege and without installing rpms

This article deals with How to setup Python-Mysql connectivity using MySQLdb libaray without root privilege and without installing any rpms. but extracting binary files from rpm to any custom location. This may be helpful if you are not having root privilege or couldn’t get RPMs installed because of some other reasons. Important Points There are important points which we need to remember for better understanding. 1. RPM is a compressed zip file which contains binary…

"Python and MySQL : Setup without root privilege and without installing rpms"

Sololearn for On the Go Code Practice Review

Like some others, learning how to code is something that I’m doing while also working full time doing something else. I like to be able to be practicing at any opportunity that I get, but for a long time I wasn’t really able to find what I had wanted in a mobile learning platform. A lot of apps about learning to program and learning programming logic generally are geared towards children, and I would like…

"Sololearn for On the Go Code Practice Review"

Java Tutorial – Variables

You’re probably reading this post because you want to know how to work with variables in Java. Or maybe you’re just curious. Well, you’ve come to the right place (or post if you will, hehe.) You should know the following to be able to understand this tutorial: The class template/structure What classes are How to use an IDE How to write I’ll talk about variables first. What is a variable? In simple terms, a variable…

"Java Tutorial – Variables"

Php Online Tutorial for Beginners

This post will cover the basics of PHP in this PHP Online Tutorial for Beginners and I will go into great detail about everything that I talk about. Let’s start out by finding out… What Is PHP ? PHP is short for PHP: Hypertext Preprocessor. This is called a recursive acronym. (Wikipedia) PHP is a very powerful programming language used all over the world. It can be used to create dynamic web pages. What is a…

"Php Online Tutorial for Beginners"

Loops in Java

Often times as a programmer, you’ll encounter situations where you’ll need to use loops – it’s inevitable! So learning how to use loops in Java as fast as possible is a good idea! Why use loops? Well, this is pretty self-explanatory. If you want a specific set of instructions to execute for a specific number of times or for all of eternity, you’ve got the reason right there! You use loops in java when you…

"Loops in Java"

Learning How to Program : Tips on Getting Motivated

Hello there! This post isn’t about babbling about why you should program, how easy or hard it is, etc. I can assure you that you are in the right place when learning how to program. If you are kind of unmotivated because learning how to program seems so out of reach, read on! Here’s 7 tips to keep in mind when you are going to start learning how to program. #1 – Pace the learning…

"Learning How to Program : Tips on Getting Motivated"

How To Use JSoup

“jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods” – JSoup.org Like in the description above provided by JSoup’s website, the JSoup library serves as a great tool when you want to extract and manipulate HTML data on a webpage. This blog post will go into depth about the basics of the API, as well as…

"How To Use JSoup"

Change Default Leopard Kava JDK 1.5 to 1.6 – Easy Way

The first go around with this I had a hell of a time. Most posts said to change default jdk in java preference app but that didn’t work and changing symbilic links in java home showed correct 1.6 version when running “java -version” in terminal but my java app (in this case the wonderful open source coldfsuion engine Railo) was still reporting 1.5 jdk. Anyways…. I’ll cut to it and here’s the steps. Open up …

"Change Default Leopard Kava JDK 1.5 to 1.6 – Easy Way"

Coldfusion and Coda – Adding contextual menu scripts

I love Coda, while not a heavy duty coding app with all the “serious” tools, it is just right.. it just is. But one itsy bitsy teeny weenie thing has always driven me nuts and that is I always want too click a block of code and right-click and wrap it with cf comments, same thing with cssedit UGGGGGGGGGG it drives me nuts!!!!!! Yesterday I downloaded a few of the Coda scripts that are out…

"Coldfusion and Coda – Adding contextual menu scripts"

JQuery – Getting a Latitude & Longitude from address

I had a client realize today that their dealer search by radius function wasn’t working anymore so I dug in to find out why. The cause turns out to be the service we were using to geocode was no longer functioning which is rational since it was sevceral years old and before yahoo or google was offering geocoding. Basically they need the dealers address and latitude and longitude to be added to the database so…

"JQuery – Getting a Latitude & Longitude from address"

Recover deleted files with Ubuntu 10.04 Desktop

I’ve accidentally removed an important file from my HDD; this is not so awful, but it is very annoying to search in my USB key the information I need to remake this file. So, for this kind of troubles, you can try a recovery tool! This kind of magic software tries to recover the deleted files. Obviously, don’t expect to recover the file in minutes… you need some time, it depends on the size of…

"Recover deleted files with Ubuntu 10.04 Desktop"

Metaprogramming as a tool for refactoring Ruby on Rails controllers

Once you learn about metaprogramming in Ruby on rails you probably want to use it all the time. Once I learned about it, I went looking for places in my code to use it. Here is a simple example of a controller that is in need of some love. This is a controller for a blog or a news site. A few methods have been added which get the top, latest and trending articles respectively.…

"Metaprogramming as a tool for refactoring Ruby on Rails controllers"

Learn Android: Hello World App – Making it Personal

Last tutorial focussed on setting up Android Development Tools (ADT) and getting a simple Hello World application running on an Android Virtual Device. This time we will look at how the Hello World App works by looking at the layouts and some code. We will learn about Activities, what they are for and how we can get them talking to each other to make more than one screen in the application. We will look at…

"Learn Android: Hello World App – Making it Personal"

Learn Android: Setting up in Android Development

If you have an Android phone, or even if you haven’t, getting set up for Android development is a rewarding experience and can teach you lots about Java and is an excellent choice for getting your teeth into learning how to program.  One of the biggest frustrations for those new to programming is that whilst you get to learn lots of new concepts and learn to apply logic to problems, the display of your hard…

"Learn Android: Setting up in Android Development"

Source Code Control Advantages and Uses

In this post, I’m going to cover the reasons why you should use source control, its advantages, and why if you’re using source control that you should consider Git over other options available out there.  I’m not going to cover how you actually use Git or how to set it up as this is a whole separate blog on its own, but the first step in source control is understanding what it’s for and how…

"Source Code Control Advantages and Uses"

Google Place API for Android to Find City

I have seen the tutorial to find the city using autocomplete text view in android.i have done everything that is instructed but now when I hit this url. It always throws me an exception saying : java.net.UnknownHostException: Unable to resolve host “maps.googleapis.com”: No address associated with hostname but the same url work fine when i hit through browser and i am getting the results also. Here is the code I’m hitting with :

 …

"Google Place API for Android to Find City"

How to fix an Adobe Edge Html5 animate that restarts the loop

How to fix an Adobe Edge Html5 animate that restarts the loop before animation completes in live browser? I have put together an animated banner ad with Edge Animate and embedded it within my website. When the looped ad plays, it finishes pre-maturely, then starts at the begining again. Each time the ad plays, abit more of the animation plays out before it stops and starts again. For example, the 1st play through may get…

"How to fix an Adobe Edge Html5 animate that restarts the loop"

Cakephp Plugin Search cakeDC Usage

I’m using the 2.0 version of cakephp search plugins by cakeDC (with cakephp 2.x) here . I’m need search in many models but thats models aren’t related. So I created a new model (search) and a controller (searches) . I got this error “Notice (8): Indirect modification of overloaded property SearchesController::$paginate has no effect [APP/Controller/SearchesController.php, line 17]” Model:

Controller:

The view is the same of any index make with bake Any idea how…

"Cakephp Plugin Search cakeDC Usage"

Three levels of GIT config

There are 3 levels of git config; project, global and system. project: Project configs are only available for the current project and stored in .git/config in the project’s directory. global: Global configs are available for all projects for the current user and stored in ~/.gitconfig. system: System configs are available for all the users/projects and stored in /etc/gitconfig. Create a project specific config, you have to execute this under the project’s directory.

Create a…

"Three levels of GIT config"

Running your code as a different user with Alfresco

Alfresco is using acegisecurity, so every running thread has a security context associated and every line of code runs with the executing user’s credentials. However sometimes you need to run a custom code with admin credentials or other system user’s credentials. For example in a current project that I am involved in, we created a configuration utility to store our configuration on Alfresco as content nodes, however in order to read the configurations you have…

"Running your code as a different user with Alfresco"

What does Alfresco mean by Social Content Management?

For those who follow/use Alfresco content management platform, it is no secret that the product team is heavily working around this new phrase (social content management) and they are planning to release features starting with version 3.4. When I first heard the word social content management –in the same sentence as alfresco–, I let the intuitive side of my brain to understand what it might mean. What does social content management mean or rather what…

"What does Alfresco mean by Social Content Management?"

Maven plugin to force parent POM upgrades

It is no news that having a corporate POM for a group of projects is a maven best practice for standardization purposes and avoiding repetition. And just like any other project a parent POM is also a living project and you need to update it from time to time. When the parent POM is updated, you also need to make the inheriting projects receive this update. There are two ways to do this; We can…

"Maven plugin to force parent POM upgrades"

How to upload your artifacts to Maven Central?

I just applied for access to upload my maven plugin to Maven Central Repository and I would like to outline the steps I have followed. There is already a couple of HowTo pages on the subject but mine will be much shorter. You just have to follow the steps given below in order to have your artifact on the Maven Central. First of all you need to have a PGP (Pretty Good Privacy) signature known…

"How to upload your artifacts to Maven Central?"

Application Development on SalesForce

For a project, I was asked to evaluate force.com to see if it can be considered as a platform of choice for a couple of specific applications. During evaluation I mainly looked into the feature set to see how aligned it is when compared to regular enterprise software development routines the development experience to see the efficiency, learning curve, etc. I have not yet finalized my evaluations, but in this post I will try to…

"Application Development on SalesForce"

Changing the DHCP IP Address Range for VMware Player

VMware Workstation includes a utility called virtual network editor which can be used manage the virtual networks. VMware Player also had this utility but they decided to remove it and not by accident! It is an important utility since virtual machines will use NAT to automatically assign a virtual IP address that may or may not work for your network, it might collide with your network’s subnet. For the latest VMware Player the default range…

"Changing the DHCP IP Address Range for VMware Player"

Ruby one-liner to retrieve user groups from Atlassian Crowd

As you may guess from the title that my previous method did not work out for us –not that it is not good, actually it is much cleaner than this solution–. Apache authentication module mod_crowd does not work with SUSE Linux Enterprise Server 11 and it is our infra team’s choice of flavor for production servers 🙂 What I did instead was; I used mod_ldap_auth to do the authentication And made gitolite call a ruby…

"Ruby one-liner to retrieve user groups from Atlassian Crowd"

Integrating Gitolite with Atlassian Crowd

There is no argument that git is currently the best SCM tool. Now I can not believe how come we were using CVS,SVN back then and I know that there is no way for me to use any SCM other than git. While ago we decided to migrate all our repositories to git and while doing that we wanted to revisit the integrations between the other development tools that we are using. We are currenlty…

"Integrating Gitolite with Atlassian Crowd"

Script for changing GNOME proxy settings

Most of us are working in corporate environments and corporate environments do love proxies. And I hate them; I hate setting them every morning I hate un-setting them every evening I am assuming that you also use the same laptop at work and at home. Since I am so sick of changing proxy settings every time, I created the following bash script to set and unset proxy settings.

You can run it as follows.…

"Script for changing GNOME proxy settings"

How to debug deployed content model on Alfresco?

I am trying to merge two AMP modules into one, but the content model in one of the modules seems to be not loaded since the tests are failing. So I tried to find a menu to see the deployed content models on Alfresco Web Client however there is none. As a result I decided to use built-in Get Class Definitions webscript to debug. You can also use this webscript to see if an expected…

"How to debug deployed content model on Alfresco?"

Bootstraping Data with Alfresco

When you work with Alfresco, soon you realize that there lot’s of data/configuration that has to be done to run Alfresco properly. In the end developing with Alfresco means extending it; Implementing a custom content model Setting up a repository structure Applying custom rules on spaces Adding users/groups and configuring access rights … It means every time you install a new Alfresco instance, you also have to setup these prerequisites. However there is a much…

"Bootstraping Data with Alfresco"

Handling multiple queries with Google Visualization API

Google Visualization API supports multiple data queries. So on the client side if you use google.visualization.Query, it automatically increases reqId with every new request you make on the same page. The reason is to identify query responses correctly using reqIds. In order to make this work, you also have to prepare your query responses with the correct reqId. You can use the following snippet if you are using gviz python library. However the idea is…

"Handling multiple queries with Google Visualization API"

Surefire is not picking up JUnit 4/TestNG 5 tests

If you are using any of these artifacts from Spring Enterprise Bundle repository –just like I did–, you can face this problem. Since the artifact names of these artifacts are different than usual, it is not possible for surefire to detect. Solution is easy, just configure surefire as follows.

You can use mvn -X to run maven in debug mode, it is very useful, this is how I figured out the problem.

"Surefire is not picking up JUnit 4/TestNG 5 tests"

Running Alfresco 3.3 with embedded database (H2 in PostgreSQL compability mode)

Alfresco is a very good open source content management system, however there is only one problem with Alfresco, testing. It is a complete headache, writing an integration test, forget it! You will end up with functional tests; fire up an Alfresco instance use one of the existing interfaces to setup some test data and finally do your test Unfortunately, starting from version 3.2 you cannot even do that and why? Because starting from version 3.2…

"Running Alfresco 3.3 with embedded database (H2 in PostgreSQL compability mode)"

Making Alfresco Maven Friendly

Since Alfresco source code is not managed by maven, implementing Alfresco extensions (AMP extensions) even simple JAR extensions with maven is very painful. Actually maven aside, Alfresco’s extension mechanism is itself very basic or rather primitive and based on MMT (Module Management Tool). MMT is a executable jar file for overlaying AMP’s (Alfresco Module Plugin) into Alfresco war file. The simple steps are; Extracting Alfresco war file Extracting AMP Copying everything inside the AMP into…

"Making Alfresco Maven Friendly"

Automatic deployment for Tomcat Applications

I like continuous deployment just like continuous integration. However it can be pain if you have too many environments to deploy to. In the project that I am currently involved in, we have 3 environments for which continuous deployment makes sense. Deployment frequency is different, deployment policies are different but I am sure it is possible to automatize the deployment process up to some extend. Just for that reason (and also because I am bored…

"Automatic deployment for Tomcat Applications"

Interacting with an argument passed to a mocked method in EasyMock

I don’t know EasyMock very well, I just use what I know. I hear you saying; C’mon man, how hard can it be? Besides the whole library consists of 11 classes. Just read the manual and the API docs. I hear you, however I could not find that time ever. I found my own ways when I found myself in situations that can not be handled with EasyMock –my view of EasyMock of course– For…

"Interacting with an argument passed to a mocked method in EasyMock"

How to setup up a new JDK with update-alternatives in Java?

update-alternatives in Java is a very good/clever tool especially for developers who has to maintain different versions of SDK‘s. I frequently use this feature to manage different Ruby versions, JDK versions and many other things but I always had to google it to check how to use. I saw that having to google it every time I need is time consuming so I finally decided to learn it and I noticed that it is not…

"How to setup up a new JDK with update-alternatives in Java?"

Is it possible to reload the content model on Alfresco at runtime?

I am asking this question to myself for sometime, unfortunately I could not find time to investigate it because of other important(!) stuff I had to do. I even asked the same question to a consultant while interviewing him for a project. The answer was; There is not a particular way of doing it, but I am sure it is possible up to some context, since Alfresco is Spring based, blah blah blah. So I…

"Is it possible to reload the content model on Alfresco at runtime?"

Man has to have his own HTTP abstraction in Java

I hate the fact that every project is building their own HTTP abstraction on top of some library, sometimes java.net, sometimes commons-httpclient but always a custom implementation that depends on something different. Currently I am trying to implement a Constaint on Alfresco that can get the allowed values from a controlled vocabulary service via HTTP. First I tried to use Alfresco’s own abstraction to deal with HTTP calls in order to facilitate the existing code-base.…

"Man has to have his own HTTP abstraction in Java"

Meta-Programming in Ruby – So Easy, So Elegant

Ruby is arguably the most meta-programming friendly language of the current dynamic languages since it has no compile time at all, and most constructs in Ruby are available at runtime. Simply, there is no distinction between the code you are writing and the code that your computer runs, and you can change the code that your computer is running at any time you want. Is it dangerous? hell yes. Does this prevent me doing it?…

"Meta-Programming in Ruby – So Easy, So Elegant"

JIRA Exceeded Expectations on GreenHopper

Personally I am not a big supporter for agile tools or rather I am not a big supporter for agile methodologies like; Scrum. I think, this kind of frameworks just enable developers with different personalities/styles and from different profiles to work together. Although I am not a big fan of these kind of methodologies, it is not easy to form a team that you don’t need to use them. Enough for the analysis, it is…

"JIRA Exceeded Expectations on GreenHopper"

Don’t use internal APIs while integrating 3rd party Libraries

While coding in a hurry, you sometimes use internal API’s either willingly –since you don’t want to spend more time– or unwillingly instead of public equivalents. I am saying don’t use them because they meant to change, as the name implies they are for internal use. Just today, I spent three hours just to replace these kind of codes after upgrading Alfresco to 3.3 from 3.2 for a project I am working on. Those who…

"Don’t use internal APIs while integrating 3rd party Libraries"

Testing Alfresco Webscripts

Waaah, too boring to test is too boring to write. I just wanted to start with this quote from Ray Ryan in Architecting GWT applications for production at Google session at Google I/O 2010. This really explains how I feel about extending Alfresco. Actually it is worse than that, writing tests for Alfresco extensions is painful rather than boring. While developing extensions for Alfresco, I often find writing even the simple unit tests unnecessarily difficult.…

"Testing Alfresco Webscripts"

Alternatives to Alfresco Share for Building Generic Forms

Alfresco introduced Share, it’s own collaboration portal based on Spring Surf technology and they have a pretty good idea to reduce the coding effort for building forms for your custom data types. It is called Forms Engine. Here we will point out some alternatives to Alfresco Share. The following diagram pretty much explains the whole idea. You have services on Alfresco side that can return metadata about a particular node for form creation, persist the…

"Alternatives to Alfresco Share for Building Generic Forms"

Show recent viewed product list on website in php

I am writing down the code to show the recent viewed product on the e-commerce websites. if(!$_COOKIE[‘recentviews’]){ setcookie(‘recentviews’,$_GET[‘pid’],time()+86400); }else{ $cArray=explode(“,”,$_COOKIE[‘recentviews’]); if(!in_array($_GET[‘pid’],$cArray)){ setcookie(‘recentviews’,$_COOKIE[‘recentviews’].”,”.$_GET[‘pid’], time()+86400); } } ?> Note:before using $_COOKIE start the session ie write down the session_start() on the top of the page. $query=”select * from product where id in(“.$_COOKIE[‘recentviews’].”) AND id!=’”.$_GET[‘id’].”‘”; Explanation: Suppose i am on the page with url like http://www.example.com?productdetail.php&id=32 where 32 is the id of the product i am viewing. We…

"Show recent viewed product list on website in php"

PHP Functions every PHP Developer Should Know

One thing which I like the most about the PHP is its inbuild/pre-defined functions. If you are coming from C/C++ background. Then you will start loving the gift of PHP functions. For Eg. array_sum() . you don’t have to write a logic for iterating through all the array and add their values. PHP has a pre-defind function which do the same job for you. 1) explode() : it converts a string into array with the supplied…

"PHP Functions every PHP Developer Should Know"

Complete Cheatsheet of Mod_rewrite

Below is the Complete Cheatsheet of Mod_rewrite Download mod_rewrite Cheat Sheet [.pdf] RewriteRule Flags C Chained with next rule CO=cookie Set specified cookie E=var:-value Set enviro-nmental variable “var” to “value” F Forbidden (403 header) G Gone – no longer exists H=handler Set handler L Last – stop processing rules N Next – continue processing NC Case insens-itive NE Do not escape output NS Ignore if subrequest P Proxy PT Pass through R[=code] Redirect to new…

"Complete Cheatsheet of Mod_rewrite"

Complete Cheatsheet of Mysql

List of all important functions of mysql which are used frequently Official Website Download MySQL Cheat Sheet [.pdf] MySQL Database Quick Reference [.pdf] Data Types Types CHAR String (0 – 255) VARCHAR String (0 – 255) TINYTEXT String (0 – 255) TEXT String (0 – 65535) BLOB String (0 – 65535) MEDIUMTEXT String (0 – 16777215) MEDIUMBLOB String (0 – 16777215) LONGTEXT String (0 – 429496-7295) LONGBLOB String (0 – 429496-7295) TINYINT x Integer (-128…

"Complete Cheatsheet of Mysql"

PHP Basics Introduction

PHP stands for Hypertext Preprocessor, although some people also call it Personnel Home Page. This was the full form given to it when there was no full form given to it. Later on a meaningfull full form is given to PHP  ie Hypertext Preprocessor. PHP is Server Side language . We need a Server to run the PHP code/files.In PHP’s case we use apache as a server.You can use the whole stack of (mysql+php+apache) by…

"PHP Basics Introduction"

How to Clear Facebook Cache URL

Please use the url to clear the cache, if you want to cache the url https://developers.facebook.com/tools/debug/og/object/ There is an Facebook API which uses CURL to clear cache.

"How to Clear Facebook Cache URL"

Algorithms {Longest Palindromic Substring}

Today we will talk about “Longest Palindromic Substring” problem. I’ve developed solution about year ago but a few days remembered it and thought about it. So, full problem description: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. Ok, good, on the face of it, we can use some simple naive algorithm with O^2 complexity…

"Algorithms {Longest Palindromic Substring}"

Algorithm {Binary Tree Maximum Path Sum}

I’ve just solved one more problem from leetcode and going to share that solution. So, solved problem calls Binary Tree Maximum Path Sum. Problem description: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree,

Return 6. OK, stop and think …. What do we have ???  The main point is binary tree. We can use perfect traversing algorithms. In…

"Algorithm {Binary Tree Maximum Path Sum}"

Evaluate Reverse Polish Notation Algorithm

I’ve solved a few tasks from http://leetcode.com/ and going to publish my solutions, So, first task is Evaluate Reverse Polish Notation The task description is : Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, –, *, /. Each operand may be an integer or another expression. Some examples:   [“2”, “1”, “+”, “3”, “*”] -> ((2 + 1) * 3) -> 9   [“4”, “13”, “5”, “/”, “+”] -> (4 + (13 / 5)) ->…

"Evaluate Reverse Polish Notation Algorithm"

Algorithm {The maximum-subarray problem}

I’ve just opened Introduction to Algorithms on Divide-and-Conquer chapter, and found interesting item – The maximum-subarray problem. In book you can find implementation with complexity O(NlogN) with good explanation, but in Exercises part there is good task: Use the following ideas to develop a nonrecursive, linear-time algorithm for the maximum-subarray problem. Start at the left end of the array, and progress toward the right, keeping track of the maximum subarray seen so far. Knowing a…

"Algorithm {The maximum-subarray problem}"

Algorithm {Single Number}

We are working on next task from leetcode. So, next task will be …. , {Single Number} 🙂. Task: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? Stop and think … What we have, input array of integers and we should find one NOT DUPLICATE number. So, it’s easy … Go to the…

"Algorithm {Single Number}"

Algorithm {Triangle}

Hey, next problem from leetcode will be Triangle. Task description: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle

The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5 + 1 = 11). Note: Bonus point if you are able to do this using only O(n) extra space, where n is the total number of rows in the triangle.  Stop and think ……

"Algorithm {Triangle}"

Reverse Words in a String Algorithm

Today we will try to solve “Reverse Words in a String” task for leetcode. Task description: Given an input string, reverse the string word by word. For example, Given s = “the sky is blue“, return “blue is sky the“. Clarification: What constitutes a word? A sequence of non-space characters constitutes a word. Could the input string contain leading or trailing spaces? Yes. However, your reversed string should not contain leading or trailing spaces. How about…

"Reverse Words in a String Algorithm"

Algorithm {Max Points on a Line}

Today we will try to solve next problem from leetcode. The problem is Max Points on a Line. Problem description: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. So, that is short desciption…. Try Stop and Think … What do we have, we have input array/list of points and should return max number of the points on one line. We can try to remember school math course…

"Algorithm {Max Points on a Line}"

VitualBox VMs increase disk size

I am using VirtualBox as VM platform for different OS’. Last time I’ve investigated kafka messaging system I’ve created simple VM based on the ubuntu OS. Disk was created by default with size amount 8 Gb. During investigation I’ve found that kafka stores a lot of files (related to configuration) and free space on my disk is very low, I’ve decided to extend it, but did not found standart ( on menu ) option to…

"VitualBox VMs increase disk size"

Reverse LinkedList {Loop implementation}

In the first part I’ve described how to reverse single LinkedList using recursion. Today we will to do the same using one loop. The structure of linked list will be the same, look to the Node class. OK, What we should understand? The first implementation used next steps: Go throughout all nodes and set next to null { after these steps we have n-null pointed LinkedLists.} Read from end and change direction of linking. Current…

"Reverse LinkedList {Loop implementation}"

How to Clean your Mac after Deleting IntelliJ IDEA

If you tried to delete an IntelliJ IDEA from your mac station you know that problem is not simple, so, I’ve decided to write short note “how to clean your mac after deleting IntelliJ IDEA app from Application folder”. Generally check all next folders and clean/change what you want:

Where it can be used ? If you have some problems in update; If you have problems with license; If you have problems with old…

"How to Clean your Mac after Deleting IntelliJ IDEA"

How to install Yakuake on Cenros 6.3

I’ve started to use Centos server and tried to find good terminal emulator. Previously I’ve used guake for Ubuntu and some port of this emulator for Mac OS X. I’ve started to find repository of yakuake and found that there are no 🙁, So, I’ve prepared short instruction how to compile Yakuake for Centos 6.3. Firstly you have to install kde dependencies, run your gnome terminal and execute next commands: su – go to root…

"How to install Yakuake on Cenros 6.3"

How to Get IP Address Linux

Today I’ve tried to prepare auto configuration of my application and one of the main point was create correct cluster with real IP addresses . For example you have some config files where you want to put real IP of installed machine. In real Linux world it should be configured manually after installation but I want to emulate auto configuration, so, I’ve prepared bash script to get ip address on linux for auto config all…

"How to Get IP Address Linux"

Maven: Set up java.library.path

I’ve tried to set up java.library.path as next example      <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <systemProperties> <property> <name>java.library.path</name> <value>target/lib/</value> </property> </systemProperties> </configuration> </plugin> but there were problems in testing, one test with JNI was passed but others were failed. I’ve spent about 4 hours for investigation and found that in last part of documentation there are special properties, so I’ve tried it and it is working!!! Simple example of working plugin configuration <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <forkMode>once</forkMode> <workingDirectory>target</workingDirectory> <argLine>-Djava.library.path=${basedir}/lib</argLine>…

"Maven: Set up java.library.path"

Amazing story about crashing JVM

A few days ago I’ve investigated API of one over price external library. One note this library is native, written using C++ and provides ports to other language in particular for Java using JNI. So, I’ve started to run provided example all is OK, and I’ve decided to use this application to write my API using OSGI and Spring. Native example implements 5 interfaces and provides a lot of methods that I do not need…

"Amazing story about crashing JVM"

Development Workflow: Usual Steps

Do you have established dev’s process ? How do you use it ? Do you like it ? What is the benefit from it ? And others … These questions are usual in programmers’ area (at least for me), so I decided to write short note about process and how it established in company where I am working. Short and simple Rules: Firstly – all have to use it, if some one decided to stop…

"Development Workflow: Usual Steps"

Simple puzzle NPE (String)

We had training related to java, and was short example of code, like that :

and all developers tried to find places where NPE can be thrown. Yes, we found that name can be null

also that agent.getFullName() can throw NPE. But I asked, next question :

So, here is short description how that can be implemented 🙂 OK, we should know where method length() is declared, short investigation can show us that method length()…

"Simple puzzle NPE (String)"

Longest substring with 2 unique chars Algorithm

A few days ago my friend asked me a question, How can we find the longest substring which contains 2 unique characters in linear time without additional memory? Yeah, we spoke about algorithms 🙂. I suggested to use 2 cursors like start and end and just get substring by these cursors. Generally idea is right, but how can we manage these cursors ? This is quite hard. Maybe not so hard but need some time to…

"Longest substring with 2 unique chars Algorithm"

Reverse Singly Linked List using Recursion implementation

Recently I’ve read IT topic about interview questions and was surprised, Programmers discussed about “hard” interview question “Reversing of Linked List”. Judging to that topic the task was hard for most candidates and I decided to write short note about Reversing Linked List. Firstly this task was to Reverse Singly Linked List using recursion; Secondly time for creating algorithm was about 5 mins; So, I’ve used Java for realization but you can write the same…

"Reverse Singly Linked List using Recursion implementation"

Algorithm {Find Minimum in Rotated Sorted ArrayII}

I’ve solved next task Find Minimum in Rotated Sorted ArrayII. The main difference between two solutions is duplication. So, task description: Follow up for “Find Minimum in Rotated Sorted Array”: What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find the…

"Algorithm {Find Minimum in Rotated Sorted ArrayII}"

Algorithm {Min Stack}

I’ve just found that leetcode added new one task and decided solve it 🙂. SO, new task is Min Stack. Task description: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) — Push element x onto stack. pop() — Removes the element on top of the stack. top() — Get the top element. getMin() — Retrieve the minimum element in the stack. As you can see we need…

"Algorithm {Min Stack}"

Algorithm {Word Break II}

Today we will work on hard task Word Break II. Why this task is hard? I can say, here, during resolving this problem, you will and you should use a few techniques. First one traversing method called DFS (or BFS), second is Dynamic programming, third is some combining and tricks 🙂 to pass tests on leetcode. OK, try to read task description : Given a string s and a dictionary of words dict, add spaces in s…

"Algorithm {Word Break II}"

Algorithm {Intersection of Two Linked Lists}

Today I will describe about easy but with interesting solution problem – Intersection of Two Linked Lists. OK, let’s read problem description: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists:

begin to intersect at node c1. Notes: If the two linked lists have no intersection at all, return null. The linked lists must retain their original structure after…

"Algorithm {Intersection of Two Linked Lists}"

jQuery Form Validation in ASP.net Pt 2: The ValidatorUpdateDisplay Function

In this two part series of jQuery Form Validation in ASP net I’ll show you how to override the built-in ASP.net validation functions with your own jQuery-ized versions. Turn your boring ASP.net form validation controls into intuitive, user-friendly, and just all around snazzy feature of your ASP.net web forms. You’ll make your users want to throw validation errors! In Part 1 I showed how to override the built-in javascript and highlight an input control if it is…

"jQuery Form Validation in ASP.net Pt 2: The ValidatorUpdateDisplay Function"

ASP.net Form Validation with jQuery Part 1: The ValidatorUpdateDisplay Function

I use the built-in ASP.net validation controls all the time and they work quite nicely. However, they’re boring. Sure, some CSS formatting could be applied to make it look a little nicer and images could be used for the validation errors, but they still only work a certain way. The ValidationSummary especially can be problematic when you have a lengthy form that requires scrolling. To make this as user-friendly as possible you more than likely…

"ASP.net Form Validation with jQuery Part 1: The ValidatorUpdateDisplay Function"

Algorithm {Longest Valid Parentheses}

Today we will try to solve that problem for the Longest valid parentheses. First time I’ve faced the task I did fail, Yes, I’ve thought about the task in right way but had problems in some implementation details. Today, I’ve analysed the problem on the fresh mind and found/fixed my mistakes. So, task description: Given a string containing just the characters ‘(‘ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. For…

"Algorithm {Longest Valid Parentheses}"

Android: Formatting Strings

Introduction If you are java developer you can use String.format for adding some parameters into your string. Core Java provides us mechanism to manage it using symbols like %s or {1}, but how to use this mechanism in Android resource strings? Resource Strings Android provides us good mechanism to format strings in application too. Just try to add %1$s  or %1$d into your resource strings. The last symbols mean s –  for string formatting d – for decimal…

"Android: Formatting Strings"

Android: Send SMS messages from Emulator using Telnet

I’ve started to develop first Android application and will write some notes during development process. The first note is sending sms messages from terminal. So, There are a few steps to send messages from emulator using terminal: Start emulator (The emulator has to be started becaue you need to know port to connect). For starting emulator go to the Andriod SDK and AVD Manager->Virtual Devices->Start  Start telnet. Type in console window

Open telnet connection to…

"Android: Send SMS messages from Emulator using Telnet"

Android: Unit Test Issues

I’ve created this project for testing my Android Application and tried to start it. After starting I have received next error: Test run failed: Unable to find instrumentation info for: ComponentInfo {<my package>/android.test.InstrumentationTestRunner} After few hours of investigation I have found solution for this situation. Problem So, Problem is name of package in the manifest files.  The package in “real” manifest file and test manifest file are equal. For instance, look at the package com.blogspot.jugn in…

"Android: Unit Test Issues"

Android: Amazing Story about Sending SMS Messages from the Code

I’ve found amazing case of sending sms messages from the code. Task I need to send SMS message from my test method and test behavior of parsing it. Just for this post we are interesting in first part: Sending SMS message from code. I’ve written next simple code: final SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(“5554”, null, “Test”, null, null); and tried to test it. Just put this code in simple test method and run Android Unit Test. The result is … nothing!!! Why?!! I…

"Android: Amazing Story about Sending SMS Messages from the Code"

Android: Localization

Introduction The next step in development Android application will be localization. I’ve read documentation from official site and from http://www.icanlocalize.com/ and decided to describe it. Sequence of resources lookup How does android lookup the resources from applications? The example of lookup steps below: ‘res/values-en-rUS/strings.xml’ ‘res/values-en/strings.xml’ ‘res/values/strings.xml’ Firsltly Android looks for resources in en-rUS folder if not found, looks in -en folder and just after it in default. If resource has been found then  the search stops. Dismantle folders structure The next question that worried me…

"Android: Localization"

PlayFramework: Run and Debug Using IDE

Introduction I think each of us looking for the best IDE and best way of development. I think the best code editor is IntellJ IDEA and I am using it for 6 years. A few month ago I’ve started to use PlayFramework and were surprized that there is no way to debug application using IDE just browser and console logs and messages. After short investigation I’ve found solution … Solution This step-by-step solution for IntellJ…

"PlayFramework: Run and Debug Using IDE"

Algorithms: Customization Binary Search

I had some interviews into big companies like Google, Amazon and so on, and there were tasks related to the algorithms. So, Here I’ll describe one of the tasks and publish code for this algorithm. Note, during interview you can chose algorithm by your self and time for implementation (runtime implementation) about 30 mins….. Predefined: There is dictionary of words with unspecified size, we just know that all words in dictionary are sorted (for example by alphabet). Also we have…

"Algorithms: Customization Binary Search"

Linked List Cycle / II Algorithm

Today we will learn how to solve two problems from leetcode – Linked List Cycle and Linked List Cycle II. So, as you can see these problems are related but first easiest and second more complex. OK, first task description: Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? So, it’s easy if you know Robert W. Floyd algorithm also called “tortoise and the hare” algorithm. Full…

"Linked List Cycle / II Algorithm"

Algorithm {Binary Tree Level Order Traversal II}

Binary Tree Level Order Traversal Today we will work on the tree traversal task – Binary Tree Level Order Traversal II. We can see that task is pointed as second (II) it means not simple/classic level order traversal, so, let’s read task description: Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree {3,9,20,#,#,15,7},…

"Algorithm {Binary Tree Level Order Traversal II}"

Open Graph Protocol & Facebook

It’s been a long time I read about the open graph protocol Basically: “The Open Graph protocol enables any web page to become a rich object in a social graph. For instance, this is used on Facebook to enable any web page to have the same functionality as a Facebook Page. While many different technologies and schemas exist and could be combined together, there isn’t a single technology which provides enough information to richly represent…

"Open Graph Protocol & Facebook"

Multiple RVM gemset with Passenger

I seem to never remember the steps for this procedure (and I’ve needed it a few times already), so I figured I would just write it down here for future reference. We need to give instructions to passenger to load up the right gemset in our application’s directory. .rvmrc file Create an .rvmrc file in the web application’s root directory: Create a new gemset Edit the .rvmrc file and add the gemset to be used,…

"Multiple RVM gemset with Passenger"

Pulling off IP address range filtering with Regex in AWStats

Recently I was tasked to create an extra section in an exisiting AWStats configuration which would basically filter users” IP addresses that are contained in a specific range. In order to do this, I needed to create a new ExtraSection for the administrator to be able to see this list inside the same report used for the website, but in a different section of the report output. ExtraSections in AWStats is a handy feature which…

"Pulling off IP address range filtering with Regex in AWStats"

How To Install Redmine 2.1.2 on FreeBSD Apache (with Passenger and RVM)

A few days ago I needed to setup a FreeBSD server from scratch, in order to have a dedicated ticketing and project management system at work. We decided to use the popular Open Source Project Management Software, Redmine, since some of us had some previous (positive) experiences with it. Looking through the Redmine community wiki, I noticed that the guides on how to install Redmine on a FreeBSD system were either outdated, or in a…

"How To Install Redmine 2.1.2 on FreeBSD Apache (with Passenger and RVM)"

Custom jQuery UI Form Rails Button Helper

Today I got a little bored with my standard rails buttons Not bad…but could use a little pizazz. So I decided to take a crack at jQuery UI. A great javascript and style framework that promised to be easy to use and provides theme-able styles. Once you’ve got jQuery UI integrated nicely into your rails project (note i had to change my url paths in the stylesheet), you can style your submit button easily by…

"Custom jQuery UI Form Rails Button Helper"

Add Global Javascript Variables to Window

Just found out today that you can attach a javascript variable to the window effectively making it a variable global to the window. You can define it like this:

And then you can access the same variable anywhere in your window. Pretty Cool Huh? The reason I needed a global variable in the first place was due to some neat javascript hackery. In some of my tables, I have made an entire row clickable , by…

"Add Global Javascript Variables to Window"

Install RMagick and MySQL with Snow Leopard

The easiest way to install RMagick is  to download the script from: http://onrails.org/2009/09/04/rmagick-from-source-on-snow-leopard.html and to execute it by entering into terminal

If you get errors related to “jpeg” or “jpg” then make sure you don’t have the macports library installed:

Then run this install script for only installing image magick and all of its dependencies: http://github.com/masterkain/ImageMagick-sl After that install RMagick, and you should be good to go

<hr /> To install MySql…

"Install RMagick and MySQL with Snow Leopard"

Crazy Easy Intro to RMagick – Ruby on Rails Image Manipulation

So, you’ve go ruby on rails up and running, and now you’ve installed Rmagick, and you want to manipulate some images. Grab an image, throw it in your public folder, lets call it myimage.jpg. Run script/server to start your server, and in a controller somewhere put this:

def show image  = Magick::ImageList.new(”public/images/myimage.jpg”) image   = image.rotate(90) image.write(”public/images/myimage.jpg”) end then in your show.html.erb you can show your picture: < img src = “/images/myimage.jpg” /> Every time…

"Crazy Easy Intro to RMagick – Ruby on Rails Image Manipulation"

CSS Sprite Generator and Rmagick

I came across another article on CSS Sprites today and it got me thinking of a better way to generate CSS sprites. CSS sprites to me have always been difficult and un-yielding. As a developer I love flexibility; and bundling all of my images into one, then mapping pixel boxes to different CSS backgrounds doesn’t sound flexible at all. I can see it being very useful after I’ve had the site up for a while,…

"CSS Sprite Generator and Rmagick"

JavaScript Only numbers / Only Letters / No letters in TextBox

In this article I will be explaining how to prevent a user from typing Alphabet letters in the text box intended for only numbers. For example, if you want to get age of a user using text box then you may not allow user to type other than numbers. Same things in the case where you want to get the name of user. You have to prevent the user from typing numbers and special characters…

"JavaScript Only numbers / Only Letters / No letters in TextBox"

Mistakes to Avoid While Doing PHP Coding

There are some mistakes which can be avoided if coding is done, while keeping the below points in mind. # Always open and close the brackets for loops or if else condition. It is common mistake to forget about closing the curely braces or loop closing braces. # End all the PHP lines with “;”(semi-colon).It is good practice  to avoid errors in php. # I will advice to use <?php and ?>  for opening and closing php…

"Mistakes to Avoid While Doing PHP Coding"

Generating confluence documentation of Alfresco web scripts

If you are working with Alfresco, you may already know what web scripts are. Basically web script framework is a thin REST layer on top of repository and the web scripts are the RESTful services that runs inside this framework. Web scripts are the services that allows you to interact with the repository and it is obvious that they should be documented properly for proper collaboration. Alfresco already has another web script to dump all…

"Generating confluence documentation of Alfresco web scripts"

Codeigniter 500 error issue with Godaddy Hosting – Resolved

Godaddy hosting has got its’ own way of handling things. We need to work extra hard for running things smoothly on Godaddy & Codeigniter is no exception to this. I really used to ignore hosting my codeigniter projects on godaddy. But finally , I figured out the way of running Codeigniter on Godaddy. Write the below code in your htaccess file. RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php?/$0 [PT,L] and make the below…

"Codeigniter 500 error issue with Godaddy Hosting – Resolved"

List in HTML

List are a way of representing things in a chronological manner.Sometime we use it to show the hierarchy also. List can be of two types : Ordered List , UnOrdered Listfirst published! (required) Ordered List in HTML Cricket Playing nations India Pakistan England South Africa For above list, we have to use the below code <ol> <li>India</li> <li>Pakistan</li> <li>England</li> <li>South Africa</li> </ol> Another style for ordered list India Pakistan England South Africa For above list,…

"List in HTML"

Tips and Tricks in PHP

I am sharing some tips and tricks with you here, with the experience I have had in programming # If you are uploading any files using form , always use enctype=”multipart/form–data”  in the form tag. For eg.   <form name=”myform” method=”post” enctype=”multipart/form–data“> If you don’t use the above attribute , you will be not able to upload the file onto the sever # if some of your form values are not submitting, then the first…

"Tips and Tricks in PHP"

GROUP functions in Mysql

Below is the list of GROUP functions that are basically used in Mysql Name Description AVG() Return the average value of the argument BIT_AND() Return bitwise and BIT_OR() Return bitwise or BIT_XOR() Return bitwise xor COUNT(DISTINCT) Return the count of a number of different values COUNT() Return a count of the number of rows returned GROUP_CONCAT() Return a concatenated string MAX() Return the maximum value MIN() Return the minimum value STD() Return the population standard…

"GROUP functions in Mysql"

How to use If-Else in Mysql

If else is basically used in the programming paradigm. We can use the same in Mysql. How to use If-Else Mysql Sometime it is very useful in programming. Suppose you have two column in the table as price and discountprice in the product column. You want to fetch the price and show it in the front end. If the discount is set in the table then it will be the actual price not the value…

"How to use If-Else in Mysql"

Styling “xtype: text” in ExtJS

I decided to use the “text” ExtJS xtype the other day, and in doing so had to figure out styling. What may seem like a very straightforward endeavor took a bit more thought than I hoped for. After attempting to apply a style from my stylesheet via the ‘cls’ or ‘baseCls’ configuration options (to no avail) I turned to the documentation and stumbled upon ExtJS selectors with the styleSelector configuration option. For whatever reason, Sencha does…

"Styling “xtype: text” in ExtJS"

ExtJS Associations: The Good, the Bad and the Ugly

As you may already know, with the release of ExtJS 4.0 came a heralded new feature of associated data models, briefly introduced in the Countdown to Ext JS 4 Blog Post. At first glance, associations seem absolutely spectacular: an easy means of retrieving relational data without all the messy callbacks and recursive searching that you may have experienced in the past. Truth be told, associations are pretty cool, however there are just a few quirks…

"ExtJS Associations: The Good, the Bad and the Ugly"

Update Command in Mysql

Update command is used to update record in the table based upon some condition, if condition is missing then all record will get updated. Syntax : UPDATE tablename SET column1=value1,column2=value2 WHERE condition Eg: UPDATE user SET name=’abhishek’,age=’22′ WHERE salary>22000 above query will update the name to ‘abhishek’ and age to ’22′ whose salary is greater than 22000. Updating table based upon pattern matching. Suppose we want to add 2 years to age whose name has…

"Update Command in Mysql"

List of Mysql Mathematical Functions

Below is the complete list of Mysql Mathematical Functions Name Description ABS() Return the absolute value ACOS() Return the arc cosine ASIN() Return the arc sine ATAN2(), ATAN() Return the arc tangent of the two arguments ATAN() Return the arc tangent CEIL() Return the smallest integer value not less than the argument CEILING() Return the smallest integer value not less than the argument CONV() Convert numbers between different number bases COS() Return the cosine COT() Return…

"List of Mysql Mathematical Functions"

Mysql Introduction

Mysql is a RDMBS ie Relational Database Management System. It is the most popular RDMS used with php. Mysql uses various storage engine .Some of them are MyISAM,MEMORY,HEAP,MERGE,InnoDB etc .The defalut storage engine is MyISAM. Below are the some operations which are frequently used . Insert Syntax : insert into tablename(column1,columan2…..) values (values1,values2…….). alternate  syntax insert into tablename values (values1,values2…….). Eg :  Insert into user (name,age,sex) values (‘Manish’,’23′,’Male’) Here table name is user, the order…

"Mysql Introduction"

First HTML Page

Today we will create our first HTML page. I am also excited as you are So here we go, #1 Open your notepad, if you are using Windows OS or any other text editor if you are using any other OS. #2 Now, write the below lines of code into it. <html> <head> <title>My First Page – Alychicoding</title> </head> <body> I am learning HTML . </body> </html> Note : Nowadays the browser have become very…

"First HTML Page"

Fancybox on ASP.net Web Forms

My “lightbox” of choice for web development is the jQuery plugin Fancybox. It is simple, lightweight and completely customizable. Future tutorials will go more in depth with using and customizing Fancybox. One of the issues is fancybox on asp.net web forms does not work when showing ASP.net server controls inline. This tutorial will walk through the steps to get Fancybox working properly. Here’s the scenario. Say you have an ASP.net form on a page with a GridView showing a…

"Fancybox on ASP.net Web Forms"

ASP.Net Refresh Data on Parent Page from Lightbox without Postback

Something that has always bothered me about using “light boxes” or even popup windows and data is added or updated in that light box the parent window that is displaying the data doesn’t refresh the data without refreshing the page. Using AJAX to improve the user experience  makes matters worse because the data should automatically asp.net refresh when changed. This tutorial will show how to update a GridView on a parent page when a light box…

"ASP.Net Refresh Data on Parent Page from Lightbox without Postback"

Star User Rating Control in Asp.Net Using Jquery

With a little CSS, a tiny amount of jQuery and a little ingenuity you can easily create a reusable rating control in asp.net using jquery. The Basics For the CSS I decided there was no reason to re-invent the wheel, so I used Komodo Media’s CSS Star Rating Part Duex for the styles, although I did rename them (only because I prefer short, simple class names). Here’s the basic HTML structure of the rating system:

"Star User Rating Control in Asp.Net Using Jquery"

Chive – Internal Server Error Problem

Every webmaster knows the free PHP tool for the administration of MySQL databases phpMyAdmin, where one can do all important operations in its MySQL databases via browser. This is more likely to be developed in a easy manner and its surface is still based on a frameset. Many webmasters are not familiar and so there are various alternatives, which are however often only developed and supported for a short time. A new competitor in this…

"Chive – Internal Server Error Problem"

C ++ → Recursive XOR

I used to deal with cryptography some time ago and thought of my own algorithm. A part of this I will introduce to you. I call it recursive XOR. The reason behind this is that you encode an entire byte with only one bit. I will show you the simple principle, which is behind it in a brief example: We take a byte we want to encrypt (01001110) and a bit (1). We apply XOR…

"C ++ → Recursive XOR"

Decorating Django views that require Google Authorization with python decorators

In a project that I am currently involved, we needed to authenticate with Google Analytics in order to query statistics. As you may know currently Google supports three authentication mechanisms to allow other applications to authenticate on someone’s behalf. ClientLogin: You give your username, password and the application does the rest for you. I don’t think there are still people out there who can give away their passwords to applications to be used on their…

"Decorating Django views that require Google Authorization with python decorators"

Alfresco list constraint that can get available values from an external service

In an on-going project that I am involved in right now, we are using/extending Alfresco as a Content Management System. One of the challenges we have faced is that we have integrate it with an internal CV (Controlled Vocabulary). CV holds the references of all domain specific entities and the relationships between them. We need the list of values from the CV to show in the user interface, there are two ways to do this.…

"Alfresco list constraint that can get available values from an external service"

Salesforce Extension for Spring Social

For the past two weeks I have been working on Spring Social Salesforce. Spring Social Salesforce is an extension to Spring Social that provides Salesforce connect and Api bindings support. Spring Social Spring Social is an extension of the Spring Framework that allows you to connect your applications with Software-as-a-Service (SaaS) providers such as Facebook and Twitter. As stated on it’s site; Spring Social is an abstraction on top of social platforms (API’s) that takes…

"Salesforce Extension for Spring Social"

The default PackageResolver for gwtoolbox has changed?

I spent the last 4 hours to understand why gwtoolbox is not injecting dependencies. It was a painful process; there was not any log, just a NullPointerException since there is nothing to inject in the container. Anyway the problem occurred after upgrading gwtoolbox to 2.0-SNAPSHOT from 0.7. Finally I figured out that they changed default PackageResolver strategy in the new version. Before I wasn’t specifying any PackageResolver, meaning; I was relying on the default package…

"The default PackageResolver for gwtoolbox has changed?"

Drupal Module Usage Page

Some three years ago, the nice people at Drupal launched a service that gathered statistical data from deployed drupal sites, regarding the modules they used. This was mainly to solve the problem of which module to use for a particular purpose. I remember this was a real problem when i started using drupal; I often ran into 2-3 Drupal modules doing something similar, that solved my problem, but i had no idea which one to…

"Drupal Module Usage Page"

PHP – Make Youtube embed code from an Url

A small php function that transforms a youtube url in its embed script. function make_youtube_embed_from_url($url) { $url = str_replace(‘?v=’,’/v/’,$url); $out = ‘<object width=\”425″ height=\”350\”><param name=\”movie\” value=\”‘. $url .’\”></param><param name=\”wmode\” value=\”transparent\”></param><embed src=\”‘. $url .’\” type=\”application/x-shockwave-flash\” wmode=\”transparent\” width=\”425\” height=\”350\”></embed></object>’; return $out; }

"PHP – Make Youtube embed code from an Url"

Drupal:: Mysql Server has Gone Away Error

I had a problem with an error that kept popping up “mysql server has gone away error” in Drupal. After some reading around , I figured it was happening because drupal was pushing the mysql server too hard (http://drupal.org/node/227445). An easy way around this was to turn off some modules I didn’t really need. Hope this helps.

"Drupal:: Mysql Server has Gone Away Error"

Drupal:: How to Add User Pictures

Unlike most basic things in drupal, adding a user pictures to nodes like the forum, is not such an easy intuitive task. So after looking around i gathered this: To add a user picture on posts: – select pictures in /admin/user/settings – allow pictures in the theme at admin/build/themes/settings (also in the specific used theme if there is one)

"Drupal:: How to Add User Pictures"

(Ogre) Embedding Python in C++ Example

I decided that I want to find a good way to put Python in my C++ Ogre applications. Now, one method of doing this would be to write an interface for import game_namemy application at a high level. Lets say that Python is going to handle scripting in an RPG-type game. I would need it to do things like “move character to this position, do some spell particle effects, say this dialog”. To accomplish this, I’d…

"(Ogre) Embedding Python in C++ Example"

Psyco and PyPy

After working with an issue in PyOgre I decided to take a closer look at Psyco (the Python JITer). Taking a look at how Psyco works is like learning how sausages are made. You just don’t want to go down that road. This isn’t to say that Psyco is poorly written, badly executed, or anything like that. I just mean that the actual internals of Psyco are incredibly complex, and not something that can be…

"Psyco and PyPy"