• What do you need help with? Version 1
    5,001 replies, posted
[QUOTE=ROBO_DONUT;24883674]Would those people have paid for your app if they couldn't pirate it? I don't think so. You're not losing any revenue. Don't impose stupid restrictions on legitimate users.[/QUOTE] I do. $1 might not be a lot, but people prefer $0 over $1. If they can just pirate an app, why would they bother to buy it?
[QUOTE=Pepin;24883434]I was mainly trying to get in the habit of evaluating what data type was needed because my C programming professor told me it was best to get in that habit because it comes in useful when working on large projects.[/QUOTE] Your professor is right, that's a good habit to practice. But memory requirements aren't the only factor in choosing a variable type. By analogy: a std::list takes uses more memory than a std::vector to hold the same data, because it has to store a pair of pointers together with each item, but you normally choose between the two based on their performance characteristics, not their memory consumption.
[QUOTE=arienh4;24885999]I do. $1 might not be a lot, but people prefer $0 over $1. If they can just pirate an app, why would they bother to buy it?[/QUOTE] I think you're as bad as they are.
[QUOTE=arienh4;24885999]I do. $1 might not be a lot, but people prefer $0 over $1. If they can just pirate an app, why would they bother to buy it?[/QUOTE] It's mainly for students at the school I go to. I'm just worried that they will just copy it. We have a ton of games being spread around on the school. We even had a bunch of emus and ROMs on the network shares.
[QUOTE=Agent766;24890612]It's mainly for students at the school I go to. I'm just worried that they will just copy it. We have a ton of games being spread around on the school. We even had a bunch of emus and ROMs on the network shares.[/QUOTE] I just came up with an idea for simple copy protection. Your program comes with some dll file and it contains some placeholder text like "Hackme". The text should be only bytes and the dll will not be used really what dlls are used for. When you run the program it has to find that dll or it won't start up. Then it will check if the dll contains "Hackme", if it does then it is programs first run. Then the program replaces the text in that dll with computer's name (or something that every computer doesn't have in common). Next time the program sees that the dll doesn't contain "Hackme", but it does contain something else. So if that name in dll is the same as the computer's name that the program is running on then you let the user to use the program, but if it isn't then it is running for some other computer than it was first time ran, so the program closes. Dll file is good for this use because people think that the program will really need it to run. Also it isn't perfect because if someone finds that out then it's good for nothing.
It also doesn't help when the program is portable for school use. So that the user would use it on multiple computers. Meh, I might just do a freeware thing and have a "Please Donate" popup every few days.
You could 'authorize' certain usernames to use your program. Something like this: [code] using System; using System.Net; class ShittyDRM { public void Check() { if(new WebClient().DownloadString("http://your/web/service?username=" + Environment.UserName) != "true") Environment.Exit(1); } } [/code]
[QUOTE=turb_;24893122]You could 'authorize' certain usernames to use your program. Something like this: [code] using System; using System.Net; class ShittyDRM { public void Check() { if(new WebClient().DownloadString("http://your/web/service?username=" + Environment.UserName) != "true") Environment.Exit(1); } } [/code][/QUOTE] I really love that idea. I'll see how it works (and if our school webfilter (WebSense) doesn't block it).
[QUOTE=sim642;24892862]I just came up with an idea for simple copy protection. Your program comes with some dll file and it contains some placeholder text like "Hackme". The text should be only bytes and the dll will not be used really what dlls are used for. When you run the program it has to find that dll or it won't start up. Then it will check if the dll contains "Hackme", if it does then it is programs first run. Then the program replaces the text in that dll with computer's name (or something that every computer doesn't have in common). Next time the program sees that the dll doesn't contain "Hackme", but it does contain something else. So if that name in dll is the same as the computer's name that the program is running on then you let the user to use the program, but if it isn't then it is running for some other computer than it was first time ran, so the program closes. Dll file is good for this use because people think that the program will really need it to run. Also it isn't perfect because if someone finds that out then it's good for nothing.[/QUOTE] Because crackteams don't buy the program first, hex all the files, run the game and see what changed, right ?
[QUOTE=pikzen;24893714]Because crackteams don't buy the program first, hex all the files, run the game and see what changed, right ?[/QUOTE] Because a bunch of kids in a school are intelligent enough to do cracking of anykind?
I have this assignment that I just can not solve. I have to make a program that counts from 1 - 100 and then checks every step if the number is able to get divided by 3 and/or 5. If it is then it will add the text "Ding" and/or "Dang" after the number. [code]import javax.swing.JOptionPane; public class DingDang_thing { public static void main (String[] arg) { int value = 0; String s = "Result:"; while (value <= 100); { value = value + 1; } } } [/code] This is as far as I have gotten, it SHOULD take the value that is = to 0 and add by 1 until it reaches 100. But then I want to make it check if the number is divisible by 3 and/or 5. I tried adding: [code]import javax.swing.JOptionPane; public class DingDang_thing { public static void main (String[] arg) { int value = 0; String s = "Result:"; while (value <= 100); { value = value + 1; [B] if (value / 3); { value + "Ding" //Or something like that[/B]. } } } [/code] However, I do not know where this text will show up. It should in the console but I don't see anything at least. Not that I am doing it right. [editline]11:58AM[/editline] The error just says "Cannot convert from int to boolean." Well.. why not?!
Not sure what the Java syntax is, but you can use modulo if x % 3 == 0 then x is divisible by 3 if x % 5 == 0 then x is divisible by 5 and so on
[QUOTE=Chris220;24896188]Not sure what the Java syntax is, but you can use modulus if x % 3 == 0 then x is divisible by 3 if x % 5 == 0 then x is divisible by 5 and so on[/QUOTE] That's modulo, modulus is the absolute value, and yes, it's % in Java. It finds the remainder of the division.
[QUOTE=CommanderPT;24896112]bla[/QUOTE] Project Euler N°1, right ? [cpp] static void Calc() { int i = 0; int result = 0; while (i<100) { if (i%3 == 0) { result += i; } if (i%5 == 0) { result += i; } } Console.WriteLine(result); } [/cpp] Here's how I did it in C#. anyways, you should be using the modulo operator (%) for this. By the way, I'm kinda stuck at Project Euler 3. I can't find an efficient way to factorize 60086544444whatthefuck. Any help ?
Let's say value is 6. Value is divided by 3 and 2 is returned, but this doesn't say anything about whether to enter or jump over the if. What you want to do is check if the remainder after division is zero, which is basically value % 3 == 0. [editline]02:29PM[/editline] Argh, why didn't I refresh the page before replying. :downs:
Still very confused. This is the first thing I'm doing since the summer. [cpp] import javax.swing.JOptionPane; public class DingDang_thing { public static void main (String[] arg) { int value = 0; String s = "Result:"; while (value <= 100); { value = value + 1; if (value % 3 == 0); { } } } } [/cpp] Still don't know what to do next. My book haven't told me how to write things out in the console.
[QUOTE=arienh4;24896350]That's modulo, modulus is the absolute value, and yes, it's % in Java. It finds the remainder of the division.[/QUOTE] Woops, I always write the wrong one Thanks for telling me, edited my post
[quote=commanderpt;24897293] [cpp] import javax.swing.joptionpane; public class dingdang_thing { public static void main (string[] arg) { int value = 0; int result = 0; string s = "result:"; while (value <= 100); { value = value + 1; if (value % 3 == 0); { result += value } if (value % 5 == 0); { result += value } system.out.println(s + result); } } } [/cpp] [/quote] [editline]04:23PM[/editline] It don't know how's the || (or) operator in java, but you could do if(value %3 ==0 || value % 5 ==0), which would be faster to write. And [cpp] fucked up my curly braces.
[cpp]public class dingdang_thing { public static void main (string[] arg) { int result = 0; for(int value = 0; value <= 100; ++value) { if (value % 3 == 0 || value % 5 == 0) { result += value; } } System.out.println("Result: " + result); } } [/cpp] Using the logical or here does not do the same, but it is what you want. If a value would be a divisor of 3 and 5, you'd count it twice, which is not what you want.
-snip- I missed an entire page of replies.
I can detect if 2 AABBs intersect, but for their bouncing I need to know which sides started touching each other : the ones parallel to x-axis or the ones parallel to y-axis. Anyone can tell me how should I make it because I have no idea?
Im trying to get LWJGL to work but it wont create the test window when i put the code in linux i get this crap [CODE]richy@richy-laptop:~$ java -cp .:res:jar/lwjgl.jar:jar/lwjgl_test.jar:jar/lwjgl_util.jar:jar/lwjgl_fmod3.jar:jar/lwjgl_devil.jar:jar/jinput.jar: -Djava.library.path=/home/richy/NetBeansProjects/lwjgl/ org.lwjgl.test.WindowCreationTest Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/test/WindowCreationTest Caused by: java.lang.ClassNotFoundException: org.lwjgl.test.WindowCreationTest at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Could not find the main class: org.lwjgl.test.WindowCreationTest. Program will exit. richy@richy-laptop:~$ [/CODE]
Did you import any of those classes?
-snip-
[QUOTE=Pepin;24915549]Did you import any of those classes?[/QUOTE] No i havent touched anything i simply followed [URL="http://lwjgl.org/installation.php"]this[/URL]. So i unpacked them and ran that linux command line
[QUOTE=CommanderPT;24896112]I have this assignment that I just can not solve. I have to make a program that counts from 1 - 100 and then checks every step if the number is able to get divided by 3 and/or 5. If it is then it will add the text "Ding" and/or "Dang" after the number. [code]import javax.swing.JOptionPane; public class DingDang_thing { public static void main (String[] arg) { int value = 0; String s = "Result:"; while (value <= 100); { value = value + 1; } } } [/code] This is as far as I have gotten, it SHOULD take the value that is = to 0 and add by 1 until it reaches 100. But then I want to make it check if the number is divisible by 3 and/or 5. I tried adding: [code]import javax.swing.JOptionPane; public class DingDang_thing { public static void main (String[] arg) { int value = 0; String s = "Result:"; while (value <= 100); { value = value + 1; [B] if (value / 3); { value + "Ding" //Or something like that[/B]. } } } [/code] However, I do not know where this text will show up. It should in the console but I don't see anything at least. Not that I am doing it right. [editline]11:58AM[/editline] The error just says "Cannot convert from int to boolean." Well.. why not?![/QUOTE] You need to use System.io.out(value + ": Ding!");. That says you want to output it to the console. [editline]10:00AM[/editline] [QUOTE=CommanderPT;24897293]SStill don't know what to do next. My book haven't told me how to write things out in the console.[/QUOTE] Did your book not have a Hello World as it's first tutorial?
[url]http://www.madwizard.org/programming/tutorials/netcpp/5[/url] Which model do I use for my game client :confused: I don't want anything that blocks, or even interrupts the main thread, because that will hit FPS, but they all seem to have an impact on the main thread. I might try to use blocking sockets on a worker thread, since I only need to maintain 1 outgoing connection. [editline]07:14PM[/editline] My game client is in c++ if you didn't figure it out from the link.
I have a C# forms application and in Program.cs Main function I added string[] args to the arguments (wasn't there before). When I did that before, opening any file with the exe of that program would put the files path into the args array and I could process it, but for some reason it's not working now. Then I run the program normally, it works, when I load the file from inside the program, it works fine, when I add the path of the file as a command line argument for the program, it works fine. But when I try to open the file with the program, the cursor just flashes and after a few seconds the program crashes. Any ideas why that might be happening? [editline]12:21AM[/editline] [B]TL; DR:[/B] Program can open file when the path is in the command line but crashes when I open the file with explorer (Open with...)
[QUOTE=Darwin226;24927145]Program can open file when the path is in the command line but crashes when I open the file with explorer (Open with...)[/QUOTE] Have you checked whether the filename is actually in the args array as you expect? If it's there, is it different from what you get when you type it on a command line?
I was in the middle of writing something in C# in VS2010, when suddenly the next build looked like this. [img]http://i51.tinypic.com/2r6pl3n.png[/img] The quality of everything seen in the application bleached and mutilated, undoing code I added, which was just tweaking a text value, did not help. Why did this happen?
Sorry, you need to Log In to post a reply to this thread.