Thursday, January 24, 2013

Salary hike..a or b ?



Want to give a salary hike? Think again

Salary hike is something which is risky, and has bigger impact on business. In any organization there are basically 3 types of employees and to meet individual's expectation it's important to know what the best managed way is. The best method to give a hike is to measure their motivation than productivity and tasks completed.

a) Money motivated employees - Few employees measure their work on monetary value. If someone offers a small better pay, they will make their way to exit. The more they work, more they wish to be paid. Simple way to handle these guys is measuring their accomplishments in terms of "money added to profit" and with respect to that hike should be made. For manager level employees there must be incentives based on productivity. For core employees on lower level should be used as motivation - giving them a plan. For example giving them a variable pay directly proportional to the profit made by organization.

b) Work motivated employees- Well; they are in organization because they love their work. As soon as they love it, money is not important for them. Best method can be direct question – “what’s their need.” Remember they never ask some thing over limit, they know what their limit is, so without any negotiation give them what they want.

c) Routine employees- They are just there, so keep them there. Measure their value in team and then negotiate, negotiate, negotiate... Anyways if they leave, there will not be a big impact so risk can be taken on this.

Friday, November 30, 2012

sync contacts for free from gmail / anyother account to iPhone 4s.

Simple tip to sync contacts for free from gmail / anyother account to iPhone 4s.

  • Save you contacts i.e. export in to .vcf format. Gmail/Outlook allows it to export contacts in vcf format-
  • Now send a mail to self gmail account with this file as attachment.  
  • Access iPhone 4s, go to Mail & contacts, add your gmail account using add account option.
  • Now fetch your gmails on your iphone.  Once you see the attachment with mail open it.
  • Try to open attachment it will ask to import / merge with existing or add new contacts….. 



  • and you are done…! A minimum of 3$ saved.


Enjoy …

Thursday, June 7, 2012

CODICE SCONTI

i got some coupons to share

Kamiceria   Valid till 14/02/2013   20% OFF  with code KNW20
Spartoo.it  valid till 14/02/2013   15% OFF with code MDWIT12
efiori.com  valid till 14/02/2013   10€ OFF wit hcode NDW2012
chegioci.it valid till 14/02/2013   10€ OFF with code CHEGIOMDW10
pixmania    valid till 14/02/2013   10€ OFF with code pixofferta10
kiabi.it    valid till 14/02/2013   10€ OFF with code NDW13

Tuesday, June 5, 2012

Alter Table Column Varchar to date

Altering a table column from varchar to datetime is pretty straight-forward in the SQL Server Management Studio (SSMS), until you look at the tsql generated.  For many operations SSMS will generate a tsql script that will:
  • create a temporary table
  • drop all the foreign keys
  • copy the data to the temporary table
  • create the new table with the correct data type
  • copy the data to the new table
  • drop the temporary table
  • add the foreign keys back
That is a lot of operations and on a really large table of millions of rows may take a very long time to complete.
SQLCricket comments that it is possible to change the options in SSMS to warn on table operations, i think this is only in sql 2K8.
SQLPuma comments that it is possible to change a varchar() to a datetime via tsql with an alter table alter column command.
In this particular case we were modifying a varchar(10) to a datetime.  All the data was in a valid format.  The easiest method is to alter the column, another method to complete this is to:
  • rename the existing column (tmp_varchar etc)
  • add a new column with the correct name
  • update the new column (in batches if necessary)
  • drop the original column (now with a tmp_name)
This is very quick, much safer operation and is much "nicer" to the database log file.  Example of tsql is below:
CREATE TABLE dbo.testing
(test_id bigint NOT NULL IDENTITY (1, 1) primary key,
some_dt varchar(10)
)
GO

insert into testing (some_dt) values ('2009-01-01')
insert into testing (some_dt) values ('2009-01-02')
insert into testing (some_dt) values ('2009-01-03')
insert into testing (some_dt) values ('2009-01-04')
go

EXECUTE sp_rename 'dbo.testing.some_dt', 
    'Tmp_some_dt', 'COLUMN' 
GO

Alter Table testing
Add some_dt DateTime Default('1900-01-01') NOT NULL
GO

Update testing
    Set some_dt = Convert(DateTime,Tmp_some_dt)
GO

Alter Table testing
    DROP Column Tmp_some_dt
GO

select * from testing
go

--drop table testing

Friday, May 25, 2012

Windows TASK creation automatically

SCHTASKS

Create, delete, edit, list, start or stop a scheduled task.
Works on local or remote computers.
Syntax:

   SCHTASKS /Create [Connect_Options] Create_Options /TN taskname

   SCHTASKS /Delete [Connect_Options] /TN taskname [/F]

   SCHTASKS /Query  [Connect_Options] [/FO format] [/NH] [/V]

   SCHTASKS /Run [Connect_Options] /TN taskname

   SCHTASKS /End [Connect_Options] /TN taskname

   SCHTASKS /Change [Connect_Options] {[/RU username] [/RP password] [/TR taskrun]} /TN taskname

 Connect_Options:
     /S system                      # Remote system (default is local)
    [/U username [/P password]]     # Submit job under this name

 Create_Options:
    /TR taskrun                     # Pathname of the executable to run
    /ST starttime                   # HH:MM:SS (24 hour)
    [/RU username [/RP password]]   # Run job as this user
    /SC schedule [/MO modifier]     # When to run, see below
    [/D day]                        # Day = MON,TUE,WED,THU,FRI,SAT,SUN
    [/M months]                     # Month=JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC.
    [/I idletime]                   # 1 - 999 minutes (ONIDLE task only)
    [/SD startdate] [/ED enddate]   # Start and end date "dd/mm/yyyy"

 options:
    /TN   A name for the task
    /F    Force delete, ignore warnings even if the task is currently runnning.
    /FO   Output format: TABLE, LIST, CSV
    /NH   No header
    /V    Verbose output
Notes:
For MONTHLY schedules give the DAY as a number 1 - 31 (default=1)

To prompt for the password, specify /RP * or /RP none
The User Account under which the Schedule service runs may require specific file access permissions, user permissions and drive mappings.
If the /RU username and /RP Password parameters match the currently logged-in user, the task will run interactively (visible in the foreground).

For the system account, /RU username can be written as "", "NT AUTHORITY\SYSTEM" or "SYSTEM", a Password is not required. The system account has full access to the local machine but has no permissions on any other machines (or mapped drives) across the Network.
/SC schedule  The schedule frequency.
Valid schedules: MINUTE,HOURLY,DAILY,WEEKLY,MONTHLY, ONCE,ONSTART,ONLOGON,ONIDLE.

/MO modifiers allow finer control:

    MINUTE:  1 - 1439 minutes.
    HOURLY:  1 - 23 hours.
    DAILY:   1 - 365 days.
    WEEKLY:  1 - 52 weeks.
    ONCE:    No modifiers.
    ONSTART: No modifiers.
    ONLOGON: No modifiers.
    ONIDLE:  No modifiers.
    MONTHLY: 1 - 12, or FIRST, SECOND, THIRD, FOURTH, LAST, LASTDAY.
Power Saving
The property for "Wake up the machine to run this task" cannot be set using schtasks, but this property is essential if you need the task to run on a machine that has PowerSaving enabled.
To work around this, create a task on one computer using the control panel GUI. This will create a .job file in C:\%windir%\Tasks\
To replicate the scheduled task onto other machines copy the .JOB file to C:\%windir%\Tasks on each machine.

This techique will not retain any system account credentials, so if you need to run the tasks under System, run the following after copying the .JOB file:
SCHTASKS /CHANGE /RU "NT Authority\System" /TN "Yourtaskname"
Examples:
Create a task to run at 11 pm every weekday
SCHTASKS /Create /SC weekly /D MON,TUE,WED,THU,FRI /TN MyDailyBackup /ST 23:00:00 /TR c:\backup.cmd /RU MyDomain\MyLogin /RP MyPassword
Now delete the task:
SCHTASKS /Delete /TN "MyDailyBackup" /f
Create a daily task to run a script at 5 pm:
SCHTASKS /create /tn "My Script" /tr "\"c:\my folder\script.cmd\" arguments" /sc daily /sd 12/29/2008 /st 17:00
Task Scheduler options are stored in the registry
HKLM\SOFTWARE\Microsoft\SchedulingAgent\

Wednesday, May 16, 2012

PHP Functional testing selenium

Sample for selenium settings -

down selenium RC channel from the selenium.org. Place it in same PHP folder for better faster/access. Run the command
CMD> java   -jar   YOUR SELENIUM JAR FILE PATH

now you are done server is running. Change the WebTestCase.php or your php file for proper linking. Run the command

cmd> phpunit functional/yourtest.php

if you find some issues with browser linking do the following in the phpunit.xml or your config file

    <selenium>
        <browser name="Internet Explorer" browser="*iexplore" ></browser>
        <browser name="Firefox" browser="*firefox C:\Program Files\Mozilla Firefox 4.0 Beta 10\firefox.exe" />
        <browser name="Google Chrome" browser="*googlechrome C:\Program Files\Google\Chrome\Application\chrome.exe" />
    </selenium>


by above way you can add any browser using * (Asterisk) in the front and then full path.


;) enjoy

YII Unit test troubleshooting FATA ERROR : Class not found Error

Recently i started using YII Framework, its so amazing. While using unit tests i found some issues and wasted a lot of time for tuning it. Here is my observations which worked at the end on WINDOWS machine -


ASSUMPTIONS -
a) you have pear installed
b) PHP xdebug installed [pls follow my other post http://usemytips.blogspot.it/2012/05/php-xdebug-installation-simplest-method.html ]




Lets start the magic -


STEP 1 --------------------------------


UPDATE PEAR - using your command prompt update PEAR 


 cmd> pear channel-update pear.php.net


 cmd> pear list-upgrade




now for all upgrades listed above follow the upgrades by using command 


cmd> pear install -f pear.php.net/XXXX    [where XXXX is upgrade name listed from above command for example if pear upgrade is needed the command will become 


cmd> pear install -f pear.php.net/PEAR




STEP 2 --------------------------------


UPDATE/INSTALL PHPUNIT - using your command prompt update/install phpunit 


[UPGRADE]
 cmd> pear channel-update pear.phpunit.de


 cmd> pear list-upgrade


[INSTALL]
cmd> pear install -f  pear.phpunit.de /PHPUnit    




OK, now you have installed phpunit, updated Pear libs, and hopefully x-debug working well. All are PHP version dependent so make sure that they are compatible.


STEP 3 ------check your PHP.ini for include_path, it must have the pear/phpunit pointers in it. like 


include_path="C:\php;c:\php\pear;C:\php\pear\phpunit"






 STEP 3 ---------------------YII integration-----------


make sure that your /protected/tests/bootstrap.php has all file pointers set to locate yiii.php. from your command prompt locate the tests folder -


cmd > cd C:\YOUR YII ROOT\YOUR WEB APP\protected\tests  [ENTER]


C:\YOUR YII ROOT\YOUR WEB APP\protected\tests> php unit/DbTest.php   [ENTER]




 remember php bold and large is for php command [location of php.exe]. If someone have different directory structure installation it can be 


C:\YOUR YII ROOT\YOUR WEB APP\protected\tests> YOURDRIVE\PHP EXEPATH  unit\DbTest.php  




[NOTE - If you get error that php is not a suffix for php.exe just run a command in php


CMD>pear   config-set    php_suffix   .exe