Thursday, July 6, 2023

Email send Using Powershell

$username = 'donotreply@domain.com'

$password = 'XXXXXXXXX'

$body = Get-Content -Path C:\Users\Location.txt -Raw

[SecureString]$securepassword = $password | ConvertTo-SecureString -AsPlainText -Force 

$credential = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $securepassword

Send-MailMessage -SmtpServer 2XX.XXX.xx.xx -Port 587 -From donotreply@domain.com -To email@domain.com -Cc email1@domain.com,email2@domain.com -Subject 'EMAIL SUBJECT' -Body $body  -Credential $credential -Attachments "C:\Users\locationfile.txt"; 




Split the same worksheet by Number of rows in XL

 ALT +F11


Split the same worksheet by Number of rows in XL

Past the sheet VBA code on sheet you wanted to split 


Sub SplitData()


Dim WorkRng As Range


Dim xRow As Range


Dim SplitRow As Integer


Dim xWs As Worksheet


On Error Resume Next


xTitleId = "KutoolsforExcel"


Set WorkRng = Application.Selection


Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)


SplitRow = Application.InputBox("Split Row Num", xTitleId, 5, Type:=1)


Set xWs = WorkRng.Parent


Set xRow = WorkRng.Rows(1)


Application.ScreenUpdating = False


For i = 1 To WorkRng.Rows.Count Step SplitRow


    resizeCount = SplitRow


    If (WorkRng.Rows.Count - xRow.Row + 1) < SplitRow Then resizeCount = WorkRng.Rows.Count - xRow.Row + 1


    xRow.Resize(resizeCount).Copy


    Application.Worksheets.Add after:=Application.Worksheets(Application.Worksheets.Count)


    Application.ActiveSheet.Range("A1").PasteSpecial


    Set xRow = xRow.Offset(SplitRow)


Next


Application.CutCopyMode = False


Application.ScreenUpdating = True


End Sub

Wednesday, October 9, 2013

ORA-01940: cannot DROP a user that is currently logged in

SQL> DROP USER MYUSER CASCADE;

 

ORA-01940: cannot DROP a user that is currently logged in 

 

To Find The Currently Connected Users

 

SQL> SELECT S.SID, S.SERIAL#, S.STATUS, P.SPID 

FROM V$SESSION S, V$PROCESS P 

WHERE S.USERNAME = 'MYUSER' 

AND P.ADDR (+) = S.PADDR;

Important Oracle 11g changes to alter session kill session

Important Oracle 11g changes to alter session kill session

SQL> select inst_id,sid,serial# from gv$session where username='MYUSER';
   INST_ID        SID    SERIAL# 
---------- ---------- ---------- 
         1        36        11593
SQL>  alter system kill session '36, 11593,1'; 
 alter system kill session '36,
11593,1' 
* 
ERROR at line 1: 
ORA-00026: missing or invalid session ID
Now, it works:
SQL>  alter system kill session '36,11593,@1';
Check the jobs on below query
SQL>  select job from dba_jobs where log_user='MYUSER';
no row found

REFERENCE

Else 

SQL>select s.sid, s.serial#, s.status, p.spid from v$session s, v$process p where s.username = 'MYUSER' and p.addr (+) = s.paddr;

SID           SERIAL# STATUS    SPID

----------   ----------    --------       ------------
168               26          INACTIVE 4567318

SQL>!kill -9 4567318           - (kill the process in OS level)


Saturday, October 5, 2013

පැන මඩ කඩිති වැව් තාවලු වැහි කාලේ....

පැන මඩ කඩිති වැව් තාවලු වැහි කාලේ
පෙන්නා මග නොමග නොවැටී යන තාලේ
සිප් කිරි පෙවූ මූසිලයින් උඩු මාලේ
අපෙ ගුරුතුමා යයි තාමත් ඉස්කෝලේ

සාමා අමර විකුණති බස් පොළේ කජු
කුමාරෝද පිටු දන් දෙති එයින් මතු
උගත මනා ශිල්පය පිල් කඩ නොපැතූ
වේවැල වටා ඉකිබිඳ දඬුවමක් පැතූ

රන්මසු පටපිළී අබරණ උරණ වෙලා
සමන්පිච්ච කැකුළිය ගෙයි මිලින වෙලා
ගුරු නිවහනේ කඳුලට උල්පතක් වෙලා
ලොකු හාමිනේ ඇත බිතු සිතුවමක් වෙලා

ගී පද - මහින්ද චන්ද්‍රසේකර
ගී තනු- රෝහණ වීරසිංහ
ගායනය - සුනිල් එදිරිසිංහ

Friday, September 27, 2013

Theoretical Framework / Kinds of Personnel Research/ Cases and Variables

Theoretical  Framework

A theoretical framework is a collection of interrelated concepts, like a theory but not necessarily so well worked-out. A theoretical framework guides your research, determining what things you will measure, and what statistical relationships you will look for.
Theoretical frameworks are obviously critical in deductive, theory-testing sorts of studies (see Kinds of Research for more information). In those kinds of studies, the theoretical framework must be very specific and well-thought out.
Surprisingly, theoretical frameworks are also important in exploratory studies, where you really don't know much about what is going on, and are trying to learn more. There are two reasons why theoretical frameworks are important here. First, no matter how little you think you know about a topic, and how unbiased you think you are, it is impossible for a human being not to have preconceived notions, even if they are of a very general nature. For example, some people fundamentally believe that people are basically lazy and untrustworthy, and you have keep your wits about you to avoid being conned. These fundamental beliefs about human nature affect how you look things when doing personnel research. In this sense, you are always being guided by a theoretical framework, but you don't know it. Not knowing what your real framework is can be a problem. The framework tends to guide what you notice in an organization, and what you don't notice. In other words, you don't even notice things that don't fit your framework! We can never completely get around this problem, but we can reduce the problem considerably by simply making our implicit framework explicit. Once it is explicit, we can deliberately consider other frameworks, and try to see the organizational situation through different lenses.

Kinds of Personnel Research


There are many kinds of personnel research. Three dimensions are particularly important in classifying types of research:
Applied vs Basic research. Applied research is research designed to solve a particular problem in a particular circumstance, such as determining the cause of low morale in a given department of an organization. Basic research is designed to understand the underlying principles behind human behavior. For example, you might try to understand what motivates people to work hard at their jobs. 

Exploratory vs Confirmatory. Exploratory research is research into the unknown. It is used when you are investigating something but really don't understand it all, or are not completely sure what you are looking for. It's sort of like a journalist whose curiousity is peaked by something and just starts looking into something without really knowing what they're looking for. Confirmatory research is where you have a pretty good idea what's going on. That is, you have a theory (or several theories), and the objective of the research is to find out if the theory is supported by the facts.

Quantitative vs Qualitative. Quantitative studies measure variables with some precision using numeric scales. For example, you might measure a person's height and weight. Or you might construct a survey in which you measure how much respondents like President Clinton, using a 1 to 10 scale. Qualitative studies are based on direct observation of behavior, or on transcripts of unstructured interviews with informants. For example, you might talk to ten female executives about their the decision-making process behind their choice to have children or not, and if so, when. You might interview them for several hours, tape-recording the whole thing, and then transcribe the recordings to written text, and then analyze the text.
As a general rule (but there are many exceptions), confirmatory studies tend to be quantitative, while exploratory studies tend to be qualitative.


Cases and Variables
Cases are objects whose behavior or characteristics we study. Usually, the cases are persons. But they can also be groups, departments, organizations, etc. They can also be more esoteric things like events (e.g., meetings), utterances, pairs of people, etc.
Variables are characteristics of cases. They are attributes. Qualities of the cases that we measure or record. For example, if the cases are persons, the variables could be sex, age, height, weight, feeling of empowerment, math ability, etc. Variables are called what they are because it is assumed that the cases will vary in their scores on these attributes. For example, if the variable is age, we obviously recognize that people can be different ages. Of course, sometimes, for a given sample of people, there might not be any variation on some attribute. For example, the variable 'number of children' might be zero for all members of this class. It's still a variable, though, because in principle it could have variation.
In any particular study, variables can play different roles. Two key roles are independent variables and dependent variables. Usually there is only one dependent variable, and it is the outcome variable, the one you are trying to predict. Variation in the dependent variable is what you are trying to explain. For example, if we do a study to determine why some people are more satisfied in their jobs than others, job satisfaction is the dependent variable.
The independent variables, also known as the predictor or explanatory variables, are the factors that you think explain variation in the dependent variable. In other words, these are the causes. For example, you may think that people are more satisfied with their jobs if they are given a lot of freedom to do what they want, and if they are well-paid. So 'job freedom' and 'salary' are the independent variables, and 'job satisfaction' is the dependent variable. This is diagrammed as follows:
(yes, I know. It looks like the Enterprise)
There are actually two other kinds of variables, which are basically independent variables, but work a little differently. T
Extraneous Variables
Extraneous Variables are undesirable variables that influence the relationship between the variables that an experimenter is examining. Another way to think of this, is that these are variables the influence the outcome of an experiment, though they are not the variables that are actually of interest. These variables are undesirable because they add error to an experiment. A major goal in research design is to decrease or control the influence of extraneous variables as much as possible. 

Say you wanted to work out how clever a fish species were in finding food depending on how long since they had eaten. But if their ability to find food also depended on the temperature of the water and you were not able to either control or measure accurately the temperature of the water. Then the temperature could be described as an extraneous variable.


References
http://www.analytictech.com/mb313/elements.htm
http://www.analytictech.com/mb313/kinds_of_research.htm
http://answers.yahoo.com/question/index?qid=20060920114809AAku0iK


Research




  According to John W. Best, "Research may be defined as the systematic and objective analysis and recording of controlled observations that may lead to the developments of generalizations, principles, or theories, resulting in prediction and possibly ultimate control or events."
  Research fulfills the gap of knowledge.

Research Process

  Realizing             
  Problem identification
  Theoretical framework
  Hypothesis formulation
  Research design
  Collection of data
  Data analysis and interpretation and
  Generalization of data
Scientific Research

  Science is the study of the structure and behaviour of the physical and natural world in systematic manner specially through observation and experiment.
  Results of science are developed from
  Observation and experiments
  They have the relationship of Cause and effect.
  Able to tested and retested
  Universally true principle
  So the result of Scientific Research
  Rigid
  Empirically testable
  Clearly defined variables
  Facilitates Direct observation and Correction
   Have fixed answer (Objectivity)
  Replicability (Can be tested again and again)
  Scientific research is focused goal of problem solving.It follows certain scientific steps, methods and it has the nature of replicability.

Characteristics of scientific research

  Its primary goal is to pursuit of truth as determined by logical consideration.
  The following are the main key characteristics:
1.       Purposiveness:
2.       Objectivity:
3.       Replicability
4.       Reliability
5.       Validity
6.       Rigor
7.       Testability and generality
Conclusion

  Scientific research follows  scientific  methods and tools  to explains its variable.
  So it is true to say that "Scientific research relies  on Real science rather than Idle science"