Jump to content

Tazman192

Member
  • Posts

    543
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Tazman192 got a reaction from Rastafun in Getting text from a website in Java for Android   
    package com.flareradio.flareradio; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.TextView; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.io.InputStream; public class MainMenu extends AppCompatActivity { String songName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_menu); TextView textView; String songName = getSongName(); if (songName == null) { Log.i("MainActivity", "Song name is null - parsing failed.") } else { textView = (TextView) findViewById(R.id.textView); textView.setText(songName); } } public String getSongName() { String songHTML = null; try { // Here we make a URL to the web page URL flare = new URL("http://www.api.flare-radio.com/php/song/"); // Next, we need to get the input stream through the URL connection // (you were missing this step) URLConnection connection = flare.openConnection(); InputStream is = connection.getInputStream(); // Once an input stream is created, the rest is basic Java IO method calling BufferedReader in = new BufferedReader(new InputStreamReader(is)); // Read one line at a time and concatenate to the songHTML string while ((parsedLine = in.readLine()) != null) { songHTML += parsedLine; } in.close(); } catch (Exception ex) { ex.printStackTrace(); } return songHTML; } }  
     
    Don't have any IDE for Java on my laptop so may have some code errors (wrote this on Sublime), but run it and let me know if there are any errors.
  2. Agree
    Tazman192 got a reaction from vorticalbox in Best language for a begginer?   
    The first post I see on this topic is
    With all due respect to @domandric034, if you actually want to stick at it then don't start with C or C++. Sure they're everywhere. Sure they'll get you a good salary when you get good at it, if you get good at it. Neither C or C++ is a friendly language for a beginner at all. I've been programming in C for 5 years, coming from a Java background (5 years isn't shit, I know), and hell I still suck at it. But you could get real competent at other languages real quick. The problem with C and C++ is that it's such a low level language that you require knowledge of computer science concepts such as a computer's memory system.
     
     
    If you want to truly learn a language, think of a project and learn the language required for that project. There's no "best" language to learn. Want to build a web app? Javascript. Android app? Java. iOS app? Objective C. Game or Windows program? C#. You get the point. 
  3. Agree
    Tazman192 reacted to corrado33 in Oh indentation indentation...   
    I've always used tabs. However I've always used coding focused editors, so I'm sure it put spaces in for me. I think the tabs were probably ~4 spaces or so. Anything smaller and it's hard to discern where the indentation is. 4 spaces seems enough to be able to find the beginning and matching end for a loop just by a quick glance. 
  4. Agree
    Tazman192 reacted to Mira Yurizaki in Whats the point ( duo / single BIOS )   
    Motherboards have two in the event your primary one gets corrupted either just because or due to a botched update. This is a good thing, otherwise you'll be left with a bricked motherboard.
  5. Like
    Tazman192 got a reaction from -rascal- in What programming language should i learn?   
    In that case, I would recommend OP learn Java. You can learn everything listed by writing a simple Java app, and could also pick up some important OO concepts such as polymorphism, encapsulation, inheritance, and what not which I would argue are way more benefical to learn than handling memory, especially at the early stages.
  6. Like
    Tazman192 got a reaction from elpiop in Java - Are Strings Arrays?   
    When I say "immutable", I mean in memory. When you first do String s1 = "Example";, you're creating a new String object and giving it the value "Example".
     
    When you do s1 = "Edited", you are actually again creating a new object, as opposed to editing the existing object.  You create the new string "Edited", and then change the reference of s1 to point from "Example" to "Edited".
  7. Like
    Tazman192 got a reaction from elpiop in Java - Are Strings Arrays?   
    I added a little more to my post to explain. I'll add a little more here.
     
    Say you create the string:
     
    String x = "foo"; This is implicitly saying:
    String x = new String("foo"); When you want to change x to "bar:
     
    x = "bar"; This is again implicitly saying:
     
    x = new String("bar") Meaning, because we used the "new" keyword, we have created a NEW String object, and we have pointed an existing variable to point to this newly created object. This is opposed to a mutable type such as an int - you don't implicitly create a new int everytime (or at all - int's aren't objects, they're primitive), you overwrite your existing int..
  8. Like
    Tazman192 got a reaction from Bromar in How to setup audio like normal computer   
    For your motherboard (Asus Z97 Pro), you can download the Realtek HD audio drivers which would download an audio manager for you and do exactly what you desire. What would happen is when you connect your headphone to your audio jack, an option comes up to select what the input device is (headphone or front speaker out). This makes it much easier than going to the control panel and setting the default device each time.
     
    You can download it here: https://www.asus.com/uk/Motherboards/Z97PRO/HelpDesk_Download/
     
    Select your OS, go to Audio, and download the Realtek Audio Driver.
  9. Like
    Tazman192 got a reaction from mr.happy in will a 120gb ssd be enough?   
    This depends. What are you storing? Obviously OS. What about games? Do you have a secondary storage drive? Most likely, 120gb won't be enough in the long term and you're better off spending the extra $21 on the 250gb version. I've used 140 out of 250gb of my SSD, and I store games on a secondary storage drive, if you'd like a comparison.
  10. Like
    Tazman192 got a reaction from mr.happy in will a 120gb ssd be enough?   
    You're welcome.
  11. Like
    Tazman192 reacted to Bananasplit_00 in Looking for game suggestions   
    stelth FPS: lurker in CS:GO
     
    lol
  12. Agree
    Tazman192 reacted to Kevin_Walter in Creating a portfolio website   
    So much red...
     
    Your social media icons are low quality and aren't aligned properly, and your navigation looks like it may be off a bit as well, though that could just be my eyes.
  13. Like
    Tazman192 reacted to TroubleKlef in Your favorite fast food dipping sauces?   
    No chick-fil-a in the UK? A very sad day for the Brits.
  14. Like
    Tazman192 got a reaction from -TesseracT- in BMR Calculator - My first SWING Application   
    Hi.
     
    Figured I'd like to contribute something to my portfolio this Summer. As a CS student, the only applications I've developed are ones that were assigned as coursework and nothing that I actually found any use for myself.
     
    I decided I'd develop a BMR/TDEE Calculator which is fully customizable by the user. I'll also allow the user to save logs of his/her calculations to help them reach their desired goal.
     
     
    Although this application is simple in principle (I've already got a command-line application fully working which ensures the user enters correct input, or else warnings are thrown), the tricky part is choosing LayoutManagers and getting a nice looking layout going on. As this is my first time developing a swing application, I'm doing alot of experimenting with different layout managers trying to find the best one for this project.
     
    https://github.com/F-Tahir/BMRCalculator/ a link to my GitHub for anyone interested in following this mini project. I know you can find a shit ton of these calculators online but I'm not very original and I think this is a good starting project. The readme file contains some screenshots of what the interface currently looks like, and I'll aim to update this.
     
    Let me know what you guys think. Any suggestions to make it more useful?
  15. Like
    Tazman192 reacted to Charger in Will i get ink posining or blood posiing from this or ?   
    H2O is deadly stuff... do you think it is a coincidence that everyone that has ever consumed H2O has died or will die... lol /joke
  16. Like
    Tazman192 reacted to Ertman in I am torn...   
    For the CPU, I wouldn't bother waiting. I am sure there will be some improvements, but since there isn't expected to be much improvement going to broadwell in general, I would think that the e-series would also be the same. Feel free to wait for more opinions.
     
     
    I haven't seen a need listed, so I am guessing the OP just likes throwing money away. strange since they want to water cool and need to save for the additional expense, but they need to throw away hundreds of dollars on a PSU they don't need.
  17. Like
    Tazman192 reacted to MrAnonymous in Hyper 212 Evo but not a Hyper 212 Evo   
    noted** never really looked into those CPU coolers, since i just go for 212 automatically XP
  18. Like
    Tazman192 got a reaction from Reuben in What brand makes the best motherboard.   
    You can't really go wrong with Asus, Gigabyte, Asrock or MSI. All of these make great motherboards/
  19. Like
    Tazman192 reacted to Jade in So I got stabbed yesterday...   
    He stabbed you. That is assault. Don't let it go unpunished, they will not learn.
  20. Like
    Tazman192 got a reaction from berserker in Is my cpu cooler okay?   
    Yup, cheers guys seems like it was nothing to worry about. Now I remember why I was so hesitant in remounting this cooler, pain in the ass to mount. Temps actually dropped a fair bit from the 4670k to 4690k (atleast 12c on full load AIDA64). Not sure if its my thermal paste application was sloppy first time round, or the TIM really has improved.
     
    Oh well, I'm happy. Paid nothing to upgrade
  21. Like
    Tazman192 got a reaction from TDP_Equinox in AIDA64 Help?   
    Hurp durp.
     
    Cheers lol.
  22. Like
    Tazman192 reacted to Jade in Just used IBT - what are my temps like?   
    Linus knows better than I do. But yeah, no problem. Best of luck with the OC.
  23. Like
    Tazman192 got a reaction from Tacitus in Best camera for £100-150?   
    Haha same. Edinburgh is truly a beautiful place, even if you've lived here all your life.
  24. Like
    Tazman192 got a reaction from Tacitus in Best camera for £100-150?   
    Take it you don't live in Glasgow then
  25. Like
    Tazman192 got a reaction from HEU7Hwhu7 in Buy an SSD now or wait till windows 10?   
    Here in UK the price is pretty static.
     
     
    That's like extreme punishment... An SSD waiting in the cupboard to be used? No thanks
×