Jump to content

madknight3

Member
  • Posts

    1,786
  • Joined

  • Last visited

Everything 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. There are a lot of classes in .NET for making web requests. You can use HttpClient, WebClient, HttpWebRequest or WebRequest. The specifics for what kind of requests you need to make are outlined in the Chevereto API docs.
  3. 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.
  4. The WebClient class has a DownloadFileCompleted event you can use. You can "Handles" it just like you did with the DownloadProgressChanged event in your code snippet, or you can use the "AddHandler" like in the link example (just don't do both or the event will be triggered twice).
  5. That is an extension method. The first parameter is prefixed with a "this" keyword which means that you can call that method on an object of that type. In this case, an Image. So "myImage" is of type Image.
  6. 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?
  7. 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.
  8. You need to make an HTTP request in the WinForms app. There are a few classes in .NET that let you make them. One of them is HttpClient
  9. Out of curiosity, do you still use Vim shortcuts in whatever your editor of choice is now?
  10. 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. Intellij-Haskell HaskForce
  11. 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.
  12. 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. Source .NET also provides some protocol specific classes that can help make things easier. For TCP sockets you have the TcpClient and TcpListener classes. For UDP sockets you have the UdpClient class. These classes use the Socket class underneath, but do a lot of things for you.
  13. 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.
  14. 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: TcpClient TcpListener UdpClient 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 ASP.NET Core Web API tutorial Older ASP.NET Web API tutorial HttpClient Class Again, you can google for more Web API information/examples/tutorials/etc.
  15. You need to do more than just include that code in your Form1 class. You need to actually call that HideCaret() method somewhere, specifically in the GotFocus event. https://stackoverflow.com/a/2359382/1765721 For more information on this event, see the documentation: Control.GotFocus Event
  16. 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.
  17. 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.
  18. 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.
  19. 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.
  20. No problem. Not sure if you'll need the videos full path when you run it from your application, just keep it in mind if it doesn't work.
  21. You probably just need quotes around the filename. Also, the path to cmd.exe shouldn't be there. It should just be the path to the video file
  22. /r/ProgrammerHumor/ - Ways of doing a for loop Lots of great suggestions there!
  23. 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 Process Class ProcessStartInfo Class 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).
  24. 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 TeamCoding (Seems to use CodeLens which isn't in the free Community version of VS) Collab (Looks dead) floobits plugin (Looks dead) 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 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.
×