Jump to content
  • Advertisement

tasen

Member
  • Content Count

    62
  • Joined

  • Last visited

Community Reputation

148 Neutral

About tasen

  • Rank
    Member
  1. tasen

    Storing and comparing data feeds

    Quote:Original post by Antheus Quote:Original post by tasen Does anyone else have any ideas? Yea, when you solve it, apply for a job (second puzzle). In simpler form, it's just trivial set algebra. If using SQL database, parse the contents, put them into tables. Then look into various types of JOINs. The results you want would be result of 3 queries. To find changes, you would perform an INNER JOIN. The other two would probably be something involving NOT EXISTS query. SQLite should be capable of this, it can be driven from command-line fairly trivially. Awesome, thanks Antheus. To be honest I didn't really want to roll my own solution, but after doing some research and looking at the verbose output a lot of diff tools give it would probably make sense to do it this way. Besides, what I'm doing isn't quite what a diff tool is designed for. I think I'll be able to knock something up with PHP and MySQL... great idea... very cool. Thanks again!
  2. tasen

    Storing and comparing data feeds

    Bump :) Does anyone else have any ideas?
  3. tasen

    Storing and comparing data feeds

    Quote:Original post by KulSeran Quote:and have the ability to compare different versions, much like how Wikipedia works. Do you just want a version control system? If all the data is plain-text readable, you could just drop it into GIT, Perforce, or mercurial and let it run diffs on the different versions of the file. Hi KulSeran, That's kind of what I want, but not quite. Thinking about it, the output probably wouldn't be meaningful for what I need (see below for details). What I *really* want to do is, given the following CSV files in the format of (SKU,ProductName,Price): old.csv product1,Product1,$10 product2,Product2,$20 product3,Product3,$30 new.csv product1,Product1,$10 product2,Product2,$50 product4,Product4,$40 ...Do a comparison to report the following: Changes: - product2 price change $20 to $50 Deletions: - product3 Additions: - product4 (product4,Product4,$40) So I would have a list of data feeds from one manufacturer, and have the ability to compare them arbitrarily to see the differences as per above. Hope that made sense :)
  4. tasen

    Storing and comparing data feeds

    Hi benryves, Thanks for that. Sorry I should of clarified: There may be several data feeds stored in the database, but the comparison will only ever be between no more than two feeds at a time (i.e. old vs new revision).
  5. Hi all, I'm looking for a way to compare and report the differences between several data feeds (CSV product feeds). What I would like to do is store said data feeds in a database under separate categories, and have the ability to compare different versions, much like how Wikipedia works. Wiki software is close to what I want, but not quite right (all I really need is the ability to store feeds in a database and the comparison functionality). Can anyone recommend a software solution that would be able to accommodate this? Thanks for any help :)
  6. Quote:Original post by Codeka Heh, sorry, that was a rather short response. I figured since that was your idea already you probably had a good idea of where to start... Anyway, a browser plugin is basically just a DLL. Under IE, it's a COM component, but under Firefox/Chrome/etc it's usually a DLL that exports certain functions which the browsers uses to call the DLL. Most browsers (except IE) use an API called "NPAPI" to expose plugins to the browsers. You're supposed to be able to write your plugin to the NPAPI spec and it should plug in to all of the other browsers (in reality, there's tiny differences between them all which means it doesn't work out in practise but anyway)... I'll describe the process for NPAPI, since it's considerably simpler than IE's ActiveX model (the basic concepts are the same, though). Basically, when you develop your plugin, you advertise a specific content-type that you want to handle, say "application/x-my-game". Then, whenever the browser tries to render content of type "application/x-my-game" it loads your plugin, reserves an area of the browser window for it, and passes it a HWND (on Windows, Linux/Mac are similar but different) of a control that fills that area. Your plugin can basically do whatever it likes with that HWND. In your case, you'll probably want to initialise OpenGL/DirectX and use that HWND as the context. It's just a normal HWND so you can respond to WM_CHAR/WM_MOUSEMOVE/etc events as normal. The main difficulty with writing browser plugins is the subtle difference in the way the different browsers work with plugins. You might write a plugin for Firefox, but it doesn't work in Chrome/Opera/etc. And of course, you have to write a totally different plugin to work with IE (at the end of the day, though, you'll probably use the same "engine" and just write a wrapper that exposes your engine as a plugin for IE/Firefox/etc). Here's Mozilla's documentation for developing plugins. I'd also suggest you check out Unity3D, which is a game engine that already supports running in a browser plugin. Wow, that's some fantastic information Codeka! Exactly what I was looking for. That will definitely give me something to get started on. For the time being I'm going to focus on one browser/platform to make sure my proof of concept works properly. The next part of my problem involves transferring the game's rendering context into the browser (Direct3D, specifically). And input. My ultimate goal is to create a launcher that will run the game so that it looks like it's running *entirely* in the browser, when in reality the game is running locally in the background and being "mirrored" inside the browser. Thanks again!
  7. Quote:Original post by Codeka Quote:Original post by tasen I had a (theoretical) idea that I could write a browser plugin that got the game's rendering context and displayed it in the web browser instead of its own window, whilst redirecting input from the web browser to the game (if that makes sense). Is this at all possible? (My guess is no, since I haven't seen this being done before).In fact, that's exactly how QuakeLive works :-) Haha. Care to elaborate a bit? ;-)
  8. Hi everyone, I'm interested in doing some browser based games and was looking for some advise on what sort of technologies to use. Not really creating games from scratch, but rather porting existing ones over. What I'm *really* interested in is technology similar to QuakeLive, where you've basically got the Quake 3 engine running in a web browser. Does anyone have any information on how this was done, as I'm keen to do something similar with some of my own games (written in C++/Win32). Nothing on the same scale, just simple 3D games running in a web browser (with hardware accelerated support, if possible). This is something that I know very little about, so sorry if I'm being vague. I had a (theoretical) idea that I could write a browser plugin that got the game's rendering context and displayed it in the web browser instead of its own window, whilst redirecting input from the web browser to the game (if that makes sense). Is this at all possible? (My guess is no, since I haven't seen this being done before). Any help is greatly appreciated.
  9. tasen

    Recommend any good C++ book?

    The Most Important C++ Books...Ever They might be a little heavy-handed though, depending on your programming experience...
  10. tasen

    [C++] Text File Parser

    This would actually be really trivial if it wasn't for the spaces in the company names. In addition to what was said above, I had a go at it myself. If you get stuck maybe it will give you some ideas. #include <string> #include <fstream> #include <vector> #include <algorithm> #include <iostream> #include <sstream> #include <iterator> // All company information is stored in here. class Company { public: std::string Symbol; std::string Name; float Last; float PrevClose; float Open; float High; float Low; int Volume; int ArgVolume; float PERatio; Company(const std::string& Symbol, const std::string& Name, float Last, float PrevClose, float Open, float High, float Low, int Volume, int ArgVolume, float PERatio) : Symbol(Symbol), Name(Name), Last(Last), PrevClose(PrevClose), Open(Open), High(High), Low(Low), Volume(Volume), ArgVolume(ArgVolume), PERatio(PERatio) { } }; // Helper function to print out the members of our Company class. std::ostream& operator<<(std::ostream& os, const Company& company) { return os << company.Symbol << ' ' << company.Name << ' ' << company.Last << ' ' << company.PrevClose << ' ' << company.Open << ' ' << company.High << ' ' << company.Low << ' ' << company.Volume << ' ' << company.ArgVolume << ' ' << company.PERatio; } // Helper function to convert a string to an arbitary type. // Error checking omitted. // Probably better to use boost::lexical_cast<> here. template <typename T> T from_string_to(const std::string& str) { T result; std::istringstream iss(str); iss >> result; return result; } int main() { const char* FEED_NAME = "samplefeed.txt"; std::ifstream ifs(FEED_NAME); if (ifs.is_open()) { // How many tokens are on each line. const size_t EXPECTED_TOKENS_PER_LINE = 10; // Container to store the tokens on each line. typedef std::vector<std::string> token_container_t; // Container to store the companies. typedef std::vector<Company> company_container_t; token_container_t tokens; company_container_t companies; std::string line; size_t current_line = 1; // Make space for X number of companies you expect to be in the file. //companies.resize(X); while (std::getline(ifs, line)) { std::istringstream iss(line); // Copies all tokens on the current line into our token container. // Uses the default delimiter of " " (space). std::copy( std::istream_iterator<std::string>(iss), std::istream_iterator<std::string>(), std::back_inserter<token_container_t>(tokens) ); // Fixes lines that have multiple Name tokens. It's a bit hackish, but // I didn't have time to think of something better. :) if (tokens.size() > EXPECTED_TOKENS_PER_LINE) { // This is to fix an issue with the Name token(s). For example, // "Google Inc" was treated as two tokens because of the space. // We want to treat it as one token. // tokens[1] is the first Name token. The last Name token will // be the first token we find that contains " (double quotes). // We will append all remaining Name tokens to tokens[1] until // we find last Name token (which we will append as well). // Appended tokens will have their value set to "", or empty, // so that we can later erase them. // tokens.begin() + 2 == the token just after the first Name token. // i.e. tokens[2]. typedef token_container_t::iterator token_container_iterator_t; token_container_iterator_t it = tokens.begin() + 2; // "While we don't find the last Name token" while ((*it).find_first_of('"') == std::string::npos) { // Add a space. tokens[1] += " "; // Add the next Name token. tokens[1] += (*it); // Set the current token to empty. (*it) = ""; ++it; } // The while loop breaks when we find the last name token. Thus we // will add the last name token here. tokens[1] += " "; tokens[1] += (*it); (*it) = ""; struct NeedsRemoval { bool operator()(const std::string& str) { return str.empty(); } }; // Remove any empty tokens from the container. tokens.erase(std::remove_if(tokens.begin(), tokens.end(), NeedsRemoval()), tokens.end()); } // The line is malformed. if (tokens.size() != EXPECTED_TOKENS_PER_LINE) { std::cerr << "Unexpected number of tokens on line " << current_line << ". Skipping...\n"; } else { companies.push_back( Company( tokens[0], // Symbol tokens[1], // Name from_string_to<float>(tokens[2]), // Last from_string_to<float>(tokens[3]), // PrevClose from_string_to<float>(tokens[4]), // Open from_string_to<float>(tokens[5]), // High from_string_to<float>(tokens[6]), // Low from_string_to<int>(tokens[7]), // Volume from_string_to<int>(tokens[8]), // ArgVolume from_string_to<float>(tokens[9]) // PERatio ) ); } ++current_line; tokens.clear(); iss.clear(); } // Print out all companies. for (company_container_t::size_type i = 0; i < companies.size(); ++i) { std::cout << companies << std::endl; } } else { std::cerr << "Unable to open " << FEED_NAME << ". Closing...\n"; return EXIT_FAILURE; } }
  11. tasen

    What's your favorite tip/trick app on Windows?

    Nice little trick I got from here a while ago, lets you right-click on a folder and open it up in a new console window. Quote:BTW here's my favorite registry hack: -Open RegEdit -Goto HKEY_CLASSES_ROOT\Folder\Shell -Create a new key, call it "Command Prompt" -Create a subkey named Command -Set Command default value to "Cmd.exe /k cd %1" -Close RegEdit Now, right-click on any folder for a prompt starting in that directory. Even works on My Computer (inits to desktop directory, ever had to go there from C:\ ?) Always been very handy, props to whoever posted that!
  12. tasen

    Create midi file from cue points?

    Quote:Original post by CitizenJames youd have to use a sequencer that lets you draw midi notes. youll have to set the tempo to that of the chopped clip then write down the milliseconds and such of the beat markers to get the exact times, then just draw the midi notes at those times. Yeah that's what I had been doing, but it's a little cumbersome. Quote:Original post by t00nz It's not exactly the answer you're after, but are you aware of Propellerheads Recycle? I am indeed, but unfortunately I don't have access to it at the moment. It would certainly make things a lot easier though. Thanks for the help.
  13. Hi all. I've got a .wav file that I've "chopped up" (RE: marked the start of every beat) in Sound Forge, and was wondering if there is any way to generate a midi file based on where I've placed the markers. Unfortunately Sound Forge won't save or export midi files directly. I have sliced the .wav up based on the markers and would like to use a midi file to trigger each slice. I know that when I save the .wav file the markers are stored in the cue chunk of the .wav (refer http://www.sonicspot.com/guide/wavefiles.html#cue). Is there a way to convert this information into a midi file? Basically every cue point would trigger one of the slices... I've been hunting around trying to find any applications that can do this, but it seems there aren't any. I started writing my own program to do it, and I can retrieve all the cue points fine, I'm just having loads of trouble with creating a midi file and understanding the midi file format. All help appreciated.
  14. Hey all, I recently purchased an E-MU 1616m PCI sound card and so far it's been great. I'm running my headphones through it and everything is working a treat. Now, what I would like to do is use the in-built mic on my monitor through the on-board audio. Fair enough, I enable on-board audio, install the SoundMAX drivers for it, reboot and plug everything in. The mic was working fine the first time, but as soon as I reboot or turn off the computer again, when I try to use the mic all I get is distortion. I've double checked my sound settings are correct in Control Panel: Under "Audio" Sound Playback is through the E-MU and Sound Recording is through SoundMAX, and under "Voice" Voice Playback is through the E-MU and Voice Recording is through SoundMAX. I've checked every Volume control and all settings are turned up full (no mutes are enabled either). Both the SoundMAX and Creative drivers are the most recent ones. It seems as though there might be some conflict between the audio drivers, but I'm not 100% sure. So my question is does anyone have any experience using both on-board audio and a sound card in a PCI slot? And if so, did they get along or did you have problems? I've been reading through manuals and checking many, many different settings but I'm still not having any luck. Are there any diagnostic tools I could use to check the signal to see if it's being interfered with or something like that? Hopefully someone can help! I've been wracking my brains the last couple of days and its looking as though I won't be able to run them side-by-side.
  15. Hello everyone. I am designing a program that will (hopefully) allow users to customize and store printer settings and allow them to print out different types of documents using the settings they specified. I know it's fairly straight forward to use a Process to launch the file's associated application and send a print command, like: Process proc = new Process(); proc.StartInfo.CreateNoWindow = true; proc.StartInfo.Verb = “print”; proc.StartInfo.FileName = “C:\\foo.txt”; proc.Start(); proc.WaitForExit(10000); proc.CloseMainWindow(); proc.Close(); But, how can I specify what printer settings I want to use with this method? I can't see a way to tell the application, "Hey, I want to use duplex printing and only print the first page of this document." Is there any way to provide your own printer settings before the document is sent to the print spooler? Perhaps yank the documents off the print queue before they start and re-send them with my custom settings? I don't know how viable that would be, though. Another problem is I want this to work with multiple file types (such as .doc and .xls). I know that COM is an option, but I'd be out of luck with proprietary formats such as pdf etc. With all that said, I'd appreciate any help or suggestions. =)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!