Jump to content

madknight3

Member
  • Posts

    1,786
  • Joined

  • Last visited

Posts posted by madknight3

  1. Console.ReadLine() will always return a String. You could use Double.TryParse to see if it's a number or not like so

    Dim input As String = Console.ReadLine()
    Dim value As Double
    If Double.TryParse(input, value) Then
        ' It was a double and the variable "value" now contains the converted input
    Else
        ' It wasn't a valid double and the variable "value" is set to zero
    End If

     

  2. I expect there are many PHP libraries that can do what you need. I'm not a PHP dev, so I'll leave it to you to search for an appropriate one for your company. If for some reason PHP doesn't have an acceptable library, you could use one from another language. You could use a web service, command line tools, or something else that PHP can call to get the results from the other application.

     

    I've only done this in .NET before and have used iText (Java and .NET support), iTextSharp (.NET only), and ABCpdf .NET 9 (.NET only). I also recall looking into Adobe PDF Library (C++, .NET, and Java support) and others but I don't remember what they all were. iText suited our needs.

  3. I've briefly played around with the basics but I haven't had the time to fully dive into language. With that said I've been following its progress for a while so the below information is me parroting what I've heard/read.

     

    Rust probably isn't very suitable as a first language for complete beginners, however, it seems like there's enough to get someone with some previous experience going.

     

    They are in the midst of a full rewrite of the official rust book (chapters 2 - 8 done and the rest in the editing process, progress here) so it appears to be at the point where it's worth reading over the first edition (and supplement as necessary). Another popular resource is Rust by Example. And there's quite a few blogs/tutorials/talks out there to find for additional resources.

     

    There's a very active rust subreddit which you can follow for information/asking questions/etc. It has some additional resources linked in the side bar.

     

    There are also a few "Are we ___ yet?" sites for rust that, if up to date (I'm not sure), might give you a general idea of how rust is doing in some specific spaces.

    Are we (I)DE yet?

    Are we web yet?

    Are we game yet?

    Are we (machine) learning yet?

  4. 26 minutes ago, 78jimm said:

    But almost all of them require a 4-year degree.

    Apply anyway. Worst case, you don't get the job (which you wouldn't if you didn't apply anyway) and you may end up with some extra interview experience. I'm sure you can find plenty of specific advice online for how to job hunt without a degree too.

     

    You can cover a lot of CS material on your own though. Check out OSSU. You can start with an Intro to Computer Science course (like Harvard's CS50 which covers a mixture of C, Python, SQL, and JavaScript plus CSS and HTML) and go on from there.

     

    Web development can still be your priority but the additional knowledge can help.

  5. 20 hours ago, Dat Guy said:

    Although I don't use vi/Vim anymore, I feel the urge to step in here: The Vim shortcuts are perfectly intuitive. Simple example: Delete three words and paste them to the beginning (column 0): d3w0p

    Out of curiosity, do you still use Vim shortcuts in whatever your editor of choice is now?

  6. 24 minutes ago, Surpuppa said:

    Do I need a new IDE for every language or can I have a single one for many?

    It depends. IDE's tend to support multiple languages but that doesn't mean they support everything. It also doesn't mean that all languages are supported equally. So sometimes you may want to use more than one editor.

     

    If you liked PyCharm, then you'll like IntelliJ for Java. IntelliJ appears to have two plugins for Haskell. I haven't used either of them though, so I can't speak to their quality.

  7. 3 hours ago, Shammikit said:

    if i want to display a image from database in a form, and if database is located in one PC and if the forms are located on another PC, is it possible for me to have class files in the same computer where database is in and call these class files in the forms through a network and use to display things like images and text in the forms?

    Yes, like Erik says, the plain class files aren't of any use to a running application.

     

    You would need to take the class files, compile them into an assembly, and then call the code from that assembly. StackOverflow: How to load a class from a .cs file contains some information on the subject. But this is overly complicated and probably only actually needed in very rare situations (ie: it's very unlikely you need to do it).

     

    I expect what you're trying to achieve can be done in a much better/easier way.

     

    For example, most databases can be set up and accessed remotely from other computers. This may be good enough for your purposes but be aware that in can introduce security issues.

  8. 14 hours ago, trag1c said:

    Winsock library programming isn't overly complex. I am assuming you're using C# since you stated your using winforms. I don't know the specifics for a C# implementation but there should be some documentation on winsocks online.

    14 hours ago, Shammikit said:

    yes im using C# and thanks, i'll go and see about it 

    Socket programming in a managed .NET application (like the C# WinForms app being used) is normally done using the System.Net.Sockets namespace, not using WinSock.

     

    There is the basic Socket class that you can use that is very flexible.

    Quote

    The Socket class is not protocol specific and provides an abstraction for network communication. This way you can write code using a single set of semantics (Bind, Connect, Send, Receive, etc) regardless of the network protocols you wish you use. For example, you can write a Sockets-based application that uses IPv4 or IPv6 (and more ) as the network layer.

    Source

     

     .NET also provides some protocol specific classes that can help make things easier.

    These classes use the Socket class underneath, but do a lot of things for you.

  9. 47 minutes ago, Shammikit said:

    so i have a byte array called data that gets values dynamically. i want to copy a value in a specific position from the array data to the other array named bytes.i have tried the code below and it gives me the error : An exception of type 'System.ArgumentException' occurred in mscorlib.dll but was not handled in user code. Additional information: Source array was not long enough. Check srcIndex and length, and the array's lower bounds. what am i doing wrong?

    
    byte[] bytes = new byte[data.Length];                  
    Array.Copy(data, 0, bytes, 0, 1);
    textBox1.Text = Encoding.Default.GetString(bytes);

     

    You're getting that error because data is empty

    // Example
    byte[] data = {}; // empty
    byte[] bytes = new byte[data.Length];
    Array.Copy(data, 0, bytes, 0, 1); // Throws ArgumentException: Source array was not long enough. Check srcIndex and length, and the array's lower bounds.
    
    // If data has at least 1 item, that code works
    byte[] data = {255}; // 1 element
    byte[] bytes = new byte[data.Length];
    Array.Copy(data, 0, bytes, 0, 1); // works

    Note that Array.Copy is probably overkill for a single item though.

     

  10. I'm not sure if you're going in the right direction with this. You might want to consider having a separate application running on the server that the clients can communicate with. The idea is that the server application handles a lot of the functionality and database work on it's end and moves that work away from the client.

     

    For example, one option is to create a console/desktop application that uses TCP or UDP sockets (depending on what you're trying to do). Here are some related links:

    You can also google for more client-server information/examples/tutorials/etc.

     

    Another option is to create a web service with ASP.NET Web API. You're clients will then communicate with the server using HTTP requests. If you go this route, I'd recommend using the new ASP.NET Core 2.0 if possible but you can use the older ASP.NET Web API if you want. Again, here are some related links

    Again, you can google for more Web API information/examples/tutorials/etc.

     

     

  11. 1 hour ago, spiralfuzion said:

    The only reason I'm interested in web development is because I get more immediate results. That's why I'm learning html/css and am halfway through the course. (learning about div atm) From what I've seen java-script is essential for web development and all the behind the scenes stuff. Is it worth learning or should i move to the c family? 

    Web development does have a fairly low barrier to entry, especially for basic GUI work. HTML, CSS, and JavaScript (usually the first three things you start with) aren't too hard to get started with. 

     

    Outside of web development, most programming languages will start you off with basic command line applications. The point is to allow you to focus on learning the language without having to also learn how to work with a GUI right away.

     

    Which you choose is entirely up to you. Web development is fine, however, it sounds like choosing something outside of web development is where you'd rather start.

     

    Since I'm not sure exactly what kind of things you're interested in building, my general recommendation would probably be one of these (in no particular order): Python, C#, Java, C, or C++

     

    Python is probably the easiest, C# and Java somewhere in the middle, and C and C++ on the more difficult side of things. However everyone's experience is different and they can all be learned as a first language so you don't have to shy away from the so called "difficult" languages if they are what interest you the most.

     

    Personally I like C# the best, but it's also what I'm most familiar with so that's probably part of it at this point. In the end, I don't think it overly matters what you start with. You'll eventually learn multiple languages anyway.

  12. 2 hours ago, spiralfuzion said:

    is there any difference between that and enterprise and the various other versions of visual studio?

    First, note that these tools are not required for all web development. They are recommend for ASP.NET development though which is a .NET web framework. If you're not familiar with the differences between client side vs server side web development and don't know what web frameworks are, then learning a bit about that stuff first may help.

     

    Now, onto your specific question.

     

    Here is the feature comparison list for the different versions of Visual Studio 2017 (Community, Professional, and Enterprise). Community and Professional are almost identical in features and Enterprise gives you some extra stuff. Note that these are all Windows Only but there is a Visual Studio for Mac version.

     

    Community is free (see the bottom of this page for usage/license information). Professional and Enterprise will cost you money but can be used in situations that the free Community edition doesn't allow.

     

    Visual Studio Code is a separate product, not a version of the above Visual Studio 2017 products. VS Code is basically a more lightweight, cross platform, text editor with some extra programming features. See their faq for more info.

     

    You may want to install both VS 2017 and VS Code and try them both out. You may find you prefer one over the other, or you may like both and prefer to use them for different things. It's probably easier to start doing most things with VS 2017 though, because it takes care of a lot of things for you.

  13. 17 hours ago, Shammikit said:

    when user clicks form1 it should load form1 again (i use it for like refreshing the page)

    The code isn't "refreshing" the form. It's hiding the existing form, and creating another form1 and showing it. The original form1 is still there in the background.

    this.Hide();  // The "this" keyword refers to the current form1. So you're hiding the current form1.
    form1 f1 = new form1(); // Here you're creating a new form1 that is separate from the existing form1
    f1.Show(); // Here you're showing the new form1 and the old form1 is just going to remain hidden in the background
    
    
    // Side Note:
    
    // Hide() is just setting the Visible property to false.
    // So
    this.Hide();
    // is just a shorter way of writing
    this.Visible = false;
    
    // Show() is just setting the Visible property to true.
    f1.Show();
    // is just a shorter way of writing
    f1.Visible = true;

    So if you ran this code, you'd actually have 2 form1s open (1 invisible and 1 visible).

    If you ran this code again, you'd actually have 3 form1s open (2 invisible and 1 visible).

    And so on.

     

    So you need to change how you "refresh" your form. Just update your existing form instead of creating a new form.

  14. 1 minute ago, Shammikit said:

    if im trying to access the video file by opening cmd from outside the directory how should i give the file path.should i give only file name or should i give entire path?

    Should be like this

    ffmpeg -ss 00:00:15 -i "C:\Videos\A guide to Harvard Referencing.mpf" // etc

    Just use the specific path to the video on your computer. I just put one there as an example.

  15. Basically, the code is running FFmpeg from the command line using the Process class.

     

    Here is some documentation to explain the Process classes in more detail

     

    FFmpeg is generating an image from the specified video (ie: the video parameter) and saving it to the specified location (ie: the thumbnail parameter) which you can then load into your application (ie: the code in the LoadImage method).

  16. Note that I haven't needed this feature before so I haven't tried any of these options out myself. I'm just helping you Google. You'll have to look into them more yourself.

     

    In terms of Visual Studio extensions, here are some I found

     

    Cloud IDEs usually have this feature although I'm not sure how many out there have .NET support. One option I found was Codeanywhere which seems to suggest it supports .NET

     

    6 hours ago, Apextier said:

    I use floobits but it only supports a few editors.

    Since it supports IntelliJ, it looks like it also supports Rider (their new .NET IDE) and presumably all their IDEs. At the very least I was able to install it in Rider but I don't have a floobits account to try it out.

     

    Rider is free/discounted if you meet any of their criteria here.

×