Jump to content

A1Jon

Member
  • Posts

    44
  • Joined

  • Last visited

Reputation Activity

  1. Agree
    A1Jon reacted to AstroBenny in Quick suggestion regarding total posts in each sub-forum   
    I know there are probably bigger issues but..
    It would be nice if, where the total number of posts are displayed for each sub-forum, there could be commas so the numbers could be read more easily :P
    Cheers.
  2. Informative
    A1Jon got a reaction from azurezeed in Can't upload cover photos in profile page   
    Try converting your Cover/Profile Photos into a .PNG format... it should work then.
  3. Informative
    A1Jon got a reaction from Wingfan in Can't upload cover photos in profile page   
    Try converting your Cover/Profile Photos into a .PNG format... it should work then.
  4. Like
    A1Jon reacted to sobe in Help choosing Monitors for new gaming build monitor budget 2,400   
    The 279Q is IPS, not TN, you are thinking of the older 278Q.
     
     
    As for OP @Armalitecontrol, if you are going all out, just grab 3x Acer XB271HU panels (or a single Acer Predator X34), the same 1440p+Gsync+165Hz+IPS panel found in the ASUS PG279Q, but with far better quality control on Acer's end so you are more likely to get a monitor without defects than going for the ASUS.
  5. Like
    A1Jon reacted to AlTech in The Ultimate C# Beginner's Guide   
    Welcome to the Ultimate C# Beginner's Guide by @AluminiumTech and @jubjub.
     
    Introductory note - In order to follow and do what we are doing in this guide you will need to download Visual Studio. We are using Visual Studio 2015 Community since it’s free. Go to https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x409 and then tick all the boxes shown in addition to whatever else you want to add.
     

     

     
    NOTE - It should be noted that beginner's or anybody should comment on code using // or /// so that you remember what part does what. And also helps you in the learning process.
     
    Before learning C#, or any programming language for that matter, you need to learn the “basics” of programming. In reality these “basics” are actually not all so basic. There is a lot of “jargon” that you need to learn and a lot of ideas that will seem strange. So let’s get into some of these ideas.
     
    Note to Reader: Methods and functions are used interchangeably throughout the guide, while they are not exactly the same the difference will not matter at this point.
     
    The first and probably most important idea in programming is around “data”. What is “data” in programming? Well data is simply what is stored in the computer, be it on hard drives/solid state drives or ram. In programming, you manipulate data through “objects”. These objects take many forms, whether as text which are called strings or as numbers which are called integers. Basically, when you need to use numbers you use an integer object and when you need text you will use the string object. These are all different data types. Each data type is handled differently when writing the code.
     
    When writing code,you ask the computer to do something and you need to know in what order it will react. We achieve this by having something called a thread, this is something that  a lot of programmers still struggle with. However, it can be simplified. Basically when reading lines of code grouped together you see an order. This is the order that this code will run. When you see the program you have a main group of code inside a method that gets run first (more about methods later, just think of this as a group of code). We can have multiple blocks by having multiple methods.
     
    Now we can talk more about the groups of code. These groups of code are called blocks, they are anything that gets run together sequentially. These blocks are what make up methods.
     
    (I can write the intro to programming and basic concepts so if you could do some basic syntax introductions with examples that would be helpful. Also make sure to go backwards and start at one line with the print method and go backwards explaining each feature of the language. Even explain classes and functions/methods but be brief and use simple words without going in depth. I think classes will require a whole paragraph to explain.)
     
    There are many different types of programs you can create using C# and the .NET library. These are:
    Applications that interface with a console and text.
    Applications that interface with a graphical user interface (GUI). This allows you to create buttons from code and such.
    Applications that have a GUI which is created using a markup language outside of C#.
    Universal applications which can scale across Windows Tablets, PCs, Windows Phones and Xbox Ones
     
    Classes
    Classes allow you to produce a desired outcome by combining and grouping variables, methods or events. You can think of classes as a blueprint.
     
    Functions
    A function is something that is called when you want to perform a certain task. So think of it as calling a mechanic to repair your car. You need to call the mechanic in order for him to come and fix it. In this analogy the actual fixing of your car would be the code inside the function.The same goes with programming.
     
    using System.x
    In C# we use the .NET framework to enhance functionality of programs. By default there is a set of mini frameworks that the program will contain. When you add it, if it is ever used it will appear in black font and if it is not ever used it is it will appear in gray font. Note - We added the System.Threading; mini framework and we’ll  explain that later on in this guide.
     
    Ways of storing data
    In programming in general, there are many ways we can use to store data. Some examples include strings, doubles, ints and floats, Strings are used to store text. Ints are used to store integers, otherwise known as whole numbers and they are 32 bit numbers. Doubles are used to store very large whole numbers, 64 bit numbers to be precise. The largest 32 Bit number/value is  2,147,483,647 (2.1 Billion)! Whereas the maximum 64 bit number/value is 9,223,372,036,854,775,807 (9.2 Quintillion)!. Floats are 32 bit numbers/values with numbers after the decimal point (e.g 1.4893). There are some positives and negatives to using floats, ints and doubles which I’ve summarised in the table below.
        The reason why Doubles use more RAM is because the data stored, whether it be Strings, ints, floats or doubles, needs to be stored in RAM and the larger the size of data, the more RAM it will take up. What we are doing here is making a trade-off, if you remember from high school physics you can trade-off different work loads, e.g a lever. What we are trading is RAM for CPU, as the other option would be to have the CPU work trying to figure out whether it needs more ram or less ram. Some programming languages like Lua do this.

    What is Source Code
    Lines of code which make up a program.
     
    What is an IDE
    An IDE (or Integrated Development Environment) is usually a place where programmers write, test and debug code. It contains a place to edit the code as well edit the program and has options to export said code. Different IDEs work with different programming languages and as such you need to pick one for your programming language. For C++ and C#, we recommend using Visual Studio Community (Which is the free version of Visual Studio) 2015. For Java we recommend using Eclipse or Netbeans and for HTML, PHP and javascript we recommend Komodo Edit or Adobe Dreamweaver.

    What is a compiler
    A compiler is a program that translates your source code (see above) into a set of very basic instructions called Assembly Code. Think of it as a translator between you and your computer, except the translator doesn’t know english it knows C# (or whatever language you are using).
     
     
    Starting to code
    Now that you understand that, we’re going to move onto writing the first lines of code in a console with text.

    In C# we use Console.WriteLine to print something to the console using text, this is a very easy way to display text.To have it print Hello World we can do the following.
     
     
    Now let’s add a title to it. To do this we use Console.Title . Since we’re doing the beginner’s guide let’s go put C# Beginner’s guide as a title, like so.
     

     
    Next we’re going to take things a step further by adding strings. In this case we have to create the string before we can use it. So let’s create a string called Title and a another string called Text.
     

     
    Now it’s time to make this look a little bit better. We’re going to change the font colour by using Console.BackgroundColor. For this example we’ll make the text white.
     

     
    Next we’ll move onto applications with a Graphical User Interface. The process for creating these type of applications are very different compared to command line text based programs. This is due to being much more advanced and the structure of an application being more complex, which can lead to many business and professionals using applications with a GUI instead of command line. In C# we call applications with a GUI “Windows Forms applications/programs.
     
    First we need to create a new one in visual studio. When doing this you must uncheck the “Add to source control” and “Create directory for solution”. If enabled, this creates a small part of your project in your computer somewhere and if you try to use it on another computer ever again then it won’t work and you won’t be able to publish it.
    Now that we’ve created the project let’s do some miscellaneous stuff. First we’re going to  change the name of the form to “C# Beginner’s Guide Windows Form”. You do this by going to text in the right hand corner and type in the name of your choice into the the “Text” field.
     

     
    Now that we’ve done that we can make the Form larger to accommodate our needs. You do this by dragging the bottom corner outwards.
     

     
    At this stage, the programmer or creator decides what he/she wants the program to do. For this demo, we’ll show you the fundamentals of how C# works by creating an application which responds to user input. User input is any interaction a user has with a mouse or a keyboard with a program. In this program we’re going to tell the user when they click a button. We’ll do this by using a richtextbox. But first we need to get it from the “toolbox”. If you can’t see it or find it then go to “View” and then a bit under that there should be “toolbox”.
     

     
    Once you’re done dragging it onto our Form, you will also need to drag a button to the Form. For the sake of neatness we went with putting our button centered at the bottom.
     

     
    We’re now going to rename our button so we can easily refer to it in our code. To do this, click once on the button and move your cursor to the properties tab on the right and scroll until you find the “Design” section and you find design name. Visual Studio can be quite picky about the design names so we’ll just stick with “button”. It’s important to note that spaces will not work on this and instead they will require “_”.  We’re also going to name the richtextbox to “text”
     

     
    Remember how we earlier talked about C# being event based? It still applies here. First we’re gonna make the richtextbox output some text once the button is pressed. We can do this by pressing the events icon in the below screenshot.
     

     
    To create an event handler we need to double click on the appropriate event and double click.
    Now Visual Studio is generating some code for us when we use event handlers. All we need is the code which tells the richtextbox to display text. We do this by inputting the code shown in the screenshot below.
     

     
    The /r/n will mean that after it creates the text it will make it go down one line and will make space for another piece of text should we want one. Now we’re going to take a look at functions and how they work. In this example we’ll create a function called “WelcomeMessage”. We can do that like so…
     

     
    That's the end of the code for the guide.
     
    Functions/Methods:
    In C# in order to get the computer to run something you need functions. These are a statement explaining what you want the function to be like followed by an opening “{“ and closing “}”. Everything inside those fancy brackets is code that gets run when the function gets called.
     
    To create a function, you need to first declare the type (private or public - this doesn't matter too much so don't worry about it too much, if you're unsure then pick private). After that, we leave a space and type "void". This next bit can be a little annoying if you get it wrong so pay attention and take notes. We have to obey the same rules as we did for the design name of the form. We can't use spaces, or anything other than letters and underscores. We then need to add a double special bracket or {} when first creating it. Press enter and open the insides of the bracket so that you can put code inside the function. For example Welcome_Message{
     
     
    }
    When calling the function it needs to be exactly the name you called it above but we need to add double regular brackets instead and a semi colon. For example
     
    Welcome_Message();
     
    I know this didn’t cover too much but we have covered basic principles, ideas, items and even some code.

    This was just a beginner’s guide! if you‘re interested then feel free to leave a comment letting me know if you want a guide on how to make useful programs in C#. And how to make more complicated Windows Forms programs.
     
    Wow, did this take ages to complete.
     
    Thank you very much @jubjub for helping me out on this! I really appreciate it!
     
    I am in the process of creating an Interactive edition and will update the post when that's complete.
     
    I'm AluminiumTech and until next time, Happy Programming
     
    EDIT - Also made a PDF of this
     
    Ultimate C sharp beginner guide.pdf

  6. Like
    A1Jon reacted to MG2R in Guides & Tutorials Catalog   
    The Guides and Tutorials Catalog
     
    In order to simplify the search for guides and tutorials which might be tagged
    badly, and to help you look for specific things by subject without having to fight
    the broken IP.Board search function, we'll be tracking complete tutorials about a
    specifc subject here.
     
    The idea is to have a nice catalog people can browse by subject. The tutorials
    linked to here are of decent quality, meaning that they cover the subject in a
    reasonably complete, understandable, and properly formatted way.
     
    If you feel we've missed a quality tutorial, feel free to PM a mod or reply to this
    thread. Also check this post.
  7. Like
    A1Jon reacted to manikyath in [Guide] How to watch Twitch streams in VLC Player   
    you can use chatty ( http://chatty.github.io/ )
    for chat.
  8. Like
    A1Jon reacted to ZetZet in [Guide] How to watch Twitch streams in VLC Player   
    Also worth pointing out, if you watch one or two streams often you can make a tiny .bat file like this one 
    livestreamer.exe twitch.tv/url quality and it will launch your favorite stream with just two clicks instead of typing channel name and quality every time.
     
    It also works with hitbox.tv
  9. Like
    A1Jon reacted to manikyath in [Guide] How to watch Twitch streams in VLC Player   
    thats the reason html5 isnt default everywhere yet, backwards compatibility.
     
    i've done my own share of neckbeard patching to keep outdated stuff running, some of it i still use.
  10. Like
    A1Jon reacted to sirtoby in [Guide] How to watch Twitch streams in VLC Player   
    I guess that's a limitation of Livestreamer. You could write to the developer, and request the feature. I wasn't even aware that you can watch a vod while the stream is still going.
  11. Like
    A1Jon reacted to manikyath in [Guide] How to watch Twitch streams in VLC Player   
    WAIT... that actually worked perfectly first try? (i actually didnt bother testing...)
     
    also, twitch has a new player going on on some channels, sometimes it seems.
  12. Like
    A1Jon reacted to sirtoby in [Guide] How to watch Twitch streams in VLC Player   
    You would need to bend the rules a bit If you don't submit it, then make a separate thread for the program. 
  13. Like
    A1Jon got a reaction from sirtoby in [Guide] How to watch Twitch streams in VLC Player   
    Thank you so so much, @manikyath & @sirtoby !!
    I think this Batch code is complete and works perfectly fine for both Live and Past casts now, awesome! :lol:
    Good work guys.
    Now lets hope Twitch dumps this horrid Flash Video Player all together and moves fully to HTML5... before that Youtube Gaming website lunches. Hurray for competition!
  14. Like
    A1Jon reacted to sirtoby in [Guide] How to watch Twitch streams in VLC Player   
    You could make the default channel LTT, so it could be featured here http://linustechtips.com/main/topic/193630-complete-list-of-forum-addons-scripts-apps-etc/
  15. Like
    A1Jon reacted to sirtoby in [Guide] How to watch Twitch streams in VLC Player   
    Not as much cpu usage and you can't see twitch chat
  16. Like
    A1Jon reacted to sirtoby in [Guide] How to watch Twitch streams in VLC Player   
    exactly
  17. Like
    A1Jon reacted to manikyath in [Guide] How to watch Twitch streams in VLC Player   
    @ echo offcd C:\Program Files (x86)\LivestreamerSET /P url=[Please enter the twitch.tv username]SET /P quality=[Please enter the quality]SET /P videoID=[Please enter the video ID]livestreamer.exe twitch.tv/%url%/v/%videoID% %quality% theres the code to watch past broadcasts. could add a hook to automagically switch between both.
     
    @ echo offcd C:\Program Files (x86)\LivestreamerSET /P url=[Please enter the twitch.tv username]SET /P quality=[Please enter the quality]SET /P videoID=[Please enter the video ID, "live" for livestream]IF %videoID%=="live" (    livestreamer.exe twitch.tv/%url% %quality%) ELSE (    livestreamer.exe twitch.tv/%url%/v/%videoID% %quality%)  
    something along these lines perhaps?
  18. Like
    A1Jon reacted to manikyath in [Guide] How to watch Twitch streams in VLC Player   
    so, i managed to make a very crude java application that does pretty much the same as this script, but in an approachable UI.
    decided to also add in chatty support, although that seems to be a bit derpy.
     
    a few questions have arised tho:
    - can i post the jar file on the forum? (y'know, software distribution)
    - should i post the source code / java project along with it?
    - chatty appareantly has built in livestreamer support, am i doing something redundant?
    - how can i post it so it doesnt disappear into oblivion after a week?
  19. Like
    A1Jon reacted to manikyath in [Guide] How to watch Twitch streams in VLC Player   
    i could patch it into my java app, its as simple as adding a field to target videos, and add the necessary code behind it. (which isnt much)
    other than that, probably pretty easy to patch it into the batchfile as well.
  20. Like
    A1Jon reacted to manikyath in [Guide] How to watch Twitch streams in VLC Player   
    should i make a java application that casts this in a nice GUI? i'd probably be able to, and be more appealing to the folks that dont like console.
  21. Like
    A1Jon reacted to sirtoby in [Guide] How to watch Twitch streams in VLC Player   
    So you can't watch Twitch streams properly, because your Laptop gets too loud or your PC is too slow? This method should drastically reduce the CPU power needed to play the stream. I will show you how to put a simple Batch file together that does most of the things for you. All you will have to do is to enter the channel you want to watch and the desired quality. Keep in mind that this method circumvents ads.
    Livestreamer as well as VLC run on almost anything: Windows, OSX, Linux and BSD
    UPDATE: You're now able to watch past broadcasts
     
    What you need:. 
    -VLC Player (DL: http://www.videolan.org/vlc/index.html)
    -Livestreamer (DL: https://github.com/chrippa/livestreamer/releases)
    -Editor
     
    What you need to do:
    1: Download and install VLC and Livestreamer
    2: Create a new text document on your Desktop
    3: Paste the following lines into the text file (You might have to change the second line if you installed Livestreamer in a different folder)
    remove the space between @ and echo
    @ echo offcd C:\Program Files (x86)\LivestreamerSET /P url=[Please enter the twitch.tv username]SET /P quality=[Please enter the quality]SET /P videoID=[Please enter the video ID or live for livestream]IF %videoID%==live (    livestreamer.exe twitch.tv/%url% %quality%) ELSE (    livestreamer.exe twitch.tv/%url%/v/%videoID% %quality%)
×