[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Programming

53K

Solutions

40K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.

Share tech news, updates, or what's on your mind.

Sign up to Post

This is how to create simple Timer (Stopwatch) in VB.NET

Make a form with 1 Label, 1 Timer and 1 Button
Set the interval of timer in = "1"

use this code

Public Class Form1
Private Stopwatch As New Stopwatch
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim elapsed As TimeSpan = Stopwatch.Elapsed
Label1.Text = String.Format("{0:00}:{1:00}:{2:00}:{3:00}",
Math.Floor(elapsed.TotalHours),
elapsed.Minutes, elapsed.Seconds, elapsed.Milliseconds)
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
If Button5.Text = "Start" Then
Timer1.Start()
Stopwatch.Start()
Button5.Text = "Stop"
ElseIf Button5.Text = "Stop" Then
Timer1.Stop()
Stopwatch.Stop()
Button5.Text = "Start"
End If
End Sub
End Class
0
Big Business Goals? Which KPIs Will Help You
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

A couple of weeks ago I wrote about the immutable fluent object builder pattern, and how to increase semantic significance and clean code.
 
This is useful in object-oriented programming languages like java, c#, etc.
 
The resulting object builder could have a clean, fluent API that could look like this:
 
final Car pontiacMontana2007 = Car.builder()
.with(Brand.of("Pontiac"))
.with(Model.of("Montana"))
.with(BuildYear.of(2007))
.with(Seats.of(7))
.build();
 
But in many examples of such a builder pattern written in java, the API becomes slightly different, and simultaneously semantically less significant:
 
final Car pontiacMontana2007 = Car.builder()
.withBrand("Pontiac")
.witModel("Montana")
.withBuildYear(2007)
.withSeats(7)
.build();
 
Wait, what? Did the java developers just throw out the data type system, and reduce both Brand and Model to String, and both BuildYear and Seats to int?
 
Yes, yes they did.
 
But why?
 
Well, that's because of limitations forced upon them by the java language developers: in their infinite wisdom, they made the String and Integer classes final. And that means, that a data type for Brand, which SHOULD have subclassed String, CANNOT subclass String.
 
And that unfortunately has lead to 3 solutions:
 
1. Reimplement String in a non-final, extendable way;
 
2. Envelope a String value in a decorator class;
 
3. Give up and just use String.
 
Why am I making this point?
 
Because I want it understood that many design …
0
Is there a known well tested functional SDK or API to query Hyper V guests OSs performace counters such as cpu usage, core usage, memory ? I know for example that VMware has its own SDK for that so I need similar.
0
Cloud Class® offers continuing education and professional training in tech-specific categories, like ITIL®, Hadoop, Scrum, and CompTIA, as well as business-focused curriculum in Business Administration, Accounting, Law, and Human Resources. That means we’ve had to add new topics on site to better index the training opportunities. Follow these topics to answer questions and lend your expertise to any discussions.
0
Factors that will drive Python growth in 2018

Python was the fastest growing programming language in 2017. Although Python has been around quite a while, the recent growth factors many aspects. One of the major aspects is the rise of data science, data mining and machine learning.

https://goo.gl/pL9qpg
0
I'd like to send a public Thank You! to Expert - Joe Winograd - Who has gone above and beyond in helping me with my AutoHotkey scripting efforts.

Joe has a way of explaining programming related things that manage to sink into my thick anti-programming skull. Using the shortcuts that AutoHotkey has made available to me has saved me a ton of repetitive typing at EE and I am very thankful for Joe's efforts.

Thank you Joe!
5
LVL 62

Expert Comment

by:Joe Winograd, Fellow&MVE
You're very welcome, Andrew, and my thanks back to you for such kind words — I really appreciate hearing them! To borrow some language from Mr. Spock, it would appear oddly self-serving to endorse your comment, but I'm going to do it, anyway. :)  Regards, Joe
1
LVL 23

Author Comment

by:Andrew Leniart
from Mr. Spock, it would appear oddly self-serving to endorse your comment, but I'm going to do it, anyway. :)

As am I

LoL!

Thanks, Joe   :)

Regards, Andrew
0
Why Is Node.js the Best Framework for App Development?

Node.js makes use of JavaScript; which the most popular programming languages of today. For a very long time now, companies have embraced Node.js app development as it helps companies promote their apps in a short span of time. Node.Js framework is a brilliant tool whenever you want to design server-side web applications in JavaScript. There are several advantages when it comes to using Node.js for App development. It is one of the most popular and modernized frameworks preferred by developers for building easy to market web apps.
Why-Is-Node.js-the-Best-Framework-fo.png
1
6 Reasons Why Migrating to Odoo 11 is a Good Idea!

Since its release in October 2017, Odoo 11 is creating a stir amongst business owners. Even if you are working on the older version of Odoo, it is time you should consider Odoo 11 migration. If you are considering Odoo 11 migration, you should know that it has things in store for both; the enterprises and their end users. This blog will provide you with 6 reasons to consider migrating to Version 11 of Odoo.
Why-Migrating-to-Odoo-11.png
0
LVL 1

Expert Comment

by:Girish R
I totally agree with what you say in the article "And when one needs a software that fulfills all these demands; a name that often comes up is – Odoo. Since its release as an ERP in February 2005 until the launch of 11th Version in October 2017, it has offered nothing but convenience to entrepreneurs"
0
Immutable Class Builders
 
The other day I showed 1 way to make a Class #Builder more meaningful, #semantically, leveraging the #programming language's type system. Today, I'm going to address how to make them immutable, its benefits, and its drawbacks.
 
Why?
 
Class Builders typically use mutable architectures where the programming language allows. In #Java we often see the following model:
 
@Immutable  
final Class Person {  
 
public final Name name;  
public final Address address;  
 
Person(final Builder builder) {  
  this.name = builder.name:  
  this.address = builder.getAddress();  
}  
 
}  
   
@Mutable
final class Builder {  
 
public final Name name;
@Nullable private Address address;
 
private Builder(final Name name) {
  this.name = name:  
  this.address = Address.empty();  
}  
 
public static Builder named (final Name name) {  
  return new Builder(name);  
}  
 
public Builder with (@Nullable final Address address) {
  this.address = (null == address) ? Address.empty() : address;
}  
 
public Address getAddress () {
  return (null == this.address) ? Address.empty() : this.address;
}  
 
public Person build () {  
  return new Person(this);
}  
 
}  
 
Whatever Person field is required, we find in the Builder's constructor. In the above example, that's Name.
 
Other fields are optional, and their value is added to a Person instance by using one if the Builder.with() instance methods.
 
Note how the Builder also features a …
0
LVL 2

Author Comment

by:A.E. Veltstra
Thank you, Brian! I'll look into that.
0
LVL 2

Author Comment

by:A.E. Veltstra
Anton Shipilev showed in 2014 that using all final fields and setting them in the class constructor did in fact slow down initialization when using Oracle's HotSpot Java compiler on ARM and PowerPC. I have yet to see whether his recommendations have been committed. https://shipilev.net/blog/2014/all-fields-are-final/
0
Hello
I'm a new to programming and I need help with a problem please.
I'm trying to call a method (addEmployee( with an Array parameter) from the Department class to the Testing Class through the object sales. However, I cannot seem to to this.
The following line:     sales.addEmployee(alex); // This line is underlined red 'Cannot resolve symbol addEmployee'

// TESTING CLASS
public class TestCompany {

    Employee alex = new Employee("Alex Rod", 6);
    Employee linda = new Employee("Linda Berry", 7);
    Employee john = new Employee("John Doe", 3);
    Employee sara = new Employee("Sara Time", 7);
    Employee james = new Employee("James Doe", 4);

    Department sales = new Department("XYZ Sales");
    Department IT = new Department("XYZ IT");

    sales.addEmployee(alex); // This line is underlined red
    sales.addEmployee(linda);
    sales.addEmployee(john);

    IT.addEmployee(sara);
    IT.addEmployee(james);
}

//DEPARTMENT CLASS
public class Department {

    private String deptName;
    private double budget;

    private Employee[] emps = new Employee[5]; //creates 5 boxes of employees (from Employee Class)
    private int counter =0;

   public Department(String deptName){
       this.deptName = deptName;
       this.budget = 50000;
    }

    public void addEmployee(Employee obj){
       emps[counter] = obj;
       counter++;
    }
}


//EMPLOYEE CLASS
public class Employee {
   
    private String empName;
0

Author Comment

by:Kevin Blakely
Duh!!! I forgot to add public static void main !!! Sorry SOLVED
0
LVL 3

Expert Comment

by:Paul Kent
For future reference, you will receive better assistance if you publish your problem as a Question rather than as a Post. (Click the blue "Ask a Question" button above to ask a question.)
1
Determine the Perfect Price for Your IT Services
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

The skillset of programming makes the difference between having billions of operations per second in your lap and having billions of operations per second at your command. If you seek to partake, you may want to consider checking out my new course: https://www.experts-exchange.com/courses/1401/Programming-for-You-Introduction-to-C.html
1
cplusplus.jpg
This jovial programmer is Paul Kent.  I just published his new course on C++.  Great job, Paul!

https://www.experts-exchange.com/courses/1401/Programming-for-You-Introduction-to-C.html

Note: This is a paid course.
0
0
I am putting the finishing touches on a tutorial about how to use R programming interfaced with MS-Excel. I decided to show how to obtain stock prices from Yahoo Finance. I realize that this can be done directly in Excel. However, R has some great libraries that make getting prices from third-party providers seamless. But, as you know, R is weak in its front-end feature. Besides, people who use spreadsheets regularly (or should I say religiously) can now take advantage of these libraries with the interface. They get the benefit of R without having to give up Excel. That's a win-win in my book.

I was wondering if this concept seems like something you would want to learn. There are many libraries (packages) developed in R and more are being developed constantly. Let me know if this sounds like a concept you want to learn
3
LVL 35

Expert Comment

by:[ fanpages ]
Hi James,

Your article, "Why R Programming Will Become Your Go To Language", has piqued my interest in learning more so, yes, the suggestion of a tutorial for an 'R' interface with MS-Excel is certainly something I would wish to read.

Thank you :)
0
2
Subject of the week | Tell us about a technology you'd like to learn.
I'm fascinated by developments in Machine Learning and want to, heh, learn more about it. Not so much because I want to create Machine Learning systems myself—I have very little interest in the math involved—but so I can know how to leverage the sort of things that are being built. I easily envision the future of most work being about managing various bots and knowing how to apply them to higher level problem solving.

To get started on that path, I'm currently teaching myself Python (via several books on the subject) and would then transition into the use of it to dig deeper into the Machine Learning libraries. (And if I have to, even some refresher on the math... I did pass the AP calculus test, but that was 20 years ago!)

Any of you out there with more knowledge in these areas have some advice on this?
1
Just saw some advertisement where there was code catching a null pointer exception. Are people really out there catching null pointer exceptions. Seems like poor coding style when you can check if the variable is null before hand. We have also been using Java annotations to mark something as null able or not null. This has been really helpful in making potential null pointers compile time errors. Just a random thought.
2
PriorityQuestions-SocialMedia-Onsite.jpgHave you tried to ask a Priority Question? Check out this article to learn how you can ask your questions and alter the priority of your issue to place it in front of topic Experts!
5
Trending Tech Everyone Should Know About - My Thoughts
I've been thinking about this subject for a few days now, trying to come up with something unusual. But the thing that keeps coming to mind—even though I feel it's an obvious answer that everyone already does know about—is Artificial Intelligence & Machine Learning.

Why? Well first, it's technology that impacts everyone, regardless of how involved you are in the tech industry. I've got little doubt that we're right on the cusp of major social change as a result of machine learning—change as significant as the Industrial Revolution. We've got self-driving cars inevitably hitting the mainstream in the near future. There's cancer detection systems that are faster and more accurate than human analysts. AI systems being trained to defend against cyberattacks. Movie dialog being written by algorithms. The list goes on and on...

And second, while these advancements will absolutely push us forward in exciting new ways, they'll also destroy many jobs. And while that job loss can be terrifying, AI opens us up for entirely new sorts of jobs, major changes to the way work is done, and more that we can't even fully conceive of yet.

Will most knowledge workers of the future become "bot wranglers"? Will some sort of universal basic income
2
IT Pros Agree: AI and Machine Learning Key
LVL 1
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

courseofmonth-native.JPGOnly 5 days left to get your HTML5 certification with your free Course of the Month. Take advantage of this month’s featured course and add a programming language to your resume today.
5
LVL 56

Author Comment

by:Scott Fell, EE MVE
I don't think I shared it for how to catch a bullshitter, but more for the good points to think about in how we work.  A lot of this may be standard operating procedures in their daily lives and others may not.  

My big takeaway is understanding the problem objectively and asking the right questions before forging ahead,.  What problem is this going to solve, what are the costs (not just $$ but time/people),

Some good points for day to day work process.
3
LVL 12

Expert Comment

by:Jeffrey Dake
I totally agree, there are some good points in there about questions we should ask ourselves before we continue developing. I have seen plenty of "refactors" that made the code more reusable but there were no plans to reuse the code. By the time another developer got the chance to reuse it, the original assumptions were no longer valid and another refactor was needed.

As developers we should always be trying to balance how we solve problems with the benefits of how we solve them.
3
onsite-native-ad-360x200.pngThis summer is the perfect time to add a programming language to your resume with, course creator, Mark Lassoff’s help. Build a solid foundation for a career in web development by learning and getting certified in HTML5 . Enroll in July’s Course of the Month to get started today!

2
Want to learn HTML? We’re featuring the HTML5 Specialist Certification Course as our July Course of the Month!  Premium Members, Team Accounts, and Qualified Experts unlock free access to this course, and are eligible for the certification exam once the course has been completed. Get started today!
3
Premium Members & Qualified Experts,

Get HTML5 Certified in July’s Course of the Month

https://www.experts-exchange.com/articles/30614/Get-HTML5-Certified-in-July-s-Course-of-the-Month.html
3
LVL 5

Expert Comment

by:Christ Harold
I have already enrolled and looking forward to complete the certification. Thanks for the update
2

Programming

53K

Solutions

40K

Contributors

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.