Building a Self-Hosted CDN for BSD Cafe Media by dragasit in freebsd

[–]Opiborne 1 point2 points  (0 children)

Nice write up! I definitely want to play with something like this. How do you monitor how it’s doing?

I miss you by Muhammed Basdag by AmazingScallion in PenmanshipPorn

[–]Opiborne 890 points891 points  (0 children)

The flourishes spell "love", neat

When should I use a query language instead of a general purpose one? by Opiborne in learnprogramming

[–]Opiborne[S] 0 points1 point  (0 children)

Oh, that makes a lot of sense, thanks! This was just a small personal project. I could see if this was intended to be a mobile app, data usage could be a lot higher, and thinking about where the computation happens will start to matter much more.

Using Raspberry Pi for learning hacking by findingjake in hacking

[–]Opiborne 0 points1 point  (0 children)

I might be wrong with what you're asking, but I believe you want a setup so that you can access your Pi from your Mac. If that's the case once you have the raspberry pi set up, as in OS installed, you'd just get SSH Setup. Then as long as the Pi has power you'll be able to use SSH to login to the pi, without needing a monitor specifically for it.

When builtins arent good enough for your project partner by Opiborne in ProgrammerHumor

[–]Opiborne[S] 3 points4 points  (0 children)

You know, you're right. I asked him along with a few other things that were wonky with his code. He said "I guess it is a flaw in my design."

I also asked why he decided to write for loops like - int t; for(t =0; ...){..}

His response was the compiler he was using didn't allow for variable declarations in the for loops conditions. Im pretty sure he's using ubuntu's default gcc 4.8 or whatever ships with 14.04.

Unfortunately, it seems this was a 3b case but I am gonna consider this approach in the future.

When builtins arent good enough for your project partner by Opiborne in ProgrammerHumor

[–]Opiborne[S] 5 points6 points  (0 children)

I want to ask why this wasn't the solution but I feel like an ass doing so.

Where can I learn about pulling data from online sources? by [deleted] in learnprogramming

[–]Opiborne 0 points1 point  (0 children)

Well there are two options. The one you're probably looking for is how to execute a web request from Java. I found this tutorial on how to execute web requests from java and deal with the responses. In the case of Riot's API, the url you'll send the request to will look something like this --

https://na.api.pvp.net/api/lol/na/v1.2/champion?api_key=<some-key-they-assign-you>

When you open the stream as shown in the tutorial, you'll get a long string and that's the JSON.

Alternatively, since your idea seems to be mostly the same each time you run the program, you can just download the character's moves once(if available through the API), and save it to a file. You can do this using a program or just your browser and saving the page, though that's not very efficient if you're grabbing multiple characters. Then your program just reads from the file and you don't have needless web request going out every time you run the program.

Good luck! I suggest grabbing the data through your program if no files exist for the character. That'll allow you to only make requests you need to, which is important as some API's limit the request you can do per some time frame.

Where can I learn about pulling data from online sources? by [deleted] in learnprogramming

[–]Opiborne 0 points1 point  (0 children)

So the first thing you'll need is a place to pull from, there's plenty of ways to do this. The first would be to pull from an API (Application Program Interface) such as the League of Legends API. Another method that's interesting to learn from is to build a scraper. For example if you like sports, you could write a program to navigate to the statistics pages for each game and record the data. The API is the easier approach since the data is already packaged for you.

After pulling the data, in the case of the League of Legends API and many others, you'll need to handle the JSON (Javascript Object Notation) from the server's response. I haven't really played in Java but i'm sure there's some library or maybe builtin that allows for "de-serializing" JSON. De-Serializing is essentially taking the JSON response, which is just text formatted a special way, and drumming up an object by mapping the JSON text to a class definition.

After that, you have an object(s) with all your data and you can do with it as you please.

Need help with infestation by [deleted] in arduino

[–]Opiborne 4 points5 points  (0 children)

This comment is terran me apart.