• What are you working on? December 2011 Edition
    3,353 replies, posted
[QUOTE=Jookia;33746581]What happens if you find something else out there? Do you use that over Boost? Why?[/QUOTE] Using Boost just for FS stuff is ridicilous. He should be using the standard library.
[QUOTE=DuCT;33746699]Boost isn't appealing to me. It's a pain setting it up, and to just use boost::filesystem I have to download the whole freaking package.[/QUOTE] Well then just say that, don't say you're looking for alternatives for no reason. Also, Boost allows you to extract modules from its source tree and their dependencies. [editline]16th December 2011[/editline] [QUOTE=dajoh;33746706]Using Boost just for FS stuff is ridicilous. He should be using the standard library.[/QUOTE] C++'s standard library doesn't understand filesystems.
Over the past few days I've been looking over my old projects and touching them up, licensing them (under zlib), and uploading them to my github account. I'm not all that proud of some of the code up there (mainly the Far Cry 2 tools), but at least it's on the internet and not on some corner of my hard drive. [url]https://github.com/Robmaister[/url] I'm also going to create a repo for my Ludum Dare 22 entry and push to it regularly.
[QUOTE=Jookia;33746959] C++'s standard library doesn't understand filesystems.[/QUOTE] What do you mean by this? Also, I'm not talking about the C++ standard library, I'm talking about C standard library.
[QUOTE=dajoh;33747657]What do you mean by this? Also, I'm not talking about the C++ standard library, I'm talking about C standard library.[/QUOTE] Neither the C++ or C standard libraries understand the concept of a filesystem. It can open and close files, but that's about it.
This page is so boring. I don't know why, but I feel that Boost has this aura of boredom emanating from it and any mentions of it.
[QUOTE=Jookia;33747696]Neither the C++ or C standard libraries understand the concept of a filesystem. It can open and close files, but that's about it.[/QUOTE] If he needs to walk the filesystem, he should just use the native functions.
[QUOTE=dajoh;33747880]If he needs to walk the filesystem, he should just use the native functions.[/QUOTE] [QUOTE=DuCT;33744549]Anybody know of a [b]cross-platform[/b] filesystem library that isn't Boost's?[/QUOTE]
QtCore?
[QUOTE=HubmaN;33748297]QtCore?[/QUOTE] [IMG]http://img23.imageshack.us/img23/3446/screenshot2011121601083.png[/IMG]
[QUOTE=thisBrad;33748305][IMG]http://img23.imageshack.us/img23/3446/screenshot2011121601083.png[/IMG][/QUOTE] [img]http://www.facepunch.com/avatar/431348.png?garryis=awesome[/img] Boy did I read the thread.
I just finished testing our connectors for the Facepunch Lua SDK. We write the entire API in native Lua and have a module called "facepunch.http" which handles all of our internal GET and POSTs. When you download the API to use, the API doesn't know anything about making connections. This is where you step in. What flavor of connector would you like to use? You get to decide. The SDK comes with two connector helper scripts, one for luacurl and one for luasocket. For our tests, hooking these up is really simple. It looks like this: [lua]require( "facepunch" ) -- Setup our connector -- Use luacurl for this test require( "connectors.luacurl" ) [/lua] And you're done loading the FPAPI. Requiring "facepunch" loads the main module and its submodules, then it's your choice to use the helper scripts we've provided, or to write in your own connector. Maybe you're in an environment where you can't use either. That's okay. HTTP connectors look like this: [lua]------------------------------------------------------------------------------- -- http.get() -- Purpose: The get wrapper function for the facepunch module. All retrieval -- functions rely on this wrapper for parsing. It must return the full -- page if possible and a status code (200 OK). -- Input: URL - URL to get -- Output: document, status code ------------------------------------------------------------------------------- function get( URL ) error( "facepunch.http.get was not implemented!" ) end ------------------------------------------------------------------------------- -- http.post() -- Purpose: The post wrapper function for the facepunch module. All submission -- functions rely on this wrapper for interaction. It must return the -- full page if possible and a status code (200 OK). -- Input: URL - URL to post to -- postData - table of POST information -- Output: document, status code ------------------------------------------------------------------------------- function post( URL, postData ) error( "facepunch.http.post was not implemented!" ) end [/lua] And that's it! Technically speaking, this should even work with GMod (http library), and LOVE (embedded luasocket). Woo! Right now the API doesn't utilize sessions, it did a few revisions ago, but I had to rework the API to use this connector approach, so we don't favor one binary module over the other. Sessions will be back in soon. Tomorrow, I'll work on that. The nice thing about all this is that it's binary module-free, which hopefully will stay that way further down the line as well.
[QUOTE=supersnail11;33746262]I heard today that we might be upgrading the school's computers from Windows XP to [URL="http://www.edubuntu.org/"]this[/URL]. Fuck yeah.[/QUOTE] Yeah they tried the same at my school, but after some kids went "lawl my prugrams wont werk its broken" they changed it back.
[QUOTE=DrLuke;33748354]Yeah they tried the same at my school, but after some kids went "lawl my prugrams wont werk its broken" they changed it back.[/QUOTE] Lol that kid wasn't 3l33t like us right? Seems stupid to use some strain of Linux to teach kids about computers.. when in the real world they'll most likely be using Windows. I'm not saying that out of some kind of allegiance with Windows, that's just a fact.
I don't even think my school has a single Windows computer lab, they are all Linux and Mac :v:
[QUOTE=garry;33748374]Seems stupid to use some strain of Linux to teach kids about computers.. when in the real world they'll most likely be using Windows. I'm not saying that out of some kind of allegiance with Windows, that's just a fact.[/QUOTE] I live in the Linux world and even I can agree with that. But in my opinion when you actually want to learn about how a computer works, and maybe even program, you'd have to check out Unix. In my experience programming on Windows includes hours of yelling at MSVC.
[QUOTE=DrLuke;33716490][vid]http://dl.dropbox.com/u/28079852/love%202011-12-14%2015-28-21-38.webm[/vid] It even worked on the first try (except for one "end" I forgot :P)[/QUOTE] Dang bro. My console is the first thing I made in Love2D and it looks exactly the same as yours. I downloaded another console because of all the "extra features" and it looked exactly like yours and mine.
[img]http://puu.sh/aLOG[/img] Just screwing around with it now, no motivation [editline]16th December 2011[/editline] [img]http://puu.sh/aLQq[/img]
[QUOTE=garry;33748374]Lol that kid wasn't 3l33t like us right? Seems stupid to use some strain of Linux to teach kids about computers.. when in the real world they'll most likely be using Windows. I'm not saying that out of some kind of allegiance with Windows, that's just a fact.[/QUOTE] Linux needs a little more know how to use it as effectively as windows when you don't know much about it, and considering most people are already using Windows at home, teaching them Linux in education might be a pretty good way to go about it (and those of us who are already using Linux get to use it more conveniently)
[QUOTE=danharibo;33748917]Linux needs a little more know how to use it as effectively as windows when you don't know much about it, and considering most people are already using Windows at home, teaching them Linux in education might be a pretty good way to go about it (and those of us who are already using Linux get to use it more conveniently)[/QUOTE] But only neckbeards use Linux.
We just got given shitty old PCs that they got given by some bank and installed Linux on those at my school.
After a long break from saving and loading, I spent the last hour looking up how to write/read text files in XNA 4.0 but I could only find page long functions to write one line. My memory told me that there was an easier way. Discovered that you could just use stream.WriteLine(str); There must be a reason that no-one wrote anything to do with that. Either that or I suck at Google.
[QUOTE=Hruhf;33749171]After a long break from saving and loading, I spent the last hour looking up how to write/read text files in XNA 4.0 but I could only find page long functions to write one line. My memory told me that there was an easier way. Discovered that you could just use stream.WriteLine(str); There must be a reason that no-one wrote anything to do with that. Either that or I suck at Google.[/QUOTE] By XNA 4.0 i assume you mean C#. I usually use a TextReader/Writer. [cpp] using System.IO; TextWriter writer = new StreamWriter(filePath); writer.WriteLine(str); writer.Close(); TextReader reader = new StreamReader(filePath); Console.WriteLine(reader.ReadToEnd()); reader.Close(); [/cpp]
[QUOTE=Dj-J3;33749275]By XNA 4.0 i assume you mean C#. I usually use a TextReader/Writer. [cpp] using System.IO; TextWriter writer = new StreamWriter(filePath); writer.WriteLine(str); writer.Close(); TextReader reader = new StreamReader(filePath); Console.WriteLine(reader.ReadToEnd()); reader.Close(); [/cpp][/QUOTE] I ended up using [cpp] using System.IO; StreamWriter stream = new StreamWriter(path); stream.WriteLine(str); stream.Close(); etc. [/cpp] I'm just curious to why I could not find that solution anywhere
[QUOTE=garry;33748374]Lol that kid wasn't 3l33t like us right? Seems stupid to use some strain of Linux to teach kids about computers.. when in the real world they'll most likely be using Windows. I'm not saying that out of some kind of allegiance with Windows, that's just a fact.[/QUOTE] It's a nice thing imo, when students start getting used to linux there's a chance that in the future the real world will be in linux as well :) Also the difference between win + linux is not so big anymore anyway, moving from word to openoffice is a nice thing too.
[QUOTE=Hruhf;33749357]I ended up using [cpp] using System.IO; StreamWriter stream = new StreamWriter(path); stream.WriteLine(str); stream.Close(); etc. [/cpp] I'm just curious to why I could not find that solution anywhere[/QUOTE] [url]http://www.csharp-station.com/HowTo/ReadWriteTextFile.aspx[/url] [url]http://www.dotnetperls.com/streamwriter[/url] [url]http://msdn.microsoft.com/en-us/library/aa287548(v=vs.71).aspx[/url] Found by searching for "csharp write to text file streamwriter"
[QUOTE=Dj-J3;33749384][url]http://www.csharp-station.com/HowTo/ReadWriteTextFile.aspx[/url] [url]http://www.dotnetperls.com/streamwriter[/url] [url]http://msdn.microsoft.com/en-us/library/aa287548(v=vs.71).aspx[/url] Found by searching for "csharp write to text file streamwriter"[/QUOTE] I feel stupid now
[QUOTE=garry;33748374]Lol that kid wasn't 3l33t like us right? Seems stupid to use some strain of Linux to teach kids about computers.. when in the real world they'll most likely be using Windows. I'm not saying that out of some kind of allegiance with Windows, that's just a fact.[/QUOTE] While I couldn't agree more with this, Windows licenses, even for educational use (unless you have an MSDN) are fairly expensive, whereas linux is free. Still though, it all comes down to amount of cash spent vs. using something people know and will use in the future.
[QUOTE=Hruhf;33749464]I feel stupid now[/QUOTE] :v: Just out of curiosity, what did you search on? If you don't mind telling.
[QUOTE=Dj-J3;33749487]:v: Just out of curiosity, what did you search on? If you don't mind telling.[/QUOTE] Something along the lines of "XNA 4.0 text file writing"
Sorry, you need to Log In to post a reply to this thread.