Search Results

Search found 9016 results on 361 pages for 'regex libraries'.

Page 2/361 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Well-tested libraries for player ratings?

    - by Lucky
    It's common in games to implement some sort of numerical ranking system -- the ELO system is usually used in chess. I could implement this system naively using Wikipedia's descriptions, but I suspect that this would open up a whole box of problems that have already been solved: rating inflation, etc -- for instance, the ELO system has a K constant that's 'fudged' according to rating, duration, pairings, statistics, ... What are some libraries (I'm looking at Python, but anything is okay) that implements rating systems? It also doesn't have to be ELO.

    Read the article

  • Libraries for game developement in c++? [on hold]

    - by LPeter1997
    It's time for me to start developing games in c++ (I have experience in game developement with xna and java). What libraries do you recommend? I tried Allegro, but the installation is pretty headcrushing already. Could you share me your experiences with the library(ies) you use? (maybe even advantages and disadvantages) By the way it's a good point if it can be easily connected to CodeBlocks or Dev-C++. Thanks for the answers!

    Read the article

  • If a library doesn't provide all my needs, how should I proceed?

    - by 9a3eedi
    I'm developing an application involving math and physics models, and I'd like to use a Math library for things like Matrices. I'm using C#, and so I was looking for some libraries and found Math.NET. I'm under the impression, from past experience, that for math, using a robust and industry-approved third party library is much better than writing your own code. It seems good for many purposes, but it does not provide support for Quaternions, which I need to use as a type. Also, I need some functions in Vector and Matrix that also aren't provided, such as rotation matrices and vector rotation functions, and calculating cross products. At the same time, it provides a lot of functions/classes that I simply do not need, which might mean a lot of unnecessary bloat and complexity. At this rate, should I even bother using the library? Should I write my own math library? Or is it a better idea to stick to the third party library and somehow wrap around it? Perhaps I should make a subclass of the Matrix and Vector type of the library? But isn't that considered bad style? I've also tried looking for other libraries but unfortunately I couldn't find anything suitable.

    Read the article

  • Haskell: 'No instance for' arising from a trivial usage of Regex library

    - by artemave
    Following the (accepted) answer from this question, I am expecting the following to work: Prelude Text.Regex.Posix Text.Regex.Base.RegexLike Text.Regex.Posix.String> makeRegex ".*" (makeRegex is a shortcut for makeRegexOpts with predefined options) However, it doesn't: <interactive>:1:0: No instance for (RegexMaker regex compOpt execOpt [Char]) arising from a use of `makeRegex' at <interactive>:1:0-13 Possible fix: add an instance declaration for (RegexMaker regex compOpt execOpt [Char]) In the expression: makeRegex ".*" In the definition of `it': it = makeRegex ".*" Prelude Text.Regex.Posix Text.Regex.Base.RegexLike Text.Regex.Posix.String> make Regex ".*"::Regex <interactive>:1:0: No instance for (RegexMaker Regex compOpt execOpt [Char]) arising from a use of `makeRegex' at <interactive>:1:0-13 Possible fix: add an instance declaration for (RegexMaker Regex compOpt execOpt [Char]) In the expression: makeRegex ".*" :: Regex In the definition of `it': it = makeRegex ".*" :: Regex And I really don't understand why. EDIT Haskell Platform 2009.02.02 (GHC 6.10.4) on Windows EDIT2 Prelude Text.Regex.Base.RegexLike Text.Regex.Posix.String> :i RegexMaker class (RegexOptions regex compOpt execOpt) => RegexMaker regex compOpt execOpt source | regex -> compOpt execOpt, compOpt -> regex execOpt, execOpt -> regex compOpt where makeRegex :: source -> regex makeRegexOpts :: compOpt -> execOpt -> source -> regex makeRegexM :: (Monad m) => source -> m regex makeRegexOptsM :: (Monad m) => compOpt -> execOpt -> source -> m regex -- Defined in Text.Regex.Base.RegexLike

    Read the article

  • OWASP Regex Repository: Is this regex correct?

    - by Jacco
    I was looking at the regular expression for validating various data types from the (OWASP Regex Repository). One of the regular expressions in there is called safetext and looks like: ^[a-zA-Z0-9\s.\-]+$ My first question is: Is this regular expression correct? complementary question If this Regex Repository any good at all?

    Read the article

  • regex return conditional group

    - by priyank.mp
    Hi , I spent lot time figuring out a simple regex to return a group (only 1st group). So the string can be - "No purchase required" or "Purchase of $50.00 worth groceries is required." I am trying to write a regex which can parse "No" or "50" based on the given string. This is what I have written. (?:(No) monthly maintenance|Purchase of \$([\d\.]+ worth groceries) This works fine but I want my output as 1st group/group 1 only.

    Read the article

  • Should programmers prefer making wide libraries or thin libraries?

    - by Telastyn
    For classes and functions, it is clear cut: each should do only one thing. For libraries though, this is less clear. If you have a library with collections, it might have multiple collections. It might have useful functions like sorting, which aren't strictly collection based but users would expect. Each of these results in a 'wider' library. On the other side is having a library for the specific collection type and/or with little built-in functionality. If you want a queue, it gives you a queue. If you want to sort that list, then the library lets you do that yourself. What is the best practice here (if any)? I can see arguments for each side.

    Read the article

  • Why do some opensouce libraries lack comments?

    - by entropy
    I don't know if this happens to most Opensource libraries, but many of I know and use (for example OpenSSL, Webkit, ...) they all lack comments, or contain very few comments. Not to mention their very few documents, it is hard to read their source code. We can hardly understand what a member variable means, or what this function does. This seems to be against coding standard practice Why is that? How can people collaborate to these opensource with very few comments?

    Read the article

  • Free libraries to work with Excel

    - by Danil Gholtsman
    I got some excel files, I need to read data from it and upload data to some database (I need to use firebird, but whatever). Right now I use <QAxObject> from Qt and code look like QAxObject* excel = new QAxObject("Excel.Application"); //pointer to excel //excel->setProperty("Visible", false); QAxObject* workbooks = excel->querySubObject("WorkBooks"); //get pointer to booklist workbooks->dynamicCall("Open (const QString&)", QString("C:\\databases\\test.xls")); //opening file, getting pointer to booklist QAxObject* workbook = excel->querySubObject("ActiveWorkBook"); QAxObject* worksheets = workbook->querySubObject("WorkSheets"); etc. The problem is that this way on users PC there must be installed Excel. Is there exists some free C++ libraries to work with *.xls, *.xlsx files without Excel installed?

    Read the article

  • Libraries for eclipse with CCSv5 from Texas Instruments

    - by Alex
    My system is Ubuntu 11.10 64bit and i have to run a 32bit version of eclipse to use the TI plugins for CCSv5 but it doesn't work. I tried to run eclipse in a 62bit java environment but it doesn't even start. Now I got "java version "1.6.0_30"" from Sun in 32bit and now eclipse starts but can't use the TI plug ins and I get the following errors in bash: /usr/lib/gtk-2.0/2.10.0/menuproxies/libappmenu.so: falsche ELF-Klasse: ELFCLASS64 /usr/lib/gio/modules/libgvfsdbus.so: falsche ELF-Klasse: ELFCLASS64 Failed to load module: /usr/lib/gio/modules/libgvfsdbus.so and this in a popup-window when Itry to use the plugin: The selected wizard could not be started. Plug-in com.ti.ccstudio.project.ui was unable to load class com.ti.ccstudio.project.ui.internal.wizards.importexport.temp.ExternalProjectImportWizard. An error occurred while automatically activating bundle com.ti.ccstudio.project.ui (352). T tested the libraries with file: /usr/lib/gio/modules/libgvfsdbus.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped /usr/lib/gtk-2.0/2.10.0/menuproxies/libappmenu.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped The ia32-libs are installed.

    Read the article

  • Find multiple regex in each line and skip result if one of the regex doesn't match

    - by williamx
    I have a list of variables: variables = ['VariableA', 'VariableB','VariableC'] which I'm going to search for, line by line ifile = open("temp.txt",'r') d = {} match = zeros(len(variables)) for line in ifile: emptyCells=0 for i in range(len(variables)): regex = r'('+variables[i]+r')[:|=|\(](-?\d+(?:\.\d+)?)(?:\))?' pattern_variable = re.compile(regex) match[i] = re.findall(pattern_variable, line) if match[j] == []: emptyCells = emptyCells+1 if emptyCells == 0: for k, v in match[j]: d.setdefault(k, []).append(v) The requirement is that I will only keep the lines where all the regex'es matches! I want to collect all results for each variable in a dictionary where the variable name is the key, and the value becomes a list of all matches. The code provided is only what I've found out so far, and is not working perfectly yet...

    Read the article

  • Vim Regex to replace tags

    - by Rudiger Wolf
    I am lookin for a regex express to remove the email addresses from a text file. Input file: Hannah Churchman <[email protected]>; Julie Drew <[email protected]>; Output file: Hannah Churchman; Julie Drew; I thought a generic regex shuch as s/<(.*?)//g would be a good starting point but I am unable to find the right expression for use Vim? something like :%s/ <\(.*?\)>//g does not work. Error is "E486: Pattern not found:". :%s#[^ <]*>##g almost works but it leaves the space and < behind. :%s# <##g to remove the " <" remaining stuff. Any tips on how to better craft this command?

    Read the article

  • Can I use DllImport/PInvoke in libraries loaded as Assets in Unity Free?

    - by sebf
    I am interested in using utilising third-party libraries in Unity Free. I know Unity can use managed libraries as Assets, but only the Pro version supports using native libraries. (DllImport within scripts). This thread however suggests that it is possible to import DLLs in the free version. I would like to utilise native libraries (as a hobbyist I cannot afford Pro), but want to do it the supported way so I don't have to worry about Unity 'fixing' this hole if that is what it is. Is there any supported way to use native libraries with Unity free? (i.e. does that thread suggest a workaround or is it a 'bug'? Is it supported to use DllImport/PInvoke in libraries loaded as assets? (could I create a wrapper myself?)

    Read the article

  • Complex(?) regex: Is expression, but not another

    - by Kieron
    (If you can make a better title, please do) Hi, I need to make sure a string matches the following regex: ^[0-9a-zA-Z]{1}[0-9a-zA-Z\.\-_]*$ (Starts with a letter or number, then any number of letters, numbers, dots, dashes or underscores) But given that, I need to make sure it doesn't match a Guid, my Guid matching reg-ex looks like this (obviously, this needs to be negated in the merged result): ^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$ The last requirement here is that they must (if it's possible) be merged into a single expression.

    Read the article

  • A pattern matching an expression that doesn't end with specific sequence

    - by patryk
    I need a regex pattern which matches such strings that DO NOT end with such a sequence: \.[A-z0-9]{2,} by which I mean the examined string must not have at its end a sequence of a dot and then two or more alphanumeric characters. For example, a string /home/patryk/www and also /home/patryk/www/ should match desired pattern and /home/patryk/images/DSC002.jpg should not. I suppose this has something to do with lookarounds (look aheads) but still I have no idea how to make it. Any help appreciated.

    Read the article

  • How to make custom libraries accessible?

    - by Milen Bilyanov
    I am trying to compile and install every custom module under it's own designated folder. (ex: /myApps/myLinux/compiled_app) I had luck with python so far, where my python is compiled from source and lives in: /myApps/myLinux/python2.5 and "python2.5" - /myApps/myLinux/python2.5.6-gcc463 so I can access this python through a wrapper script that sets the right environment. The question is recently I had to compile and add something called gperf3.0.4. So now it lives: /myApps/myLinux/gperf3.0 and "gperf3.0" - /myApps/myLinux/gperf3.0.4-gcc463 The question is: How will I point to this lib if some other app needs to access it? Is it done through the LD_LIBRARY_PATH variable? Thanks.

    Read the article

  • c++ most used libraries [on hold]

    - by Basaa
    I'm trying to find out whether or not I want to switch from Java to c++ for my OpenGL game programming. I now have setup a test project in VS 11 professional, with GLUT. I created my windows with GLUT, and I can render OpenGL primitives without any problems. Now my question: What library(s) is/are used mostly in the indie/semi professional industry for using OpenGL in c++? With 'using OpenGL' I mean: Creating and managing an OpenGL window Actually using the OpenGL API Handling user-input (keyboard/mouse)

    Read the article

  • JS regex isn't matching, even thought it works with a regex tester

    - by Tom O
    I'm writing a piece of client-side javascript code that takes a function and finds the derivative of it, however, the regex that's supposed to match with the power rule fails to work in the context of the javascript program, even though it sucessfully matches when it's used with an independent regex tester. The browser I'm executing this on is Midori, and the operating system is Ubuntu 10.04 (Lucid Lynx). Here's the HTML page being used as the interface in addition to the code: Page: <html> <head> <title> Derivative Calculator </title> <script type="text/javascript" src="derivative.js"> </script> <body> <form action="" name=form> <input type=text name=f /> with respects to <input type=text name=vr size=7 /> <input type=button value="Derive!" onClick="main(this.form)" /> <br /> <input type=text name=result value="" /> </form> </body> </html> derivative.js: function main(form) { form.result.value = derive(form.f.value, form.vr.value); } function derive(f, v) { var atom = []; atom["sin(" + v + ")"] = "cos(" + v + ")"; atom["cos(" + v + ")"] = "-sin(" + v + ")"; atom["tan(" + v + ")"] = "sec^(2)(" + v + ")"; atom["sec(" + v + ")"] = "sec(" + v + ")*tan(" + v + ")"; atom["1/(cos(" + v + "))"] = "sec(" + v + ")*tan(" + v + ")"; atom["csc(" + v + ")"] = "-csc(" + v + ")*cot(" + v + ")"; atom["1/(sin(" + v + "))"] = "-csc(" + v + ")*cot(" + v + ")"; atom["cot(" + v + ")"] = "-csc^(2)(" + v + ")"; atom["1/(tan(" + v + "))"] = "-csc^(2)(" + v + ")"; atom["sin^(-1)(" + v + ")"] = "1/sqrt(1 - " + v + "^(2))"; atom["arcsin(" + v + ")"] = "1/sqrt(1 - " + v + "^(2))"; atom["cos^(-1)(" + v + ")"] = "-1/sqrt(1 - " + v + "^(2))"; atom["arccos(" + v + ")"] = "-1/sqrt(1 - " + v + "^(2))"; atom["tan^(-1)(" + v + ")"] = "1/(1 + " + v + "^(2))"; atom["arctan(" + v + ")"] = "1/(1 + " + v + "^(2))"; atom["sec^(-1)(" + v + ")"] = "1/(|" + v + "|*sqrt(" + v + "^(2) - 1))"; atom["arcsec(" + v + ")"] = "1/(|" + v + "|*sqrt(" + v + "^(2) - 1))"; atom["csc^(-1)(" + v + ")"] = "-1/(|" + v + "|*sqrt(" + v + "^(2) - 1))"; atom["arccsc(" + v + ")"] = "-1/(|" + v + "|*sqrt(" + v + "^(2) - 1))"; atom["cot^(-1)(" + v + ")"] = "-1/(1 + " + v + "^(2))"; atom["arccot(" + v + ")"] = "-1/(1 + " + v + "^(2))"; atom["ln(" + v + ")"] = "1/(" + v + ")"; atom["e^(" + v + ")"] = "e^(" + v + ")"; atom["ln(|" + v + "|)"] = "1/(" + v + ")"; atom[v] = "1"; var match = ""; if (new Boolean(atom[f]) == true) { return atom[f]; } else if (f.match(/^[0-9]+$/)) { return ""; } else if (f.match(/([\S]+)([\s]+)\+([\s]+)([\S]+)/)) { match = /([\S]+)([\s]+)\+([\s]+)([\S]+)/.exec(f); return derive(match[1], v) + " + " + derive(match[4], v); } else if (f.match(new RegExp("^([0-9]+)(" + v + ")$"))) { match = new RegExp("^([0-9]+)(" + v + ")$").exec(f); return match[1]; } else if (f.match(new RegExp("^([0-9]+)(" + v + ")\^([0-9]+)$"))) { match = new RegExp("^([0-9]+)(" + v + ")\^([0-9]+)$").exec(f); return String((match[1] * (match[3] - 1))) + v + "^" + String(match[3] - 1); } else { return "?"; } }

    Read the article

  • C# regex. Optional match after string

    - by Oskar Kjellin
    I have an input like this test1.test2.part01 which I want to strip away to test1.test2. The only thing i know is that it will end with partxx and probably a dot before the partxx. However, it will not always be a apart. Another example of input might be testas1.tlp2.asd3.part10 which ofcourse should be stripped to testas1.tlp2.asd3. I've made all that, no problem. The problem is the dot at the end before partxx. My regex at the moment is: (.*).?part\d{1,2} But it will include the dot in the group. I do not want the dot to be in the group. The below works as I want it, given that the dot exists, but it will not always be there. (.*).part\d{1,2} How can I exclude the optional dot from the group?

    Read the article

  • How can I use Boost::regex.hpp library in C++?

    - by MIH1406
    I tried to use Boost library but I failed, see my code: #include "listy.h" #include <boost/regex.hpp> using namespace boost; ListyCheck::ListyCheck() { } ListyCheck::~ListyCheck() { } bool ListyCheck::isValidItem(std::string &__item) { regex e("(\\d{4}[- ]){3}\\d{4}"); return regex_match(__item, e); } When I tried to compile it I get those messages: /usr/include/boost/regex/v4/regex_match.hpp:50: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator , std::allocator, std::allocator , boost::regex_traits ::match()' /usr/include/boost/regex/v4/basic_regex.hpp:425: undefined reference to `boost::basic_regex ::do_assign(char const*, char const*, unsigned int)' /usr/include/boost/regex/v4/perl_matcher.hpp:366: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator , std::allocator, std::allocator , boost::regex_traits ::construct_init(boost::basic_regex const&, boost::regex_constants::_match_flags)' etc...

    Read the article

  • C# Regex.IsMatch returns true when it shouldn't?

    - by James Cadd
    I'm attempting to match a string that can contain any number of numeric characters or a decimal point using the following regex: ([0-9.])* Here's some C# code to test the regex: Regex regex = new Regex("([0-9.])*"); if (!regex.IsMatch("a")) throw new Exception("No match."); I expect the exception to be thrown here but it isn't - am I using the Regex incorrectly or is there an error in the pattern? EDIT: I'd also like to match a blank string.

    Read the article

  • What does this regex mean and why

    - by Kalec
    $ sed "s/\(^[a-z,0-9]*\)\(.*\)\( [a-z,0-9]*$\)/\1\2 \1/g" desired_file_name I apreciate it even if you only explain part of it or at lest structure it with words as in s\alphanumerical_at_start\something\alphanumerical_at_end\something_else\global Could someone explain what that means, why and are all regEx so ... awful ? I know that it replaces the first lowcase alphanumerical word with the last one. But could you explain bit by bit what's going on here ? what's with all the /\ and \(.*\)\ and everything else ? I'm just lost. EDIT: Here is what I do get: (^[a-z0-9]*) starting with a trough z and 0 trough 9; and [a-z,0-9]*$ is the same but the last word (however [0-9,a-z] = just first 2 characters / first character, or the entire word ?). Also: what does the * or the \(.*\)\ even mean ?

    Read the article

  • Looking for good Regex book

    - by Cyberherbalist
    I've been trying to get a good grounding with Regular Expressions, and am looking for a single book to do so. I've been going through Amazon.com's listings on this subject, and I've identified a few possibilities, but am unsure which would be best for a C# developer who can write very simple Regexs, but wants to learn more. On a scale of 0-9 where 0 is knowing how to spell "Regex" but nothing else, and 9 where I could write a book on the subject out of my own head, I would place myself at 2. Which of the following would be your choice: Mastering Regular Expressions by Jeffrey E F Friedl Regular Expressions Cookbook by Jan Goyvaerts and Steven Levithan Sams Teach Yourself Regular Expressions in 10 Minutes by Ben Forta Beginning Regular Expressions (Programmer to Programmer) by Andrew Watt Regular Expression Recipes for Windows Developers: A Problem-Solution Approach by Nathan A. Good Regular Expression Recipes: A Problem-Solution Approach by Nathan A. Good Now, according to Amazon, "Regular Expressions Cookbook" (REC) above is rated the highest according to user ratings, but only based on 20 reviews. The first one, "Mastering Regular Expressions" (MRE) is rated second based on 140 reviews. This alone suggests that MRE might be by far the best one. But is it best for a relative beginner? Would I perhaps be better getting "Beginning Regular Expressions" (BRE) instead, to start with? Please help me resolve my confusion!

    Read the article

  • Regex syntax question - trying to understand

    - by Asaf Chertkoff
    i don't know if this question belong here or no, but it is worth a shot. i'm a self taught php programmer and i'm only now starting to grasp the regex stuff. i'm pretty aware of its capabilities when it is done right, but this is something i need to dive in too. so maybe someone can help me, and save me so hours of experiment. i have this string: here is the <a href="http://www.google.com" class="ttt" title="here"><img src="http://www.somewhere.com/1.png" alt="some' /></a> and there is <a href="#not">not</a> a chance... now, i need to perg_match this string and search for the a href tag that has an image in it, and replace it with the same tag with a small difference: after the title attribute inside the tag, i'll want to add a rel="here" attribute. of course, it should ignore links (a href's) that doesn't have img tag inside. help will be appreciated, thanks.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >