- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 18
- Posts with Upvotes
- 17
- Upvoting Members
- 10
- Downvotes Received
- 6
- Posts with Downvotes
- 6
- Downvoting Members
- 5
89 Posted Topics
Re: [QUOTE=shubhamgore;1231564] why should we have to avoid goto, i have used it here becoz i have learn it yesterday from complete reference (c) [fundamental book for c language], and there was a note, saying that whenever we want to shift control of program over any part of the code, [U]we … | |
Re: Yes, you can simplify this code - I would suggest to dismiss branching statements in "decode" procedure and make use of static array of LED patterns. Something like: #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAKE_PATTERN(b1, b2, b3, b4, b5) ((b1 << 4) | (b2<<3) | (b3<<2) | (b4<<1) | … | |
Re: As unofficial rule - all C/C++ macros are written in all caps. Underscores simply helps to improve readability if constant consists from several words. It's possible to name a variable with underscores, but it's uncommon. So if you see all caps symbol with underscores in it - you can be … | |
Re: [QUOTE=akki30;1285547]how this function is used. i m so confused n not getting the proper result[/QUOTE] Fibonacci number is calculated in pretty straightfoward way: [IMG]http://upload.wikimedia.org/math/0/c/e/0cebc512d9a3ac497eda6f10203f792e.png[/IMG] No additional comments needed... | |
Re: [QUOTE=mohan_198505;787487]4.Login name and password are hardcoded in the program and not strored in any file.[/QUOTE] I find this self-contradictory. "Hardcoded" means that password WILL BE stored in program file as embedded string resource. So for added security i suggest to hardcode not plain password, but instead MD5 hash of password. … | |
Re: Or... use backtracking algorithm => [url]http://en.wikipedia.org/wiki/Backtracking[/url] Main idea- Save each crossroad decision you take in the tuple form [ICODE](COL, ROW, DIRECTION)[/ICODE]. Such as after N iteratiions you will get list something like: [ICODE][(1,2,UP),(4,5,DOWN),(6,8,LEFT),(10,14,RIGHT),...][/ICODE]. Fill this list until you get into blind alley OR no NEW crossroads are reachable. If so … | |
Re: [QUOTE=pretu;380468]HI All How can we generate a sine wave without using the sin() function. Thanks pretu[/QUOTE] You can try Taylor series also. | |
Re: [QUOTE=fallopiano;1464979]Hey everyone, as the title suggests I'm trying to find a function or some code that'll execute a string of code in Lua. [/QUOTE] [URL="http://www.lua.org/manual/5.1/manual.html#pdf-loadstring"]LoadString()[/URL] | |
Re: In your [ICODE]while(1)[/ICODE] loop put alarm condition check, if it passes - write something to alarm port. Here is some code for PIC16F84A. [url]http://www.micro-examples.com/public/microex-navig/doc/084-alarm-clock[/url] It's mikroBasic, not C code, but I think you will get the idea. | |
Re: Also i want to say that this question is related to compiler design. So i would suggest to learn compiler design/programming in general, before advancing to concrete problem. | |
Re: You can always try random walk algorithm: [QUOTE] While (PUZZLE_NOT_SOLVED) { tiles = 4 tiles around hole; tile = RANDOM_TILE_FROM(tiles); MOVE_TILE(tile); } [/QUOTE] This algorithm is very inefficient and not ensures that solution will be found. And it is just pseudocode. But hey, you are supposed to do homeworks yourself. … | |
Re: [QUOTE=gauthamnaggg;473435]Hello all, I need to write a code that compress and uncompresses thegiven file in c.Well i know there are many algorithms available ,one of the famous algorithms is Huffman's algorithm.But how do i implement the algorithm ?.I googled a lot but couldn't able to find ?.Is there any simple … | |
What language is the most difficult to compile and why ? (except natural ones) | |
![]() | Re: [ICODE]write_data(...)[/ICODE] is callback function which will be called every time each new data portion arrives from internet. So basically you should measure download speed and remaining time in your function write_data(): 1. save current time in local variable time1 2. then download speed will be [ICODE]written/(time1-time2)[/ICODE] 3. save current time … |
Re: Since you didn't write a language in which you want to program - for the beginner i would recommend either [URL="http://love2d.org/"]Lua + Love2D[/URL] OR [URL="http://www.pyglet.org/"]Python + PyGlet[/URL] Happy coding! | |
Re: And a bit shorter version ;) [CODE=C]((a>b&&a>c)?a:((b>c)?b:c))[/CODE] | |
Re: [QUOTE=anu john;416424]Ye. it will be a kit with ethernet chip n rj45 connections.therefor the tcp/ip protocols needed will be taken care of.. nw i need to program my controller using c language in a way that i can access my sql server 2005 on a remote machine...Also im trying to … | |
Re: [QUOTE=pato wlmc;1260648]Well, right now i'm using linux, but i've heard that windows is really best for programing videogames ( on c++ ) well, wich O.S. do you think is the best? P.D. Sorry for the bad english jeje :$[/QUOTE] When it comes to game development definitely answer is Windows. Simply … | |
Re: I don't think that SQL server (or any other database server) is suited for multiplayer purposes. Usually game devs for multiplayer mode writes it's own server and client. So I would recommend to you to write TCP/UDP server and client by using System.NET library. Check this out- [url]http://www.codeproject.com/KB/IP/socketsincsharp.aspx[/url] | |
Re: From the problem description is not clear - Do you want just move 3D model in space or animate different pose ? Ok, I make assumption that you want to animate pose, because you mention different body parts. How to do that just google keywords "mesh deformation" and/or "skinning GPU". … | |
Re: Indeed CUDA is only for nVidia cards. I suggest better using OpenCL. Also if these calculations is only for computing image transformations- you can try Pixel Shader. | |
Re: [QUOTE=sourabhtripathi;1216213] now can i achieve increment in both value and pointer in one line ?[/QUOTE] It's pretty straightforward - [CODE] // increments pointer and then value ++(*(++p)); // increments value and then pointer ++(*(p++)); [/CODE] | |
Re: A VERY interesting question ! Thanks for asking such thing :) Both methods are polyalphabetic ciphers. There are some algorithms for polyalphabetic ciphers which computes key size from ciphertext. Once key size is known, ciphertext can be splitted into columns which are vulnerable to simple [URL="http://en.wikipedia.org/wiki/Frequency_analysis"]frequency analysis[/URL]. So answer is … | |
Re: Wiki is our friend: [url]http://en.wikipedia.org/wiki/Maximum_subarray_problem[/url] Kadane's algorithm performs in O(n) for 1D array. | |
Re: [url]http://www.computeruser.com/articles/xp-professional-vs.-2000-professional.html[/url] | |
Re: [CODE=C] #include <stdlib.h> // on windows clear screen with system("cls"); // on unix/linux clear screen system("clear"); [/CODE] | |
Re: I made some fixes, here corrected version: [CODE=C] #include<stdio.h> #include <stdlib.h> void getOption(); void getData(int *num1, int *num2); void calc(int option, int num1, int num2); float add(int num1, int num2); float sub(int num1, int num2); float mul(int num1, int num2); float divm(int num1, int num2); void printResult(float result); void clrscr() … | |
Re: [QUOTE=AuburnMathTutor;1257975] I pointed out that we started with a language that was much farther from natural languages, i.e. machine language, and have since developed languages that are more similar in structure to English. [/QUOTE] Seems you are over-fitting your observations of programming language evolution of C-like languages. Take a look … | |
Re: [QUOTE=GameGuy;1212348] How long, if I have no experience, until I am making 3D FPS'? [/QUOTE] My advice - don't start with FPS project. It's the problem which faces beginners of game programming. If you want to learn 3D game programming - at first choose very basic 3D project - such … | |
Re: You can start here- [url]http://en.wikipedia.org/wiki/Computer_vision[/url] Yes, you will need to track motion, but it's problem you concentrate too early. At first you need to concentrate at object (hand) recognition phase. You could start here- [url]http://www.codeproject.com/KB/audio-video/face_detection.aspx[/url] Also somehow i think for such project perfomance is important thing cause you will operate … | |
Re: [QUOTE=ranjita.cdt.esg;1249953]can anyone guide me to good websites with respect to this topic "image deblur without original image" [/QUOTE] Make convolution filter with sharpen kernel. [QUOTE=ranjita.cdt.esg;1249953] Ultimately have to do video denoising. [/QUOTE] Denoising (blur) can be done by convolution filter with median kernel. So if your main target is to … | |
Re: [QUOTE=moroccanplaya;1245276]so why c is no used in the mainstream ?[/QUOTE] "mainstream" alone doesn't mean anything at all and should be used only in context. For example: - Embedded systems programming - C is used by mainstream. - GPU programming - take a look at GLSL shader language, which is based … | |
Re: Make program for prediction of tsunami date+time+impact from GPS and/or other data. | |
Re: [QUOTE=SJP99;1253210]not sure if this is a right place.....but what exactly does it mean if a programming language is portable?[/QUOTE] It means that there exists compilers/intepreters of that language for many different kinds of computers/OS. | |
Re: I will suggest 3 ways: [ICODE]Easy[/ICODE] => Python and PyGame (or even Rabbyt - easier library for 2D stuff) [ICODE]Normal[/ICODE] => C# / VB.NET and XNA (xna is very good directx abstraction library) [ICODE]Hard[/ICODE] => C++ and DirectX SDK (hard way, if you want to control everything and are prepared … | |
Re: recursion is your friend | |
Re: If number of permutations is not big - simply try to bruteforce. Otherwise try genetic algorithm - it is good for such sort of optimization problems. | |
Re: Even 64-bit integer is not able to store such big numbers. You will need to store these numbers in array as sequence of digits and write your own addition operation of such big numbers, cause CPU can't add integers bigger than int-64 without loosing precision. | |
| |
Re: [QUOTE=gerard4143;1240754]Why does the C standard implement this type of behaviour or is it better left unknown?[/QUOTE] Language specification (aka. standard) is NOT the same as language implementation (by compiler or interpreter). [url]http://en.wikipedia.org/wiki/Programming_language_specification[/url] [url]http://en.wikipedia.org/wiki/Programming_language_implementation[/url] So - C standard does not *implement* anything, it just defines standard. And How standard will be … | |
Re: [QUOTE=Fernidad13;1225514] What kind of math do they use and how??? Can u guys PLEASE HELP ME?!?!?![/QUOTE] From my understanding there are several essential math fields used in games - a. Geometry b. Linear algebra c. Applied mathematics d. Calculus There may be more, which doesn't come into my mind now. … | |
![]() | Re: I'm not expert, but will try to answer. Make substitution [ICODE]r=(a+b)a*b[/ICODE] (it will be easier to analyze), then you will get such picture below. So basically 'a' transition is used to make 'ar' transition. Hope that helps. |
Re: Or you could achieve practically same thing with backtracking algorithm- [url]http://en.wikipedia.org/wiki/Backtracking[/url] Start from (0,0) Choose next legal node (x,y) If sum_until(x,y) > (3,3) -> advance backwards to previous cell, and choose next legal move. Repeat while sum_until(x,y) != (3,3) AND (x,y) is not nearest cell from (3,3). | |
Re: Several problems here- 1. Change function [ICODE]input()[/ICODE] to [ICODE]raw_input()[/ICODE]. Input() expects valid python code and does evaluation of that code. 2. You are reading user command to variable 'prompt_ghall' and hence such interpreter error: [ICODE] Traceback (most recent call last): [...] File "Mannerbold.py", line 61, in prompt_ghall prompt_ghall() TypeError: 'str' … | |
Re: Banfa said almost everyhing you should know. But... I would not recommend to use Comparisons Or Moves columns for time complexity analysis. Simply because Comparisons and/or Moves can show different trend than run time column. So because these trends in principle can differ - i would strictly recommend only plot … | |
Re: Hey you even didn't wrote what game mechanics you should expect. Or do you think that we are some kind of wizards ? | |
Re: Also this branch is totally wrong- [CODE] /* invalid prime factor */ else { if(d == 2) d = 3; else d += 2; } [/CODE] this code will fail after prime P=7 -> 7+2 = 9, but 9 is not prime number, instead after 7, next prime factor should … | |
Re: Your description of problem is too fuzzy. At first try to abstract from details and tell us in general - What are you trying to achieve here ? | |
Re: According to [url]http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Operator_precedence[/url] operations should be executed like this [ICODE]m = ((++i) && (++j)) || (++k);[/ICODE] |
The End.