Count Chars in a File : Pretty Simple Java Code #Java


/*
 * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 *   - Neither the name of Oracle or the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */ 

import java.io.*;

public class Count {
    public static void countChars(InputStream in) throws IOException
    {
        int count = 0;

        while (in.read() != -1)
            count++;

        System.out.println("Counted " + count + " chars.");
    }

    public static void main(String[] args) throws Exception
    {
        if (args.length >= 1)
            countChars(new FileInputStream(args[0]));
        else
            System.err.println("Usage: Count filename");
    }
}

From: http://sitestree.com/?p=10877
Categories:Java
Tags:
Post Data:2017-07-20 20:24:24

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

Get System Property: Pretty Simple Java Code #Java

/*
 * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 *   - Neither the name of Oracle or the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
import java.lang.*;
import java.security.*;
 
class GetProps {
 
    public static void main(String[] args) {
 
        /* Test reading properties w & w/out security manager */
         
        String s;
 
        try {
 
            System.out.println("About to get os.name property value");
 
            s = System.getProperty("os.name", "not specified");
            System.out.println("  The name of your operating system is: " + s);
 
            System.out.println("About to get java.version property value");
 
            s = System.getProperty("java.version", "not specified");
            System.out.println("  The version of the JVM you are running is: " + s);
 
            System.out.println("About to get user.home property value");
 
            s = System.getProperty("user.home", "not specified");
            System.out.println("  Your user home directory is: " + s);
 
            System.out.println("About to get java.home property value");
 
            s = System.getProperty("java.home", "not specified");
            System.out.println("  Your JRE installation directory is: " + s);
 
 
        } catch (Exception e) {
            System.err.println("Caught exception " + e.toString());
        }
 
    }
 
}

From: http://sitestree.com/?p=10875
Categories:Java
Tags:
Post Data:2017-07-20 19:06:43

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

object oriented concepts in general #Java

https://www.youtube.com/watch?feature=player_embedded&v=kmjm8DR62Qk From: http://sitestree.com/?p=2629
Categories:Java
Tags:Java
Post Data:2015-10-20 00:02: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

flow contro collection concurrency generics fundamentals #Java

https://www.youtube.com/watch?feature=player_embedded&v=0fTDGw1pZK0 From: http://sitestree.com/?p=2627
Categories:Java
Tags:Java
Post Data:2015-10-19 18:00:22

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

basic java language concepts #Java

https://www.youtube.com/watch?feature=player_embedded&v=jiJkapK8MLg From: http://sitestree.com/?p=2625
Categories:Java
Tags:Java
Post Data:2015-10-19 12:58:08

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

basic file operations in java #Java

https://www.youtube.com/watch?feature=player_embedded&v=aj5IDtSL6aM From: http://sitestree.com/?p=2623
Categories:Java
Tags:Java
Post Data:2015-10-19 06:56:40

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

Some New Features in Java EE 6 #Java Short Notes

Some New Features in Java EE 6

  1. Was focused in making the Java EE platform light weight and making the environment easier for the developers
  2. Introduced new APIs such as WebBeans 1.0
  3. Made servlet technologies to be more matured
  4. Started to prune APIs that are not used much or not essential or better options are available or technologies have shifted. It’s also an effort to make the platform light weight
  5. APIs under considerations for Pruning
    • JAX-RPC [Better option: JAX-WS]
    • EJB 2.x Entity Beans [Better option: POJO based JPA and EJB 3]
    • JAXR – the adoption was very limited
    • Java EE Application Deployment and Management : As did not get much vendor support
  6. Introduced the concept of profiles. As the full Java EE stack may not be required for all applications, profiles use subsets of APIs geared towards a particular type of applications [making the stack lightweight].
  7. Web profile contains the APIs: Webbeans 1.0, EJB 3.1 (Lite), EJB 3.1 (full), JPA 2.0, JTA 1.1
  8. In Java EE 6, JPA is completely separated from EJB and has become distinct API in its own right

From: http://sitestree.com/?p=5296
Categories:Java Short Notes
Tags:
Post Data:2008-04-29 12:19:30

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

#Engineering: #Canada: #Job/Contract/Project: Any #Engineering: #Computer, #Electrical, #Electronics, #Civil, #Chemical, #Mechanical, #Naval, #Biomedical, and misc Engineering

Date Posted:2021-07-23 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

  1. construction-services-10004
  2. Parkridge Substation Civil Works
  3. Replace Heat Pumps for Electrical Vault & Main Telecom Rms-Construction Services
  4. Vendor of Record Augmentation for Mechanical and Electrical Contractors
  5. Project: tender_15088 – Electrical High Voltage Power Service Upgrades at Arrowhead Provincial Park
  • electrical-and-electronics-10006
  • Normal Power Electrical Upgrades- CP1 Charles Curtis Memorial Hospital
  • Electrical 1
  • machinery-and-tools-10015
  • Mechanical Street Sweeper
  • architect-and-engineering-services-10048
  • Completion of a Detailed Engineering Design for Anger Avenue Wastewater Treatment Plant Biosolids Facility Upgrades
  • On-Demand Subsurface Utility Engineering (SUE) Retainer Services
  • Professional Engineering Services Pats Creek Stormwater Mitigation Project 2021
  • Woodsdale Road Detailed Design & Engineering
  • Engineering Consulting Services for Scale House & Scale Replacement
  • maintenance-repair-modification-rebuilding-and-installation-of-goods-equipment-10054
  • RQQ-2021-WFOW-516 : Consultant Services for Electrical Rehabilitation Work
  • Electrical Upgrades at Bovaird House
  • natural-resources-services-10051
  • SP22TED252 – Mechanical Site Prep – Disc Trench Kamloops
  • SP22TFF005 Mechanical Site Prep- Grand Forks East
  • operation-of-government-owned-facilities-10039
  • Engineering Services for Intersection Improvement Program
  • quality-control-testing-inspection-and-technical-representative-services-10053
  • RQQ-2021-WFOW-516 : Consultant Services for Electrical Rehabilitation Work
  • research-and-development-r-d-10036
  • Software reverse engineering prototypes development (W7701-217332/A)
  • Engineering Services for Intersection Improvement Program
  • special-studies-and-analysis-not-r-d-10047
  • Professional Engineering Services Pats Creek Stormwater Mitigation Project 2021
  • undefined-10055
  • RQQ-2021-WFOW-516 : Consultant Services for Electrical Rehabilitation Work
  • Keywords Used:engineer,civil,mechanical,electrical,electronics,mechatronics,naval,biomedical,computer engineer,software engineer,civil engineer,biomedical,electrical engineer,electronics engineer,mechanical engineer,metallurgical,chemical engineer,industrial engineer,communications engineer,quality assurance engineer,Aerospace engineer,aeronautical engineer,Engineering manager,Agricultural Engineer,Automotive Engineer,Environmental Engineer,Geological Engineer,Marine Engineer,Petroleum Engineer,Acoustic Engineer,Acoustic Engineer,Aerospace Engineer,Agricultural Engineer,Applied Engineer,Architectural Engineer,Audio Engineer,Automotive Engineer,Biomedical Engineer,Chemical Engineer,Civil Engineer,Computer Engineer,Electrical Engineer,Environmental Engineer,Industrial Engineer,Marine Engineer,Materials Science Engineer,Mechanical Engineer,Mechatronic Engineer,Mining and Geological Engineer,Molecular Engineer,Nanoengineering,Nuclear Engineer,Petroleum Engineer,Software Engineer,Structural Engineer,Telecommunications Engineer,Thermal Engineer,Transport Engineer,Vehicle Engineer,engineering

    #Canada: #IT Jobs:#Consultants, #Contractors, #Analysts, #Engineers, #Developers, #Technology Consultants, #IT-Consultants Opportunities2021-07-23

    Apply yourself, or submit others as a candidate, Build a recruitment team to submit others as a candidate, submit RFP to be considered for projects in future, Try to become a vendor so that you are asked to submit consultants/resources in future

    1. electrical-and-electronics-10006
    2. Consultant – SDS – Energy Audit (3 Sites)
    3. energy-10007
    4. ADM REM Station – Technical Consultant Engagement
    5. Source List (SL) for Environmental Consulting Services
    6. Prime Consultant for Main Building Foundation Repairs & Site Grading
    7. machinery-and-tools-10015
    8. Consultant – SDS – Energy Audit (3 Sites)
    9. architect-and-engineering-services-10048
    10. Consultant Services for Dry Pipe Sprinkler Replacement
    11. Consulting Services for the WFPS Amalgamated Station 9-955 Cottonwood Road
    12. Engineering Consulting Services for Scale House & Scale Replacement
    13. RFAP for Surveying Consultant Services – Standing Offer
    14. communications-photographic-mapping-printing-and-publication-services-10042
    15. RFAP for Surveying Consultant Services – Standing Offer
    16. ADM REM Station – Technical Consultant Engagement
    17. educational-and-training-services-10043
    18. Assessment Consulting Service for the Assured Income for the Severely Handicapped (AISH) Program for the Province of Alberta
    19. Anti-Racism & Anti-Discrimination Exploratory Working Group (AREWG) Consultant
    20. environmental-services-10050
    21. Consulting Services for Geotechnical Investigations for the Reconstruction of Phillipston Road.
    22. Water Treatment Plant – Assessment Consultant Services
    23. Consulting Support for The Environmental Services Water and Wastewater Asset Management Plan Update
    24. financial-and-related-services-10038
    25. ADM REM Station – Technical Consultant Engagement
    26. Group Insurance Consulting (EP899-220446/A)
    27. RQQ-2020-FACA-499: VOR + 2nd Stage- Provide Accounting & Tax Consulting Services
    28. health-and-social-services-10052
    29. CONSULTING SERVICES FOR EMPLOYEE BENEFITS FOR THE MUNICIPALITY OF NORTH GRENVILL
    30. information-processing-and-related-telecommunications-services-10049
    31. Web Re-Design
    32. maintenance-repair-modification-rebuilding-and-installation-of-goods-equipment-10054
    33. RQQ-2021-WFOW-516 : Consultant Services for Electrical Rehabilitation Work
    34. professional-administrative-and-management-support-services-10040
    35. CONSULTING SERVICES – COCKBURN SUBDIVISION WATERMAIN
    36. Tourism Consultant for a Tourism Wellness Experience Development Program
    37. quality-control-testing-inspection-and-technical-representative-services-10053
    38. RQQ-2021-WFOW-516 : Consultant Services for Electrical Rehabilitation Work
    39. special-studies-and-analysis-not-r-d-10047
    40. RFAP for Surveying Consultant Services – Standing Offer
    41. ADM REM Station – Technical Consultant Engagement
    42. CONSULTING SERVICES FOR STREETSCAPE ASSESSMENT
    43. transportation-travel-and-relocation-services-10044
    44. ADM REM Station – Technical Consultant Engagement
    45. utilities-10041
    46. ADM REM Station – Technical Consultant Engagement
    47. undefined-10055
    48. RQQ-2021-WFOW-516 : Consultant Services for Electrical Rehabilitation Work
    49. #Sensor: #Canada: #Job/Contract/Project: #Sensor, #Tracking, #Fusion, #Estimation, #Surveillance, #sensor network, #target #tracking, #security 2021-07-23

      Date Posted:2021-07-23 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

      1. aerospace-10005
      2. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      3. armament-10027
      4. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      5. Signal Smoke Marine, Orange (W8486-217390/A)
      6. communications-detection-and-fibre-optics-10031
      7. Video Surveillance System Upgrades Phase 3 – Fibre Optic Network
      8. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      9. LEED Recognition Display
      10. edp-hardware-and-software-10034
      11. Personnel Security Screening
      12. electrical-and-electronics-10006
      13. Request for Standing Offer – Traffic Signal Cables
      14. engines-turbines-components-and-accessories-10008
      15. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      16. fabricated-materials-10009
      17. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      18. fire-fighting-security-and-safety-equipment-10010
      19. RFP – Security improvements – camera, access control, and alarm systems
      20. Smart Anti-Loitering and Security System
      21. food-preparation-and-serving-equipment-10012
      22. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      23. furniture-10013
      24. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      25. industrial-equipment-10014
      26. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      27. machinery-and-tools-10015
      28. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      29. marine-10017
      30. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      31. office-equipment-10020
      32. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      33. office-stationery-and-supplies-10021
      34. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      35. scientific-instruments-10024
      36. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      37. textiles-and-apparel-10028
      38. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      39. LEED Recognition Display
      40. custodial-operations-and-related-services-10037
      41. LEED Recognition Display
      42. information-processing-and-related-telecommunications-services-10049
      43. Centre of Excellence (COE) in Healthcare Cyber Security
      44. One (1) B.1 Business Analyst (Senior) to assist with HR to Pay Tracking System (30000163)
      45. lease-and-rental-of-equipment-10045
      46. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      47. maintenance-repair-modification-rebuilding-and-installation-of-goods-equipment-10054
      48. 2021 Traffic Signal Replacement Program Location A 048077 – Regional Road 48 (Niagara Street) at Regional Road 77 (Welland Avenue) Location B 048087 – Regional Road 48 (Niagara Street) at Regional Road
      49. Video Surveillance System Upgrades Phase 3 – Fibre Optic Network
      50. research-and-development-r-d-10036
      51. Surveillance of Space 2 Ground-Based Optical System Request for Information (W8474-207923/B)
      52. utilities-10041
      53. LEED Recognition Display
      54. undefined-10055
      55. Design Services for the Creation of an Exterior Donor Recognition Display
      56. Keywords Used:sensor,fusion,sensor network,tracking,target tracking,surveillance,self driving car,self-driving,estimation,security,signal processing,image processing,autonomouse vehicle,facial recognition,signal,recognition,sensor fusion