• What Do You Need Help With? V6
    7,544 replies, posted
The pickup object power in HL2. Can I set the player strength for lifting stuff (not gravity gun)? I dont have access to sourcecode so it needs to be a setting.
[QUOTE=NixNax123;46591262]That's a feature I wish was implemented in some way for other high level programming languages. I feel so dumb sometimes doing arr[arr.length - 1].[/QUOTE] there'sno UBOUND() in java?
Right, so a little snag in C#. I am using [url=http://msdn.microsoft.com/en-us/library/53ezey2s(v=vs.110).aspx][b]System.Diagnostics.System.Start(String filename)[/b][/url] with a file's full path (EX: "C:/test/my_file.wmv") in C# to run a program, and then wait for it to end, ala [code]Process myProc = System.Diagnostics.System.Start("C:/test/my_file.wmv"); myProc.WaitForExit();[/code] Now, this works fine for when the files open with programs like VLC. But for some reason, when they open with Windows Media Player, the Process returned is null. Does anyone have any idea why, and how I can get around that? Note that I do not want to open with WMP explicitly, but only whatever the system default is - and that may not be WMP (for .wmv), but could be VLC (for .mp4), or Photoshop (for .jpg), or iTunes (for .mp3).
Well, I need help with finding some from-beginner-end-to-intermediate-beginning level tutorials, especially about GUIs and I/Os. I really suck at finding good, interactive tutorials suitable to my level on the net. Maybe because I am new to all these stuff, I can't choose the key words to google optimally. What I mean by good, interactive tutorial is anything but a long wall of encyclopedia text. I mean, even if it included tiniest code examples it would be fine. As long as it suggests some examples for the stuff it teaches.
[QUOTE=Gmod4ever;46605325]Right, so a little snag in C#. I am using [url=http://msdn.microsoft.com/en-us/library/53ezey2s(v=vs.110).aspx][b]System.Diagnostics.System.Start(String filename)[/b][/url] with a file's full path (EX: "C:/test/my_file.wmv") in C# to run a program, and then wait for it to end, ala [code]Process myProc = System.Diagnostics.System.Start("C:/test/my_file.wmv"); myProc.WaitForExit();[/code] Now, this works fine for when the files open with programs like VLC. But for some reason, when they open with Windows Media Player, the Process returned is null. Does anyone have any idea why, and how I can get around that? Note that I do not want to open with WMP explicitly, but only whatever the system default is - and that may not be WMP (for .wmv), but could be VLC (for .mp4), or Photoshop (for .jpg), or iTunes (for .mp3).[/QUOTE] [quote]A new Process component that is associated with the process resource, or null, if no process resource is started (for example, if an existing process is reused).[/quote] Dunno how to get around it but there is your answer.
[b]UPDATE[/b] Resolved my issue. I just put this in my function, and put a breakpoint on the useless operation (x = 5 + 5). [code] if (pageTable[0] != NULL && pageTable[0]->refCounter == 0) { int x = 5 + 5; }[/code] The reason it was changing is because I have a function that halves all references at regular intervals. Kind of forgot about that. :v: For future reference, I would still like to know how to do it properly. For posterity's sake, here is the post. [quote=old] Unrelated to my previous C# problem, I am now playing in C again for an academic project. Long story short, I have a fixed-size array of structs. The array is called [b]pageTable[/b], and the struct has 6 different values in it. For some reason, over the course of my program's execution, a single value in these structs (and [b]only[/b] that one value; and it's not the first nor last in the struct!) is decrementing, when I have no code [b]anywhere[/b] that decrements. I only set it to 0 on initialization and then increment it. I have stepped through filling out the first few elements of this array (it's over 2000 entries long), and everything is being set and incremented correctly. Which is to say this value, [b]refCounter[/b] is being set to 1. I fast-forward to another point, though, and that [b]refCounter[/b] is set to 0! What I am asking is, in Visual Studio 2013 Express, how do I set up an overwatch on the value [b]pageTable[0]->refCounter[/b], that will automatically cause the program to break every time that value changes? Here is a shittily put together image showing what I am dealing with. [t]http://a.pomf.se/gwjqeb.png[/t] I've looked around, and I've seen people say things like "Set Breakpoint" or "Set Watch," but I haven't had any luck with those. These values are obviously changing, but I'm not getting any breaks when the change occurs.[/quote]
[QUOTE=Gmod4ever;46605325]Right, so a little snag in C#. I am using [url=http://msdn.microsoft.com/en-us/library/53ezey2s(v=vs.110).aspx][b]System.Diagnostics.System.Start(String filename)[/b][/url] with a file's full path (EX: "C:/test/my_file.wmv") in C# to run a program, and then wait for it to end, ala [code]Process myProc = System.Diagnostics.System.Start("C:/test/my_file.wmv"); myProc.WaitForExit();[/code] Now, this works fine for when the files open with programs like VLC. But for some reason, when they open with Windows Media Player, the Process returned is null. Does anyone have any idea why, and how I can get around that? Note that I do not want to open with WMP explicitly, but only whatever the system default is - and that may not be WMP (for .wmv), but could be VLC (for .mp4), or Photoshop (for .jpg), or iTunes (for .mp3).[/QUOTE] Well I found a [b]really[/b] shitty solution to this. The general gist is this. [code] // Stuff here try { Process myProc = System.Diagnostics.System.Start("C:/test/my_file.wmv"); myProc.WaitForExit(); } catch (NullReferenceException) { // Maybe its WMP. Process[] wmp = System.Diagnostics.System.GetProcessesByName("wmplayer"); if (wmp.Length > 0) { foreach (Process proc in wmp) { proc.WaitForExit(); } } else { Console.WriteLine("Dunno boss."); } } // More stuff here[/code] This does actually work perfectly fine for my particular use-case, but it is obviously not an elegant solution. If anyone knows any better alternatives, I'm still all ears.
I was told to make SOA based Java application for college project, however I am not sure if I got the meaning right. I've made a Java application using netbeans which uses mysql library to connect to my online mysql database hosted on my server, it's constantly working with my server so java application is basically a client. I am also using Instagram API to get users images and allow to post to instagram from application (client). Am I right to understand this is service based architecture application?
[QUOTE=Tommyx50;46598698]Yes. After performing the euler integration (but before collision detection), you'll want to clear and re-fill the entire grid.[/QUOTE] Alright, this grid thing is way too much trouble than it's worth. Scrapping this.
So I've been super busy with shooting/editing a short film for a final and I won't have time to catch up on my Java work before the semester is over. Would anyone here be willing to do my remaining assignments? It's a beginner class, so if you know Java already it should only take you a short while to complete them. I'm willing to pay. PM me if you're interested.
[QUOTE=Ohfoohy;46614972]So I've been super busy with shooting/editing a short film for a final and I won't have time to catch up on my Java work before the semester is over. Would anyone here be willing to do my remaining assignments? It's a beginner class, so if you know Java already it should only take you a short while to complete them. I'm willing to pay. PM me if you're interested.[/QUOTE] 100% guaranteed that is against your schools code of conduct and will get you thrown out.
[QUOTE=Ohfoohy;46614972]So I've been super busy with shooting/editing a short film for a final and I won't have time to catch up on my Java work before the semester is over. Would anyone here be willing to do my remaining assignments? It's a beginner class, so if you know Java already it should only take you a short while to complete them. I'm willing to pay. PM me if you're interested.[/QUOTE] Are you going to school to learn something or just to pass your time? You're gonna have a hard time later if you just cheat your way trough.
Hi friends! My dad has an excel file, full of data noting the (month/year) of a gas purchase, as well as the Miles Per Gallon for his truck. (there's other data in there such as l/100km, distance, gas purchased, etc.) He wants some kind of graph generated so that the X-axis is for January to December. he then wants each year of readings on a separate line drawn on the graph. Unfortunately, there's incomplete information such that some months are missing (didnt fill up on gas then) or more than one fill a month. I was thinking of using gnuplot in windows (since hes a windows dood) and some kind of batch program so he just runs it and it generates a graph. Is there any way I can make this easier on me? I'm not too familiar with gnuplot and it's going to be torture to try and get the graphs the way he wants them :P
Excel has built-in shit for that.
Can't Excel chart data on its own?
Or you can do it in BASIC. Honestly there are a ton of options for making a graph.
If someone can shed me some light on implicit & explicit conversions it would be nice, here's my setup. I have a "Component" base class, and two classes "SpriteRenderer" & "Transform" that inherits from it because they are components. I have a "GameObject" class that contains a list of components. Because of that, I added my own "AddComponent<T>()" function with the checking to see if the type "T" is indeed a valid Component (type that inherits from Component). However "AddComponent<T>()" also returns the component itself, but since it returns a "Component", this: [CODE]SpriteRenderer spriteRenderer = AddComponent<SpriteRenderer>();[/CODE] Does not work, and I must do this: [CODE]SpriteRenderer spriteRenderer = (SpriteRenderer)AddComponent<SpriteRenderer>();[/CODE] Notice the cast, so because of that, I heard of the magical world of implicit & explicit conversions, so I got my hands on it, and added the following to the "Transform" class: [CODE]public static implicit operator Transform(Component c) { return (Transform)c; }[/CODE] And I did the same with my SpriteRenderer class, however, it doesn't work and returns me an "user-definied conversions to or from a base class are not allowed" So I tried changing the conversion type to explicit, but it returns me the same error. So either I definetly don't get implicit & explicit conversions, or my returning value from "AddComponent<T>()" is messed up in some way, just in case, here's the "AddComponent<T>()" code: [CODE]public Component AddComponent<T>() where T : Component, new() { T newComp = new T(); newComp.gameObject = this; _components.Add(newComp); newComp.Start(); return (T)newComp; }[/CODE] I could obviously stick to the good old manual cast but it's kind of a hassle after a while, and Unity handles that pretty well. If anyone can give me a hint at this it would be awesome.
[QUOTE=Fleskhjerta;46616195]If someone can shed me some light on implicit & explicit conversions it would be nice, here's my setup. I have a "Component" base class, and two classes "SpriteRenderer" & "Transform" that inherits from it because they are components. I have a "GameObject" class that contains a list of components. Because of that, I added my own "AddComponent<T>()" function with the checking to see if the type "T" is indeed a valid Component (type that inherits from Component). However "AddComponent<T>()" also returns the component itself, but since it returns a "Component", this: [CODE]SpriteRenderer spriteRenderer = AddComponent<SpriteRenderer>();[/CODE] Does not work, and I must do this: [CODE]SpriteRenderer spriteRenderer = (SpriteRenderer)AddComponent<SpriteRenderer>();[/CODE] Notice the cast, so because of that, I heard of the magical world of implicit & explicit conversions, so I got my hands on it, and added the following to the "Transform" class: [CODE]public static implicit operator Transform(Component c) { return (Transform)c; }[/CODE] And I did the same with my SpriteRenderer class, however, it doesn't work and returns me an "user-definied conversions to or from a base class are not allowed" So I tried changing the conversion type to explicit, but it returns me the same error. So either I definetly don't get implicit & explicit conversions, or my returning value from "AddComponent<T>()" is messed up in some way, just in case, here's the "AddComponent<T>()" code: [CODE]public Component AddComponent<T>() where T : Component, new() { T newComp = new T(); newComp.gameObject = this; _components.Add(newComp); newComp.Start(); return (T)newComp; }[/CODE] I could obviously stick to the good old manual cast but it's kind of a hassle after a while, and Unity handles that pretty well. If anyone can give me a hint at this it would be awesome.[/QUOTE] I might be wrong with this, but can you not change the return type of your function to type T? i.e [code]public T AddComponent<T>() where T : Component, new() { /*stuff */ }[/code]
[QUOTE=BackwardSpy;46616389]I might be wrong with this, but can you not change the return type of your function to type T? i.e [code]public T AddComponent<T>() where T : Component, new() { /*stuff * }[/code][/QUOTE] Oh my god I feel stupid now, that also removes all my recasting inside the methods, thanks a lot I didn't know about that.
dumb question, but in terms of an array is index interchangeable with subscript?
yes
Hello, new to programming. I got the book Jumping into C++, and it suggests using Code::Blocks as an IDE/compiler, but trying to download it with Chrome and it's kicking back an error saying the setup file is malicious. Is it safe to use or even a good choice?
[QUOTE=Smallheart;46621001]Hello, new to programming. I got the book Jumping into C++, and it suggests using Code::Blocks as an IDE/compiler, but trying to download it with Chrome and it's kicking back an error saying the setup file is malicious. Is it safe to use or even a good choice?[/QUOTE] Yes totally safe; not sure if you've got some kind of antivirus going on but I can promise you code::blocks is totally safe, and a pretty good IDE.
[QUOTE=proboardslol;46621117]Yes totally safe; not sure if you've got some kind of antivirus going on but I can promise you code::blocks is totally safe, and a pretty good IDE.[/QUOTE] I have Mcafee and Malwarebytes but it looked like Chrome itself was blocking it for some reason, because I downloaded it w/ IE and it worked just fine. Either way, stoked to get started. Thanks for the info!
[QUOTE=Smallheart;46621135]I have Mcafee and Malwarebytes but it looked like Chrome itself was blocking it for some reason, because I downloaded it w/ IE and it worked just fine. Either way, stoked to get started. Thanks for the info![/QUOTE] I've been programming for a while but I just started C++ with code::blocks as well. You can PM me if you have any questions
[QUOTE=proboardslol;46621143]I've been programming for a while but I just started C++ with code::blocks as well. You can PM me if you have any questions[/QUOTE] Thanks! I'll more than likely be doing that haha.
Hey guys! I could really use some help with an address book program I've been struggling on for days now. I'm working with a doubly linked list in C. I'm trying to add nodes into the list at user-entered positions, starting with position 0. The positions will not be entered out of range. (no inserts at position 1 before something at position 0 etc.) The positions can be repeated though: inserting the new node in the position before the previous position occupant. (for example: if position 1 has x, and new node is inserted at position 1 with y, position 1 now has y and position 2 has x) I need to take the user entered position number and retrieve the current person in that position, but I can't quite get it right. Also, I have included my insert function if you wanted to take a look at that as well because it isn't working properly either. Thanks for any help! addressbook.h excerpt: [code] typedef struct person Person; struct person { char lastName[255]; char firstName[255]; char email[255]; char phoneNumber[255]; Person *pNext; Person *pPrev; }; [/code] addressbook.c excerpt: [code] #include "addressbook.h" Person * InsertPerson(Person * pPersonCur) { Person * pPersonNew; /* data gathered for CreatePerson() function here */ pPersonNew = CreatePerson(pLastName, pFirstName, pEmail, pPhoneNumber); if (pPersonCur) { pPersonNew->pNext = pPersonCur; pPersonNew->pPrev = pPersonCur->pPrev; pPersonCur->pPrev = pPersonNew; if (pPersonNew->pPrev) pPersonNew->pPrev->pNext = pPersonNew; } else { pPersonNew->pPrev = pFirst; pPersonNew->pNext = NULL; if (pFirst) pFirst->pNext = pPersonNew; } return (pPersonNew); } [/code] main.c excerpt: [code] #include <stdio.h> #include <stdlib.h> #include <string.h> #include "addressbook.h" Person *pFirst; /* First name in list */ int main(void) { Person *pPersonCur = NULL; /* current Person */ int bDone = 0, position = 0, counter = 0; pFirst = NULL; printf("Ready\n"); while (!bDone) { char input = getchar(); switch (input) { case 'a': counter = 0; scanf("%d", &position); /* Where desired position (such as 0, 1, 2) is entered */ if (position == 0) { if (pFirst) { if (pFirst->pNext) { pPersonCur = pFirst->pNext; } } else { pPersonCur = pFirst; } } else { pPersonCur = pFirst->pNext; while (counter < position) { pPersonCur = pPersonCur->pNext; counter++; } } InsertPerson(pPersonCur); /* Takes in person at desired position, return value is new inserted person */ break; /* Some other cases here */ case 'q': bDone = 1; break; } } /* Rest of code */ [/code]
Anybody know any C libraries which will allow me to generate no-alias square tones of a certain frequency? (2400hz and 1200hz to be exact)
[QUOTE=NixNax123;46614782]Alright, this grid thing is way too much trouble than it's worth. Scrapping this.[/QUOTE] I must admit, I have trouble comprehending how you can implement a full quadtree but not a (comparatively simpler) grid :rolleyes:
[QUOTE=Tommyx50;46624827]I must admit, I have trouble comprehending how you can implement a full quadtree but not a (comparatively simpler) grid :rolleyes:[/QUOTE] I implemented the grid and the class completely, but I can't make the entities work with it.
Sorry, you need to Log In to post a reply to this thread.