SCJP: Java Operators #SCJP

By Sayed

Exams like SCJP test your understanding of Java operators and how to use them like:
assignment operators: =, +=, -=
arithmetic operators: +, -, *, /, %, ++, —
relational operators: <, <=, >, >=, ==, !=
logical operators: &, |, ^, !, &&, ||
conditional operators: ? :
Also operators to check the equality of two objects or two primitives

In the following table operators and their precedences are shown. Upper rows operators have higher precedence. Same row operators have equal precedence. For equal precedence operators, All binary operators except the assignment operators work from left to right while assignment operators work from right to left.

 

Operator Precedence
Operators Precedence
postfix expr++ expr--
unary ++expr --expr +expr -expr ~ !
multiplicative * / %
additive + -
shift << >> >>>
relational < > <= >= instanceof
equality == !=
bitwise AND &
bitwise exclusive OR ^
bitwise inclusive OR |
logical AND &&
logical OR ||
ternary ? :
assignment = += -= *= /= %= &= ^= |= <<= >>= >>>=

The following quick reference summarizes the operators supported by the Java programming language.

Simple Assignment Operator

=	Simple assignment operator

Arithmetic Operators

+ 	Additive operator (also used for String concatenation)
- 	Subtraction operator
*	Multiplication operator
/ 	Division operator
%	Remainder operator

Unary Operators

+ 	Unary plus operator; indicates positive value (numbers are positive without this, however)
- 	Unary minus operator; negates an expression
++  	Increment operator; increments a value by 1
--    	Decrement operator; decrements a value by 1
!     	Logical compliment operator; inverts the value of a boolean

Equality and Relational Operators

==	Equal to
!=	Not equal to
>	Greater than
>=	Greater than or equal to
<	Less than
<=	Less than or equal to

Conditional Operators

&& 	Conditional-AND
|| 	Conditional-OR
?:      Ternary (shorthand for if-then-else statement)

Type Comparison Operator

instanceof	Compares an object to a specified type 

Bitwise and Bit Shift Operators

~	Unary bitwise complement
<<	Signed left shift
>>	Signed right shift
>>>	Unsigned right shift
&	Bitwise AND
^	Bitwise exclusive OR
|	Bitwise inclusive OR

From: http://sitestree.com/?p=3643
Categories:SCJP
Tags:
Post Data:2016-07-17 08:33:36

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Resources: PXE Boot, PXE Network, PXE Network Security, PXE Boot Over the Internet #Security #By Sayed Ahmed #Misc. Reading

PXE Boot:

Boot your computer over the network, load boot image from a PXE server.
Your computer BIOS will have an option to enable PXE boot. If you are not using PXE boot i.e. Network Boot, it is recommended that you keep it disabled.
One note: In your “my computer” properties, there is an option to enable or disable : allow remote access. Keep it turned off.

Anyway, how to use PXE and How to Configure PXE based Network
You can check one discussion and video at : http://www.howtogeek.com/57601/what-is-network-booting-pxe-and-how-can-you-use-it/ (I did not check; so do not know how good or bad it is)
On 2001, I was part of setting up a network based on PXE.

Advantages of PXE Network:
http://serverfault.com/questions/606229/kvm-advantages-of-installing-from-pxe

Works on real servers as well as virtual ones without changing anything, so you need to set-up the infrastructure only once.
It’s easy to automate installations from start to finish (technically possible with DVDs but usually requires more work)
Once you have the infrastructure set-up, adding a new version of your distribution or some alternative install method is a piece of cake
No losing of DVDs, USB sticks, etc.
I find it’s faster than installing from local media; my network can provide the packages faster than optical drives and most USB sticks.



PXE can help in deploying aspect of applications
https://technet.microsoft.com/en-us/magazine/2008.07.desktopfiles.aspx

Can you use PXE over the internet.
it might be possible though implement strict security
http://www.computerhope.com/forum/index.php?topic=133268.0

Security risks for PXE:

Some Security Risks for PXE

https://technet.microsoft.com/en-ca/library/cc755837(v=ws.10).aspx
“PXE does not provide a way to prevent an unknown server from performing remote installations on PXE-enabled client computers. If a server can establish a connection with the clients, it can perform remote installations on them.

PXE does not provide a way to fully prevent packet spoofing. This means that packets sent by an attacker could be received by a client computer and incorporated into that client computer’s installation.

PXE does not provide a way to prevent an unknown PXE-enabled computer from installing from a server if the PXE-enabled computer can connect to the network. RIS provides some security not inherent in PXE, however, because RIS performs remote installation only after the user has logged on. A user who lacks a valid user name and password cannot use RIS to perform an installation.

In addition, you can achieve a somewhat greater degree of security with RIS if you pre-stage your client computers and configure your RIS servers to respond only to known (pre-staged) clients. Then, if an intruder succeeds in connecting an unknown, PXE-enabled client computer to your RIS server, no installation files will be sent to that client computer. The intruder will not gain information about the configuration you use on your RIS client computers. For more information about pre-staging, see Pre-stage client computers.”

http://www.symantec.com/connect/articles/what-security-risks-are-associated-using-pxe-and-how-can-i-reduce-them

 

Understanding Security Considerations for the PXE Boot Process in Windows HPC Server 2008 R2

https://technet.microsoft.com/en-us/library/gg250682(v=ws.10).aspx

 

Discussion on security concerns for PXE

http://security.stackexchange.com/questions/64915/what-are-the-biggest-security-concerns-on-pxe

 

Providing Security for PXE environment

  • Use a firewall, and configure it appropriately.
  • Use appropriate auditing and monitoring to detect intrusions into the network.
  • Restrict physical access to the network.
  • Use strong passwords throughout your organization.
  • Follow other best practices for secure networks.

 

” From: http://sitestree.com/?p=2132
Categories:Security, By Sayed Ahmed, Misc. Reading
Tags:
Post Data:2015-08-06 12:20:29

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

search engine optimization and google webmaster tools #SEO

https://www.youtube.com/watch?feature=player_embedded&v=F61jEGNWs1I From: http://sitestree.com/?p=2621
Categories:SEO
Tags:search engine optimization, google webmaster, SEO
Post Data:2015-10-19 00:51:51

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Software Testing Basics #Software Development #Root #Software Testing #By Sayed Ahmed

Software Testing Basics

Note: Different testing strategies are described here. In practice, a detail test plan is helpful that may be formed with a subset of these strategies [and delivered to the testers] according to the need of the customers, and the company policies.

Five Fold Testing System

Any testing can be described in five dimensions:
1. Testers: Who does the testing?
2. Coverage: What needs to be tested? function, domain, extreme value?
3. Potential Problems: Why you are testing?
4. Activities: How you test?
5. Evaluation: How to measure the success of testing?

Some Forms of Testing

1. Function testing: Test all functions
2. Extreme Value Testing: Test for errors when extreme values of the variables are used
3. beta testing: make other people test your product

All testing involve five dimensions. When we tell to do function testing, we can list: who will do the test (programmers, testers, users of the product, internal employees), what needs to be tested like functions, what kind of problems they need to address such as pass by value or pass by reference, test method, evaluate your test

People Based Techniques

1. User Testing: Tests by the real users of the product
2. Alpha testing: By Test team, firendly insiders
3. Beta testing: Not insiders, not clients, but may be part of the target market, volunteers
Design Beta tests: appraise the design
marketing beta tests: to justify will customers buy the product?
compatibility beta tests: test hw/sw platform compatibility
4. bug bashes: in house testing, just before release one full day/half day testing
5. subject matter testing: give an expert on the subject to use and test the product
6. Paired testing: two person together do the tests and shares ideas
7. eat your own dogfood: use the software in-house for your own purpose and check reliability

Coverage based testing

1. Function testing: Test each function
White box function testing: testing in respect of code
Black box function testing: test functions in respect of features and commands
2. Function integration testing: test several functions together
3. Menu tour: check all menu items, all available choices
4. Domain testing: Test variable domains and their effect on functions. Find the possible values that a variable can take, classify the value domain, take representative values from each domain, test the variables and related functions
5. Equivalence class analysis: find equivalent domains and tests for one of them
6.Boundary test: Check for smallest and largest values for a variable
7. best representative testing
8. input field test catalogs or matrices
9. Map and test all the ways to edit a field
10. Logic testing: use logics like if then else. cause effect graphing is used for logic based testing
11. state based testing:
12. Path testing: All possible paths to come/go to a state
13. Statement and branch coverage: execute all statements and all branching
14. Configuration coverage: test how many types of printers your software support
15. Specification based testing: Test all claims made in the manual/specification
16. Requirements-based testing: test if all requirements are met
17. combination testing: testing two or more variables in combination with each other

Problems based techniques
1. Input constraints Tests: Check what kinds of input the program can handle. Also check input error protection
2. Output constraints: The inputs are legal but check if they lead to corresponding out value
3. computation constraints : the program may fail while calculating a value
4. Storage constraints: out of memory tests, too big output file to process
5. timimg: race condition, ordering of events

Activity based Testing

How you test?
1. Regression Testing: Test the same issue again.
a. Bug fix regression : bug is fixed but do the test again to prove the bug is not fixed
b. old bugs regression: new bug fix has unfixed old bugs. so test again
c. side effect regression/stability regression : the bug fix has created new bugs/side effects
2. Scripted Testing: execute step by step methods written by senior tester
3. smoke testing : kind of side effect regression testing. but test to prove that no side effect has come. show everything is working. assume may be some simple stuffs have caused the problems not the bug fix. if you can not prove then the new bug fix has created new errors
4. exploratory testing: keep the testers known about the project, product, market, risks. So new tests will be stronger than earlier ones as experience is more
5. guerilla testing: a fast and extensive exploratory test done by senior tester. test whole day a particular part extensively and decide if that area needs much/more testing or can be ignored
6. scenario testing:
a. test what the customer will really do
b. complex feature testing
c. easy to decide success/failure

tests that come from use cases.

7. Installation testing: install in various platform, in different methods, check the files, check if the program works?, check uninstallation
8. Load testing: Test the system at high enough load
9. long sequence testing: run the program for days, weeks. problems like wild pointers, memory leaks, stack overflows, and bad interaction among multiple features are caught by this duration testing
10. Performance testing: test the speed/efficiency of the software. A significant change in speed from time to time is a bad indication and the software need to be optimized

Evaluation based testing
Methods to determine if a test has passed or failed
1. Self verifying data:
2. compare with saved results: if results vary over the week/day, something is wrong
3. compare with specification: mismatch with the specification, failure
4. consistency:
a. with history: software behavior consistent with past behavior?
b. with company image: matches with the image that company focuses on?
c. with claims: does what it is supposed to do
d. user’s expectations: meets users expectations
e. within product: consistent with other functions
f. purpose: consistent with it’s purpose?
From: http://sitestree.com/?p=282
Categories:Software Development, Root, Software Testing, By Sayed Ahmed
Tags:
Post Data:2013-04-26 03:29:34

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Waterfall Software Life Cycle Model Features and Risks Software Engineering Tutorial #Software Development #SDLC

http://www.youtube.com/watch?v=p6vW84Pq-Uc From: http://sitestree.com/?p=154
Categories:Software Development, SDLC
Tags:
Post Data:2013-01-01 15:25:49

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Installing Visual Studio 2012 #Software Development #Web Development #Root #By Sayed Ahmed

Download following from the Internet and install before start installing Visual Studio 2012

Otherwise you may face issues…

Visual Studio 2012 Update 1 – Online install from link provided on top of document

Team Explorer for Visual Studio 2012

Team Explorer Everywhere for TFS 2012 with Update 1

.NET 4.5

Agents for Microsoft Visual Studio 2012 Update 1

IntelliTrace Collector for Visual Studio

Feedback Client for TFS – Online install from link provided on top of document

C++ Redistributable for Visual Studio 2012 Update 1

Visual Studio 2012 Shell

Visual Studio 2012 SDK From: http://sitestree.com/?p=354
Categories:Software Development, Web Development, Root, By Sayed Ahmed
Tags:
Post Data:2013-08-30 00:03:23

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

PHP Date Time Examples #Software Development #Web Development #Root #By Sayed Ahmed

You can use the following code where users can select a date range from a drop down with quick dates. Very often, you will also need a date range calendar; you can use jquery date picker tool for the purpose.

if ($quickDates==”today”){
$dateFrom = date(“Y-m-d”);
$dateTo = date(“Y-m-d”, time() + 60 * 60 * 24);
}else if ($quickDates==”yesterday”){
$dateFrom = date(“Y-m-d”, time() – 60 * 60 * 24);
$dateTo = date(“Y-m-d”);
}else if ($quickDates==”lastWeek”){
$dateFrom = date(“Y-m-d”, time() – 7*60 * 60 * 24);
$dateTo = date(“Y-m-d”);
}else if ($quickDates==”thisMonth”){
$dateFrom = date(“Y-m-1”);
$dateTo = date(“Y-m-d”,strtotime(“+1 months”));
}else if ($quickDates==”lastMonth”){
$dateFrom = date(“Y-m-d”,strtotime(“-1 months”));
$dateTo = date(“Y-m”);
}else if ($quickDates==”allTime”){
$dateFrom = “all”;
$dateTo = “all”;
}

You can utilize this range in a query as follows

$dateFilter = “”;
if ($dateFrom != “all”){
$dateFilter = ” where ( date >= ‘$dateFrom’ and date < ‘$dateTo’) “;
}

$sql = ” select * from table $dateFilter order by date desc”;

HTML for a quick date selector can be as folows:

<select id=’cmbQuickDates’ name=’cmbQuickDates’>
<option value=”>Select</option>
<option value=’today’>Today</option>
<option value=’yesterday’>Yesterday</option>
<option value=’lastWeek’>Last week</option>
<option value=’thisMonth’>This month</option>
<option value=’lastMonth’>Last month</option>
<option value=’allTime’>All time</option>
<{/select> From: http://sitestree.com/?p=147
Categories:Software Development, Web Development, Root, By Sayed Ahmed
Tags:PHP, Date
Post Data:2013-01-01 05:52:23

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

How to Secure Your .Net Applications #Software Development #Web Development #Root #By Sayed Ahmed

How to Secure Your .Net Application

  • Use multiple levels of security: Physical Level (data center security), Network Level (firewall), Operating System Level (accounts, trust level), Web Server Level (use virtual directory), Web Application Level (authentication, authorization), Database Level (different accounts to perform different types of database operations), Data Level (encrypt sensitive data), use Best Practices (prevent SQL Injection and XSS)
  • Use separate database servers than the web server (in general more secure but not the better choice always, you may need to consider pros and cons between performance and security, your future scalability requirements, application requirements).
  • Take security measures in terms of accounts and trust levels on who can access the physical machine and from where and how
  • Control the permissions for the account under which the web-application is running. (Ole DB, Registry, File/IO)
  • Configure IIS for anonymous access. use IIS_machinename system account with limited access
  • Configure web-pages to require authentication whose information you want not to be available publicly
  • Use database based authentication for internet applications
  • Use role level security; also use page level and control level security. Control access to the feature, control access to the page, also control access to the controls
  • For the database operations, based on the user permission level, use separate database accounts to perform database operations. When user has read only access, use a db user that only has read only operation permission on the database.
  • Use database based accounts; do not use windows based authentication
  • Never trust user input, avoid dynamic SQL, do not use the admin account to perform database operations, encrypt the sensitive data stored in the database,
  • Display custom error messages to the user. Do not display system generated error messages to the user
  • Encode and quote user input. Do not provide feature for end users to create dynamic SQLs.
  • Always validate data, check for data types as well.
  • set HTMLEncodeValue = true
  • Use SSL
  • Use POST and Session avoid using Get and Cookies
  • Encrypt URL parameters using key based encryption
  • Do not decrypt data for validation checking but encrypt and compare
  • Encrypt all sensitive data

  From: http://sitestree.com/?p=131
Categories:Software Development, Web Development, Root, By Sayed Ahmed
Tags:.Net, .Net Applications, Secure, security
Post Data:2012-12-11 04:58:19

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Skills required for an Advanced Database Designer/Architect role (or for a data modeler role) #Software Development #Web Development #Root #Miscellaneous #By Sayed Ahmed

ER Studio
ERWin
Powerdesigner
DbVisualizer
star-schemas
snow-flake
3NF relational models
logical modeling
enterprise database design From: http://sitestree.com/?p=357
Categories:Software Development, Web Development, Root, Miscellaneous, By Sayed Ahmed
Tags:
Post Data:2013-08-30 00:07:09

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Configure Netbeans IDE for Debugging [PHP platform] #Software Development #Web Development #Root #PHP #Web Testing #Mobile Development #By Sayed Ahmed

Presentation slides on this topic: click

To enable xdebug debugging in Netbeans IDE php.ini needs some configuration
[You will be able to debug PHP applications the way you do in Visual Studio, Turbo C/C++ IDE]

php.ini configuration Required

;XDEBUG Extension
zend_extension = “c:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll”

[xdebug]
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir = “c:/wamp/tmp”

Configuration Required in Netbeans IDE:

1. Set the Project URI to the path under your web-server; as you can see the site in a browser; the path shown in the browser address bar. Right click the project, click properties, click run configuration, set the Project URI. Example: http://127.0.0.1:800/example_projects/TodoList/web/

2. Go to Tools->Options->PHP->debugging. see if the parameters are ok, if not fix them. Also, set the properties you want. You may check ‘Watches and Balloon evaluation’


You can set the breakpoints in your project
You can select debug or debug file from menu or from right clicking on the project
Then you can use the Step Over, Step Into, Step Out from debug menu or shortcut keys [better]

You can also check the values of the variables
You can also check the status of the stack
and see all breakpoints listed; there is a window for that

I will add pictures or pdf slides with screen shots to make you understand it better. From: http://sitestree.com/?p=365
Categories:Software Development, Web Development, Root, PHP, Web Testing, Mobile Development, By Sayed Ahmed
Tags:
Post Data:2013-09-07 20:08:46

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada