• What do you need help with? Version 5
    5,752 replies, posted
[IMG]http://puu.sh/1f6BX[/IMG] Trying to include SFML, it doesn't want to co-operate. Seriously i've tried like over 10 times with a new project and always some kind of an error.
Don't link with the debug library.
[QUOTE=ollie;38045337][IMG]http://puu.sh/1f6BX[/IMG] Trying to include SFML, it doesn't want to co-operate. Seriously i've tried like over 10 times with a new project and always some kind of an error.[/QUOTE] Are the DLL files it asks for put into the exe output folder?
[QUOTE=Fear_Fox;38045397]Are the DLL files it asks for put into the exe output folder?[/QUOTE] That fixed the problem, thank you!
-snipwrongthread-
Is there a function to map a value? More precisely, what would that function look like so that, f(100) = 170 f(50) = 0 f(0) = -170 I haven't done math in about 4 years and I'm thinking that percentages are involved?
float funTion(int x) { return x*17/5 -170; } You might have to cast x to a float. Not sure.
(x - 50) * 3.4 is a neater way of describing it, but I think he's more asking for a way of assigning specific values to specific arguments, a-la an [url=http://en.wikipedia.org/wiki/Associative_array]Associative Array[/url].
So how young is too young to apply for a programming related internship? I have a feeling 16 is way too young.
StackInt.java [CODE]public interface StackInt<T> { public void push(T x); }[/CODE] BoundedStack.java [CODE] public interface BoundedStack<T> extends StackInt { public void push(T x); } [/CODE] LinkedListStack.java [CODE] public class LinkedListStack<T> implements BoundedStack { public void push(T x){ //if (isFull()) throw new FullStackException(); } } [/CODE] [QUOTE]javac LinkedListStack.java LinkedListStack.java:10: LinkedListStack is not abstract and does not override a bstract method push(java.lang.Object) in BoundedStack public class LinkedListStack<T> implements BoundedStack { ^ 1 error [/QUOTE] Why is java bitching that LinkedListStack doesnt implement "push" in BoundedStack? Wish I was allowed using C++ for my assignments EDIT: found the problem Needs to be [CODE]public interface BoundedStack<T> extends StackInt<T> { [/CODE]
Ok i am starting to understand assembly a lot more. [code]xor ebx, ebx ; Set default exit code[/code] Why do this
[QUOTE=twoski;38055379]Ok i am starting to understand assembly a lot more. [code]xor ebx, ebx ; Set default exit code[/code] What does this do exactly? Exclusive or with the same value is always going to be false... If i set bx to 1 or 0 does it alter the exit code?[/QUOTE] because its opcode is shorter than [code] mov ebx, 0; [/code] [editline]16th October 2012[/editline] and also exit code yeah
[QUOTE=jaooe;38048004]Is there a function to map a value? More precisely, what would that function look like so that, f(100) = 170 f(50) = 0 f(0) = -170 I haven't done math in about 4 years and I'm thinking that percentages are involved?[/QUOTE] If you don't mean what Lexic said and you mean fitting a function to those points: [url]http://mathworld.wolfram.com/LagrangeInterpolatingPolynomial.html[/url] [url]http://en.wikipedia.org/wiki/Lagrange_polynomial[/url] With your example: x1 = 100, y1 = 170 x2 = 50, y2 = 0 x3 = 0, y3 = -170 P(x) = y1*[(x - x2)*(x - x3)/(x1 - x2)*(x1 - x3)] + y2*[(x - x1)*(x - x3)/(x2 - x1)*(x2 - x3)] + y3*[(x - x1)*(x - x2)/(x3 - x1)*(x3 - x2)] ... and then you'll find the function you're looking for.
Im trying to create a vector system for my Lua and XNA crossover. First wall i have ran into is how can i create the "vector" library (is it a library?). As in "color = vector.new(1, 2, 3)" and the "MyVector:Add(OtherVector)" things. I have no idea how.
What you're referring to as libraries are to lua just tables with function members. If you know how to bind functions to lua you can simply do the first part by pushing your funcs into the global table vector. The second part, the actual vector "class", involves userdata and I'm not all that familiar with userdata.
How can i actually include the functions inside the tables? Do i have to do this in Lua or in C#?
Nevermind, got it working :D [editline]16th October 2012[/editline] My automerge :(
Are there any good resources on understanding how to go about unpacking an archive using a proprietary file format? (e.g. game content archives) Been looking around forever but cant seem to find a thing on it.
[QUOTE=Cushie;38065856]Are there any good resources on understanding how to go about unpacking an archive using a proprietary file format? (e.g. game content archives) Been looking around forever but cant seem to find a thing on it.[/QUOTE] open one of the container files up in a hex editor and see if any of the data in the first section of the file could possibly be an offset to a file or a file length or something like that. Most proprietary formats are fairly simple and easy to parse, they're not going to make their lives harder by creating a complicated container format...
[QUOTE=robmaister12;38066530]open one of the container files up in a hex editor and see if any of the data in the first section of the file could possibly be an offset to a file or a file length or something like that. Most proprietary formats are fairly simple and easy to parse, they're not going to make their lives harder by creating a complicated container format...[/QUOTE] Thanks. Only thing I can see is that the first three bytes in every file are 'arf' Probably in way over my head here though, I haven't really done much before in terms of packing/unpacking files so its hard to wrap my head around.
[QUOTE=Cushie;38067015]Thanks. Only thing I can see is that the first three bytes in every file are 'arf' Probably in way over my head here though, I haven't really done much before in terms of packing/unpacking files so its hard to wrap my head around.[/QUOTE] Look at the next few values, see if there are any numbers that could be potentially useful information for a container format - total file size/checksum are going to be those strangely large numbers you see around the smaller values. There are a small number of ways that archive formats typically work. The first way is to define a file's size and offset at the beginning then pack all the data together after that. <offset><length><offset><length>...<data><data>... The second is to define a file's length with it's data, so that it would look like: <length><data><length><data>... Anything else would be derivative of one of those two. A file format may be like the first one but omit lengths, since all the data is packed and you can calculate length by adding offsets. [editline]a[/editline] Oh and one more thing, most files like this tend to have values aligned to 4 bytes, so you're really looking at the first 4 bytes as 'arf ' or 'arf\0' and everything following that would be where the numbers start.
snip figured it out
[QUOTE=robmaister12;38067468]Look at the next few values, see if there are any numbers that could be potentially useful information for a container format - total file size/checksum are going to be those strangely large numbers you see around the smaller values. There are a small number of ways that archive formats typically work. The first way is to define a file's size and offset at the beginning then pack all the data together after that. <offset><length><offset><length>...<data><data>... The second is to define a file's length with it's data, so that it would look like: <length><data><length><data>... Anything else would be derivative of one of those two. A file format may be like the first one but omit lengths, since all the data is packed and you can calculate length by adding offsets. [editline]a[/editline] Oh and one more thing, most files like this tend to have values aligned to 4 bytes, so you're really looking at the first 4 bytes as 'arf ' or 'arf\0' and everything following that would be where the numbers start.[/QUOTE] Thanks for the help, I have been comparing two of the files and I 'arfdxÚ' at the start was the only thing that they both had in common throughout. The filesystem is not unlike Valve's, one file holds indexes for all of the files stored in the archives. After almost giving up I found an extractor that someone created for a different game using the same engine/file system and to my surprise it worked.
I have an assignment to evaluate a lisp expression using a stack that only stores strings. I could do this easily with recursion, but I'm not really sure how to go about this with just a stack/iterative procedure. Any tips would be awesome. [QUOTE]In the language Lisp, each of the four basic arithmetic operators appears before an arbitrary number of operands, which are separated by spaces. The resulting expression is enclosed in parentheses. The operators behave as follows:  (+ a b c ...) returns the sum of all the operands, and (+) returns 0. (- a b c ...) returns a - b - c - ..., and (- a) returns -a. The operator ‘-’ must have at least one operand. (* a b c ...) returns the product of all the operands, and (*) returns 1. (/ a b c ...) returns a / b / c / ... and (/ a)returns 1/a. The operator‘/’ must have at least one operand. You can form larger arithmetic expressions by combining these basic expressions using a fully parenthesized pre&#64257;x notation. For example, the following is a valid Lisp expression: (+ (-6) (* 2 3 4) (/ (+3) (*) (- 2 3 1))) [/QUOTE]
-wrong thread-
How do I delay some text in Python (2.5.2)? I know I use... [CODE] # start of function print "Calculating..." import time time.sleep(seconds) print "other stuff" # some print result statements after [/CODE] but when I use it in a function, it doesn't print anything that is before that, it just delays the whole function. I want it to print something first, which is "Calculating...", then it will give a delay, then print out the results. What's wrong here and how do I fix this?
[QUOTE=Electroholic;38069516]I have an assignment to evaluate a lisp expression using a stack that only stores strings. I could do this easily with recursion, but I'm not really sure how to go about this with just a stack/iterative procedure. Any tips would be awesome.[/QUOTE] That's prefix notation or polish notation. You can evaluate an expression if the operator is immediately followed by its arguments. So I suppose every time you run into an operator in the string, you could look ahead for the following patterns: "n", "(+n)", "(-n)", and if there are enough of them, evaluate them. You can also evaluate (+x) to x, but (-x) can't be evaluated on its own, if you aren't allowed to parse the strings into more meaningful syntax trees.
Yeah it's pretty hard to do without trees and shit. But I think I finally finished it. Not sure if I fully understood your explanation, but reading made something click in my mind which helped me develop my algorithm. :v: Correctly evaluates "(/ (* (*) 6) 3)" to 2 Now time to test the shit out of it, and also explain how the algorithm works for another part of my assignment.
In Luainterface, how can i restrict the use of a registered function to only a single Lua file?
[QUOTE=Funley;38073264]In Luainterface, how can i restrict the use of a registered function to only a single Lua file?[/QUOTE] Could you not just register the function then run the file then unregister the function?
Sorry, you need to Log In to post a reply to this thread.