• What Do You Need Help With? V6
    7,544 replies, posted
Ok cool But for this: [code] for (int i = 0; i <= 9; i++) { mass[i]; radii[i]; double[] gravities = calcGravity(radii, mass); i++ }[/code] it says that mass[i] and radii[i] are not statements. what am i doing wrong?
[QUOTE=joshuadim;46263822]Ok cool But for this: [code] for (int i = 0; i <= 9; i++) { mass[i]; radii[i]; double[] gravities = calcGravity(radii, mass); i++ }[/code] it says that mass[i] and radii[i] are not statements. what am i doing wrong?[/QUOTE] First off, you do not need to increment i manually at the end of the loop - you are already doing that in the loop's conditional statement. Secondly, you are not doing anything with the arrays. My guess is that you're wanting to access the doubles inside them, which would mean you'd simply pass them to the calcGravity method directly. [code] for (int i = 0; i < 9; i++) { double[] gravities = calcGravity(radii[i], mass[i]); } [/code]
Hey do any of you guys know LUA? Specifically, lua that wow uses for addons? I need something specific and I'm terrible at code.
[code] import random dimensionsX = int(input("Input X")) dimensionsY = int(input("Input Y")) class Node(): neighbour = {0:None, 1:None, 2:None, 3:None} visited = False coordinate = (-1,-1) """ Right = 0 Down = 1 Left = 2 Top = 3 """ NodeArray = {} #generating table for x in range(0,dimensionsX): for y in range(0, dimensionsY): NodeArray[(x,y)] = Node() NodeArray[(x,y)].coordinate = (x,y) #connecting neighbours here for x in range(0,dimensionsX): for y in range(0, dimensionsY): #original node (x,y) n = NodeArray[(x,y)] right = (x+1,y) if right in NodeArray: n.neighbour[0] = NodeArray[(x,y)]#NodeArray[right] down = (x, y+1) if down in NodeArray: n.neighbour[1] = NodeArray[(x,y)]#NodeArray[down] left = (x-1, y) if left in NodeArray: n.neighbour[2] = NodeArray[(x,y)]#NodeArray[left] up = (x, y-1) if up in NodeArray: n.neighbour[3] = NodeArray[(x,y)]#NodeArray[up] for x in range(0, dimensionsX): for y in range(0, dimensionsY): node = NodeArray[(x,y)] print("NIndex:", (x,y)) print("NCoord:", node.coordinate) for k, v in node.neighbour.items(): if node.neighbour[k] is not None: print("Key:", k) print("Val:", v.coordinate) [/code] Hello, I have a problem with python! I want to construct 2D array of Nodes (class). This Node class has 4 neighbors. Problem is, that this code is wrong somewhere, because EVERY node has same neighbors (end of 2D array).. anyone has any idea?
You've created the neighbour dict as a class variable. To make it an instance variable define it in the __init__(self) method of the class.
[QUOTE=LilDood;46268462]You've created the neighbour dict as a class variable. To make it an instance variable define it in the __init__(self) method of the class.[/QUOTE] Fuck, this makes the sense! But how come coordinate works ok? Because they are assigned each time while as dict isn't? [editline]18th October 2014[/editline] Ok it works now.. weird stuff indeed.
[QUOTE=Fourier;46268547]Fuck, this makes the sense! But how come coordinate works ok? Because they are assigned each time while as dict isn't? [editline]18th October 2014[/editline] Ok it works now.. weird stuff indeed.[/QUOTE] It's to do with how Python handles the scope of variables within a class or instance, I'm not particularly well read on the subject but there's a detailed [URL="http://blog.lerner.co.il/python-attributes/"]article[/URL] about it that was on /r/python the other day on reddit but the gist of it is: When accessing the neighbour dict, the instance doesn't have neighbour so it looks in the class where it finds one. With coordinate you're setting coordinate with Node.coordinate = (x,y) so it just gets set on the instance straight off and it doesn't look to see if you're trying to change something higher up the scope hierarchy.
[QUOTE==(E)=AndromK;46242726](Copied and pasted from my main thread, due to it not recieving much attention.) ------ Rebuild All started: Project: Helloworld, Configuration: Debug Win32 ------ c:\documents and settings\compaq_administrator.michael\my documents\visual studio 2010\Projects\Helloworld\Helloworld\Helloworld.vcx proj : error MSB4014: The build stopped unexpectedly because of an internal failure. c:\documents and settings\compaq_administrator.michael\my documents\visual studio 2010\Projects\Helloworld\Helloworld\Helloworld.vcx proj : error MSB4014: Microsoft.Build.Exceptions.BuildAbortedException: Build was canceled. MSBuild.exe could not be launched as a child node as it could not be found at the location "c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSB uild.exe". If necessary, specify the correct location in the BuildParameters, or with the MSBUILD_EXE_PATH environment variable. c:\documents and settings\compaq_administrator.michael\my documents\visual studio 2010\Projects\Helloworld\Helloworld\Helloworld.vcx proj : error MSB4014: at Microsoft.Build.BackEnd.NodeManager.AttemptCreateN ode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration) c:\documents and settings\compaq_administrator.michael\my documents\visual studio 2010\Projects\Helloworld\Helloworld\Helloworld.vcx proj : error MSB4014: at Microsoft.Build.BackEnd.NodeManager.CreateNode(Nod eConfiguration configuration, NodeAffinity nodeAffinity) c:\documents and settings\compaq_administrator.michael\my documents\visual studio 2010\Projects\Helloworld\Helloworld\Helloworld.vcx proj : error MSB4014: at Microsoft.Build.Execution.BuildManager.PerformSche dulingActions(IEnumerable`1 responses) c:\documents and settings\compaq_administrator.michael\my documents\visual studio 2010\Projects\Helloworld\Helloworld\Helloworld.vcx proj : error MSB4014: at Microsoft.Build.Execution.BuildManager.HandleNewRe quest(Int32 node, BuildRequestBlocker blocker) c:\documents and settings\compaq_administrator.michael\my documents\visual studio 2010\Projects\Helloworld\Helloworld\Helloworld.vcx proj : error MSB4014: at Microsoft.Build.Execution.BuildManager.IssueReques tToScheduler(BuildSubmission submission, Boolean allowMainThreadBuild, BuildRequestBlocker blocker) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== Essentially, I can't do anything in Microsoft Visual C++. My username is less than 16 chars, .net framework 4.0 is working fine. Help![/QUOTE] Does anyone intend to help fix this problem ever?
[QUOTE==(E)=AndromK;46269782]Does anyone intend to help fix this problem ever?[/QUOTE] reinstall visual studio
How do I stop chrome from stopping javascript in the console when changing pages? Like, I enter code into the console, which is meant to loop, but when it loads a page, it stops the code completely.
You can't. Changing pages clears the JavaScript VM's state. [editline]18th October 2014[/editline] Why do you need to preserve your running script when changing pages?
I'm writing a find method for a linked list. [code] public int find(int x) { if(isEmpty()) return null; Node tmp = head; while(tmp != null) { if(x == tmp.head) return tmp.data; tmp = tmp.next; } return null; } [/code] Do I need to test if it's empty or is that redundant?
[QUOTE=DrTaxi;46271932]You can't. Changing pages clears the JavaScript VM's state. [editline]18th October 2014[/editline] Why do you need to preserve your running script when changing pages?[/QUOTE] I had thousands of items subscribed on steam workshop accidently and needed a way to get rid of them all, I ended up using my script that I made to unsub to all currently on the page, then to load the next page. I then downloaded an auto key presser to press up arrow then enter, works great, it was slow, took over an hour because of the amount of addons I had, but I had everything timed perfectly.
I've been learning how to use Xcode in the hopes of cashing in on the App Store. Then I thought to myself, why not just outsource the project to a freelance developer, monetise the application and then update it through the original developer with the funding from the monetisation? As long as you have an idea a freelancer can make it reality for a small sum of money. Money which can be raked back.
There are a lot of terrible freelancers in the cheaper segment though. You get what you pay for.
When you say cheaper how much are we talking? I'd probably pay around $500 and only pay once I'd seen a prototype.
[url]http://360noscope.com/webm/space.webm[/url] (Edit for some reason the video got enlarged) click that link instead to watch it. To test my networking library I wanted to use it to make a game. There is no client-side prediction, as I want the networking to work fast before I make it look artificially smoother. The ship is the client's view of their ship and the red ship is what other players would see. How can I get this to be faster? I am using Love2d and [URL="http://leafo.net/lua-enet/"]lua-enet[/URL] (with the unreliable setting).
So I'm working on a C++ program for a class and I'm kind of stuck. Right now the program is divided into Sortedlist.h and Sortedlist.cpp. The issue is in Sortedlist.cpp when I try to initialize head or tail. It's probably something small that I'm overlooking but I'm really stuck. I know my Linked List implementation isn't finished, I'd just like to be able run the program without it crashing to a stackdump. Part of Sortedlist.h [code]private: int numBooks; // Since Listnodes will only be used within the SortedList class, // we make it private. struct Listnode { Book* book; Listnode* next; }; Listnode* head; // pointer to the first node in the list Listnode* tail; // pointer to the last node in the list };[/code] Part of Sortedlist.cpp [code] //Constructor SortedList::SortedList(){ head = new Listnode(); numBooks = 0; } bool SortedList::addBook(Book *b){ //There are no books in the list if(numBooks == 0){ Listnode* toAdd = new Listnode(); toAdd->book = b; toAdd->next = NULL; head->next = toAdd; //This is where the access violation is happening tail->next = toAdd; //Here too numBooks++; return true; } }[/code]
Hey! I'm considering making a game about social networks. The game itself will be based around dialogue and adding/removing friends. I'm considering Love2D, but what other game engines may work for simply emulating facebook's user interface, or skype?
i think love would be your best bet, sfml would also work
[QUOTE=trotskygrad;46282437]Hey! I'm considering making a game about social networks. The game itself will be based around dialogue and adding/removing friends. I'm considering Love2D, but what other game engines may work for simply emulating facebook's user interface, or skype?[/QUOTE] Something like this? [url]http://www.redshirtgame.com/[/url]
[QUOTE=JakeAM;46276624]I've been learning how to use Xcode in the hopes of cashing in on the App Store. Then I thought to myself, why not just outsource the project to a freelance developer, monetise the application and then update it through the original developer with the funding from the monetisation? As long as you have an idea a freelancer can make it reality for a small sum of money. Money which can be raked back.[/QUOTE] 1. It's scumbag move in my opinion. 2. You can except not to get stuff the way you wanted, and you will have to hire another freelancer. 3. Your idea might be stolen, but that is not likely to happen I think. But if you do get idea working, then why the heck not? But just except to throw lots of money first.
Thanks for the feedback. I've had a lot of interest on Odesk, I just hope to make the money back with ads.
Can someone help me with framebuffers? :c I created one and am able to flush it with a green color, but when rendering a batch to it it stays green. Draw stuff: [url]http://pastebin.com/zD9BXj6m[/url] (geomPass then lightPass are called in the draw loop) GBuffer: [url]http://pastebin.com/12fvez0A[/url] - Back face culling and depth test are disabled - I can render the batch to the standard view, just have to change outDiffuse to vec4 [editline]20th October 2014[/editline] Got it, I was rendering vec3 to a RGB32 (space for 4?) buffer. Fuck me :suicide: My evil tutorial tricked me. Wait that should work, what the hell
not much of a question, but does anyone have any tips on converting winforms apps to gtk# ones?
[QUOTE=RedBlade2021;46281120]So I'm working on a C++ program for a class and I'm kind of stuck. Right now the program is divided into Sortedlist.h and Sortedlist.cpp. The issue is in Sortedlist.cpp when I try to initialize head or tail. It's probably something small that I'm overlooking but I'm really stuck. I know my Linked List implementation isn't finished, I'd just like to be able run the program without it crashing to a stackdump. Part of Sortedlist.h [code]private: int numBooks; // Since Listnodes will only be used within the SortedList class, // we make it private. struct Listnode { Book* book; Listnode* next; }; Listnode* head; // pointer to the first node in the list Listnode* tail; // pointer to the last node in the list };[/code] Part of Sortedlist.cpp [code] //Constructor SortedList::SortedList(){ head = new Listnode(); numBooks = 0; } bool SortedList::addBook(Book *b){ //There are no books in the list if(numBooks == 0){ Listnode* toAdd = new Listnode(); toAdd->book = b; toAdd->next = NULL; head->next = toAdd; //This is where the access violation is happening tail->next = toAdd; //Here too numBooks++; return true; } }[/code][/QUOTE] "head->next = toAdd;" should actually work, but "tail->next = toAdd;" will cause an error, because tail does not point anywhere.
I'm taking prog this year (C++) and I'm utterly hopeless at it. I'm creating a program that has the user enter 5 numbers and then depending on what option they pick, do something with those numbers (sum, average, convert to binary, etc... relatively easy stuff) but one of the functions we have to make has me utterly stumped. Any idea on how I can sort the array smallest to largest? EDIT; We got it! Dissected a bubble sort and did that
[URL="http://en.cppreference.com/w/cpp/algorithm"]http://en.cppreference.com/w/cpp/algorithm[/URL]
How easy/hard would it be to crack this open? pL = password letter (process goes through each letter) 10 = Current month. 6 = Day of registration of user (Saturday for example) 2 = todays day (Tuesday) uI = user initials (two specific letters taken out of users username) pL = CurrentPos in Dictionary + ((10 - 6) * 2); ApL = all letters combined. PHP Crypt(ApL, uI); Would this make it easy to crack? I mean every day the password enc/dec will be slightly different and every month it will be changed a bit. Any way I can improve it? This is first time I am trying to make somewhat random encryption way.
[QUOTE=KinderBueno;46294253]How easy/hard would it be to crack this open? [/QUOTE] PHP's crypt() makes a hash, it's not encryption because it can't be reversed. I'm not sure what exactly you're trying to do here but it seems you're way overcomplicating. Just hash the entire password at once and use a salt
Sorry, you need to Log In to post a reply to this thread.