Welcome to Nativesoft

We offer complex services in the area of software development, networking and IT consulting. The development of made-to-order software is covered through the whole lifecycle starting with specification of requirements, continuing with analysis of requirements, design, implementation and maintenance. In our work, we use standardized practices, modeling techniques, UML modeling tools and an engineering work approach. The company`s specialists with many years of experience in the area of information technologies will be happy to advice you anytime.

About Us

We are a young, dynamically evolving company

founded with aims to satisfy the needs and meet the requirements of Romanian and foreign business partners. The core of the company consists of experts in the area of information technologies specialized in the development of software and network solutions in an internet or intranet environment. Experience from multiple areas of software development, creation and administration of business networks and other activities related to world of information technologies evolved in the year 2006 into a cooperative collaboration and later to the founding of this company. Technical and business sense, were from the start on aimed to cooperate with other companies concerned with communication and business solutions.

Our key concepts 

are fair communication with its partners and high quality products. Among the capabilities of our employees are the development of enterprise solutions built on the Java J2EE or the Microsoft .NET platform; development of client-side applications in the form of a thin, a rich client or a client for mobile platforms; software products tailored to the wishes of the customer build using computer languages of various levels and the design, implementation and administration of computer network infrastructures. For more information, visit the projects and services section.

 

Software Development Principles

The SOLID Principles:

➤ The Single Responsibility Principle

Stated in its most extreme form, the Single Responsibility Principle is that a class should have only one reason to change.

➤ The Open/Closed Principle

This principle states that “Software entities should be open for extension, but closed for modification”.  In other words, you should never change working code. Instead, reuse it somehow (for example, by inheritance) and extend it.

➤ The Liskov Substitution Principle

Code written to use an object of a certain type should not have to change if provided with an object of a derived type.  If you find yourself writing branching logic so that your function does one thing if provided with a base class, but something else for a derived class, you have violated this principle.

➤ The Interface Segregation Principle

an interface with many functions should be broken up into smaller, cohesive parts. Consumers should rely on only one of the mini-interfaces, not on the “fat” whole.

➤ The Dependency Inversion Principle

In an interface-based language, this principle usually finds its expression in the related idea of dependency injection. If class A needs the services of B, it does not construct B. Instead, one parameter to A’s constructor is an interface that describes B. A no longer depends on B, but on its interface. When A is constructed, a concrete B is passed in. B, too, depends on its interface.

 

The DRY Principle

Don’t Repeat Yourself,  every piece of knowledge must appear only once

Scripts to Drop/Recreate All FK in a MSSQL Database

 

 

SELECT
U.CONSTRAINT_NAME,
U.TABLE_SCHEMA,
U.TABLE_NAME,
U.COLUMN_NAME
FROM
INFORMATION_SCHEMA.KEY_COLUMN_USAGE U
INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
ON U.CONSTRAINT_NAME = C.CONSTRAINT_NAME
WHERE
C.CONSTRAINT_TYPE = ‘FOREIGN KEY’
UPDATE @table SET
PrimaryKeyConstraintName = UNIQUE_CONSTRAINT_NAME
FROM
@table T
INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS R
ON T.ForeignKeyConstraintName = R.CONSTRAINT_NAME
UPDATE @table SET
PrimaryKeyConstraintTableSchema = TABLE_SCHEMA,
PrimaryKeyConstraintTableName = TABLE_NAME
FROM @table T
INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
ON T.PrimaryKeyConstraintName = C.CONSTRAINT_NAME
UPDATE @table SET
PrimaryKeyConstraintColumnName = COLUMN_NAME
FROM @table T
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE U
ON T.PrimaryKeyConstraintName = U.CONSTRAINT_NAME

–DROP FK:

SELECT ‘ALTER TABLE [‘ + ForeignKeyConstraintTableSchema + ‘].[‘ + ForeignKeyConstraintTableName + ‘] DROP CONSTRAINT ‘ + ForeignKeyConstraintName + ‘
GO’

FROM
@table

 

–ADD FK

SELECT ‘ALTER TABLE [‘ + ForeignKeyConstraintTableSchema + ‘].[‘ + ForeignKeyConstraintTableName + ‘] ADD CONSTRAINT ‘ + ForeignKeyConstraintName + ‘ FOREIGN KEY(‘ + ForeignKeyConstraintColumnName + ‘) REFERENCES [‘ + PrimaryKeyConstraintTableSchema + ‘].[‘ + PrimaryKeyConstraintTableName + ‘](‘ + PrimaryKeyConstraintColumnName + ‘)
GO’

FROM
@table
GO

Setting up dual network (wireless + LAN)

Find your LAN gateway (in this example is 10.0.22.1)

route delete 0.0.0.0 10.0.22.1
route add 10.0.0.0 mask 255.0.0.0 10.0.22.1

 

if you have other LAN IP-s outside the default mask you should ask them too, for example :

 

route add 129.1.1.187 10.0.49.1

 

automatic mysql db backup

# cd /etc/cron.daily/
# touch /etc/cron.daily/dbbackup-daily.sh
# chmod 755 /etc/cron.daily/dbbackup-daily.sh
# vi /etc/cron.daily/dbbackup-daily.sh

Then copy following lines into file with Shift+Ins

#!/bin/sh
now=”$(date +’%d_%m_%Y_%H_%M_%S’)”
filename=”db_backup_$now”.gz
backupfolder=”/var/www/vhosts/example.com/httpdocs/backups”
fullpathbackupfile=”$backupfolder/$filename”
logfile=”$backupfolder/”backup_log_”$(date +’%Y_%m’)”.txt
echo “mysqldump started at $(date +’%d-%m-%Y %H:%M:%S’)” >> “$logfile”
mysqldump –user=mydbuser –password=mypass –default-character-set=utf8 mydatabase | gzip > “$fullpathbackupfile”
echo “mysqldump finished at $(date +’%d-%m-%Y %H:%M:%S’)” >> “$logfile”
chown myuser “$fullpathbackupfile”
chown myuser “$logfile”
echo “file permission changed” >> “$logfile”
find “$backupfolder” -name db_backup_* -mtime +8 -exec rm {} \;
echo “old files deleted” >> “$logfile”
echo “operation finished at $(date +’%d-%m-%Y %H:%M:%S’)” >> “$logfile”
echo “*****************” >> “$logfile”
exit 0

Installing php, mysql, phpMyAdmin on LinuxMint

sudo apt-get install apache2

sudo apt-get install php5 libapache2-mod-php5

sudo apt-get install mysql-server

apt-cache search pdo|grep php /*find how pdo package is callled)

sudo apt-get install php-db php5-mysql

InnoDB recommended buffer pool

To get the InnoDB recomended pool size

SELECT CONCAT(ROUND(KBS/POWER(1024,
IF(PowerOf1024<0,0,IF(PowerOf1024>3,0,PowerOf1024)))+0.49999),
SUBSTR(‘ KMG’,IF(PowerOf1024<0,0, IF(PowerOf1024>3,0,PowerOf1024))+1,1)) recommended_innodb_buffer_pool_size
FROM (SELECT SUM(data_length+index_length) KBS FROM information_schema.tables
WHERE engine=’InnoDB’) A,
(SELECT 2 PowerOf1024) B;

How to find MSSQL Server Port

DECLARE @tcp_port nvarchar(5)

EXEC xp_regread
@rootkey = ‘HKEY_LOCAL_MACHINE’,
@key = ‘SOFTWARE\MICROSOFT\MSSQLSERVER\MSSQLSERVER\SUPERSOCKETNETLIB\TCP’,
@value_name = ‘TcpPort’,
@value = @tcp_port OUTPUT

select @tcp_port

How to backup all databases from a MSSQL Server to a specific location

The below SQL will provide the backup database instructions needed. It is working on MSSQL 2000 – > 2008

Modify the @PATH variable as needed.

declare @PATH VARCHAR(1000)

SELECT @PATH='\\server_name\database_backup\'

DECLARE @SRVNAME VARCHAR(100)

SELECT @SRVNAME=COALESCe(@@SERVERNAME, 'server_not_defined')

select 'backup database ' + name + ' to disk=''' + @path + @SRVNAME + '_' + name + '.bak'' ' from master..sysdatabases where name not in ('master','tempdb','model','msdb','pubs','northwind')

MSSQL 2000: How to get space used, row count and other table specific informations

/**********************************************************************************************************************
Purpose:
Returns a single result set similar to sp_Space used for all user tables at once.

Notes:
1. May be used as a view, stored procedure, or table-valued funtion.
2. Must comment out 1 “Schema” in the SELECT list below prior to use. See the adjacent comments for more info.

Revision History:
Rev 00 – 22 Jan 2007 – Jeff Moden
– Initital creation for SQL Server 2000
Rev 01 – 11 Mar 2007 – Jeff Moden
– Add automatic page size determination for future compliance
Rev 02 – 05 Jan 2008 – Jeff Moden
– Change “Owner” to “Schema” in output. Add optional code per Note 2 to find correct schema name
**********************************************************************************************************************/
–===== Ensure that all row counts, etc is up to snuff
— Obviously, this will not work in a view or UDF and should be removed if in a view or UDF. External code should
— execute the command below prior to retrieving from the view or UDF.
DBCC UPDATEUSAGE(0) WITH COUNT_ROWS, NO_INFOMSGS

–===== Return the single result set similar to what sp_SpaceUsed returns for a table, but more
SELECT DBName = DB_NAME(),
–SchemaName = SCHEMA_NAME(so.UID), –Comment out if for SQL Server 2000
SchemaName = USER_NAME(so.UID), –Comment out if for SQL Server 2005
TableName = so.Name,
TableID = so.ID,
MinRowSize = MIN(si.MinLen),
MaxRowSize = MAX(si.XMaxLen),
ReservedKB = SUM(CASE WHEN si.IndID IN (0,1,255) THEN si.Reserved ELSE 0 END) * pkb.PageKB,
DataKB = SUM(CASE WHEN si.IndID IN (0,1 ) THEN si.DPages ELSE 0 END) * pkb.PageKB
+ SUM(CASE WHEN si.IndID IN ( 255) THEN ISNULL(si.Used,0) ELSE 0 END) * pkb.PageKB,
IndexKB = SUM(CASE WHEN si.IndID IN (0,1,255) THEN si.Used ELSE 0 END) * pkb.PageKB
– SUM(CASE WHEN si.IndID IN (0,1 ) THEN si.DPages ELSE 0 END) * pkb.PageKB
– SUM(CASE WHEN si.IndID IN ( 255) THEN ISNULL(si.Used,0) ELSE 0 END) * pkb.PageKB,
UnusedKB = SUM(CASE WHEN si.IndID IN (0,1,255) THEN si.Reserved ELSE 0 END) * pkb.PageKB
– SUM(CASE WHEN si.IndID IN (0,1,255) THEN si.Used ELSE 0 END) * pkb.PageKB,
Rows = SUM(CASE WHEN si.IndID IN (0,1 ) THEN si.Rows ELSE 0 END),
RowModCtr = MIN(si.RowModCtr),
HasTextImage = MAX(CASE WHEN si.IndID IN ( 255) THEN 1 ELSE 0 END),
HasClustered = MAX(CASE WHEN si.IndID IN ( 1 ) THEN 1 ELSE 0 END)
FROM dbo.SysObjects so,
dbo.SysIndexes si,
(–Derived table finds page size in KB according to system type
SELECT Low/1024 AS PageKB –1024 is a binary Kilo-byte
FROM Master.dbo.spt_Values
WHERE Number = 1 –Identifies the primary row for the given type
AND Type = ‘E’ –Identifies row for system type
) pkb
WHERE si.ID = so.ID
AND si.IndID IN (0, –Table w/o Text or Image Data
1, –Table with clustered index
255) –Table w/ Text or Image Data
AND so.XType = ‘U’ –User Tables
AND PERMISSIONS(so.ID) <> 0
GROUP BY so.Name,
so.UID,
so.ID,
pkb.PageKB
ORDER BY ReservedKB DESC

Saving windows command prompt history

Unlike Linux the command prompt history is not saved between sessions.
You can see current history by pressing F7 key but as soon as you close the command prompt window that history is gone..
F7history

To save the history to a file for later use just type
doskey /history >c:\history.log