SQL : Updating Oracle table with data using subquery

In Oracle Database 11g , when you need to update values of certain records from one table,  and the value and the records to update are determined by a second table, you can use a subquery in the update statement to achieve the update.

Using “EMPLOYEE”  and “EMPLOYEE_STAGING”  tables as an example , we want to update field “SALARY” – table “EMPLOYEE” with the values from field  “SALARY” – table “EMPLOYEE_STAGING”.

Read the rest of this entry »

How to install Yii Framework on XAMPP for Windows

Yii-logo-transparent

 

Yii is an open source, object-oriented, component-based MVC PHP web application framework. Yii is pronounced as “Yee” or [ji:] and it’s an acronym for “Yes It Is!

The first thing you need in order to use the Yii Framework is access to a Web server with PHP installed, of course. But if you’re reading this, I’m going to assume you have access to a PHP-enabled server. Note that the Yii Framework does require PHP 5.1 or above.

Installing Yii framework

Get the Yii framework from the site http://www.yiiframework.com/download/

Extract the compressed files into XAMPP htdocs folder, e.g. C:\xampp\htdocs\yii.

Read the rest of this entry »

SQL Injection. How to prevent it from happening in PHP.

SQL injection as a matter of security can be approached from multiple angles. One must first be sure that the targeted application has a confidential database structure, since this is the main thing that makes SQL injection possible.

Also, it’s important to notice that SQL injection is not something that happens arbitrary or from time to time, it takes place on most known websites. In figure 1 are illustrated the results of a study realized by Ponemon Institute about the intensity at which SQL injection takes place on most websites (year 2013):

articol-1

(Source: http://securityaffairs.co/wordpress/24094/cyber-crime/ponemon-sql-injection-attacks.html)

Read the rest of this entry »

Android product flavors (part 2)

Hey there ! Welcome to the second part of the Android product flavors tutorial. In the first part we learned how to setup our project to use product flavors, and how to add custom icons and resources to the flavors. The second part will cover using custom layouts and adding custom code to the product flavors. Read the rest of this entry »

Android product flavors (part 1)

By now, every Android developer has heard of product flavors. We all know they allow us to add small customization to our application, for example, we could change the app icon or the app colors. This sounds great, imagine all the things you could do ! But what if you’ve never had the chance to use product flavors before ? Don’t worry, we got you covered, the following tutorial provides an introduction to product flavors and what you can do with them. Read the rest of this entry »

Android signing configuration tutorial

Android Studio has introduced a lot of new features that make our lifes a lot easier. One of those features is generating signed apks using Gradle. The basic idea is that you provide all the required properties (keystore password, alias and alias password) in the build.gradle file of the application you want to sign. But what happens if you don’t wan’t to add the keystore and/or credentials in the Version Control System (VCS) ? The following tutorial presents a solution to this problem. Read the rest of this entry »

Tags: 

Kendo Server Filtering

If you want to enable Server Filtering on Kendo Grid, first step is to tell Kendo that you want to enable that functionality because, by default, the data source performs filtering on client side.

var dataSource = new kendo.data.DataSource({
	transport: {
		read: function (options) {
			var filter = options.data.filter;
			/* send the filter to the server*/
			options.success(receivedDataFromServer);	
		}
	},
	serverFiltering: true
});

On the server side you need to map Kendo Filter to a C# Filter class.

public class Filter
{
	public string Field { get; set; }
	public string Operator { get; set; }
	public object Value { get; set; }
	public string Logic { get; set; }
	public IEnumerable<Filter> Filters { get; set; }
}

Read the rest of this entry »

Tags: 

AngularJS

If you’ve worked with AngularJS you most definitely have found yourself in the situation of using templates. While good for release and keeping your code clean, templates can often times pose a problem while developing. Since AngularJS has an implemented cache method, everytime you modfidy a template it will load from cache, therefore not allowing you to see your new modifications. This can be disabled in a number of ways, we’ll show only 2: Read the rest of this entry »

SQL : Concatenating multiple rows into a single string

In some occasions it is necessary to concatenate data from a number of rows into a single row.

Using HR.DEMO table as an example , we want to retrieve a list of employees for each department.

Base Data :

 

Desired Output :

 

Read the rest of this entry »

How to put online the Apache 2.4 Server

If you find yourself googling in order to make your new local server work online, you’ve come to the right place. Most Web Server packages today (WAMP, XAMPP or Uniform Server) are configured to work with the “old” Apache 2.2 version and have a major flaw. Since 2.4, Apache has dropped the directive “Allow” in favour of the new directive “Require”.

Therefore, in order to make your aliases work and also to put your Apache Server configuration online, you must edit the configuration file and make two changes:
Read the rest of this entry »