User Profile

Collapse

Profile Sidebar

Collapse
DaemonCoder
DaemonCoder
Last Activity: Mar 17 '08, 09:39 AM
Joined: Mar 3 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Droulic
    Droulic posted a Visitor Message for DaemonCoder
    How do you have your 2507 setup to connect to the modem. ANy help would be appreciated. Droulic
    See more | Go to post

  • This is being designed for a backend commandline interface for an os.. i dont want a numbered system because the commands are always gonna be a word. ie exit or help... Otherwise that would be a perfect solution.
    See more | Go to post

    Leave a comment:


  • DaemonCoder
    replied to Mouse programming
    in C
    I think that the best solution is a mouse driver. That is, make a program that recieves signals from the keyboard and then sends them bask to the os as the mouse signals... Basically you would be writing the windows equivilant of MouseKeys.... This would in effect take a section of the keyboard and make it function only as the mouse. (might as well use the number pad on the right, egh...)

    7 8 9
    4 5 6
    1 2 3

    ...
    See more | Go to post

    Leave a comment:


  • DaemonCoder
    replied to Quadratic equation
    in C
    If you could post the portion of code where you think the bug might be, someone might be able to better help you. Right now based on the description.... I think is is a variable scope problem...
    See more | Go to post

    Leave a comment:


  • You know i have too much time on my hands... My signature will now compile in GCC. I really need a life.. The next challenge will have to be: How to best abuse the Preprocessor...
    See more | Go to post

    Leave a comment:


  • A better way to write the switch/case statement.......

    I need some suggestions on how to betterer write the following code. I tried the array of arguments, and san through for a match then strcmp but i get massive errors. The code below is the only way i could get it to work.. if some one has any sugestions on hjow to make this better please let me know... The definiton of the class was left out intentionally. if you need this please let me know

    Code:
     
     
    int EXIT=1;
    int main()
    ...
    See more | Go to post

  • Check the differences between the declaration and the two calls.
    Code:
     
     
    DP trapzd(DP func(const DP), const DP a, const DP b, const int n)
     
     
    s=NR::trapzd(func,a,b,i);
     
    s=NR::trapzd(func(const DP),a,b,i);
    The top one is coming back undefined because the linker is expecting a value to be passed to the function.

    --

    The one and only.... -- Uh, What am I ...
    See more | Go to post

    Leave a comment:


  • Using the for loop, it is down to 85 characters. Still not as good as 58 though. Just goes to show you how uselessly verbose java is.

    Code:
     
    class f{public static void main(){int a=1,b=1;for(;b<4182;a=b+(b=a))System.out.println(b);
    Oh, and please post the character count. Will make this a bit easier and eliminate the guess work. Thank you.
    See more | Go to post

    Leave a comment:


  • That is correct. I should also have specified that Preprocessor directives are not language code, so they do not count twords the end character count. And thankyou for pointing out my mistakes. I will be the first to admit that i am a novice programmer....

    So to answer you question...
    Code:
     int main(){for(int i,j=1;i<2585;){printf("%d %d ",i,j);i+=j;j+=i;}}
    The code does count for a total of 58 characters....
    See more | Go to post

    Leave a comment:


  • Thank you Banfa. I will take into account that is is bad practice and remeber it for next time. As I previously stated before, I was mad at the computer so i threw some code at it. But now i realize my only mistake was a comma... I was tired and not thinking straight.

    Well, Now that this project is finished.. Guess what language my teacher said to take the same program an write it over again in....?
    See more | Go to post

    Leave a comment:


  • Ok, I was mad at the computer cause the code did not work... And i made this function. I have no idea how it works? Can someone please explain this to me?



    [CODE=c] System init()
    {
    System system = {{getline}, {println};
    return system;
    }

    int main()
    {
    System system = init();
    }
    [/CODE]
    See more | Go to post

    Leave a comment:


  • CHALLENGE: Shortest Algorithim for Fibonacci Sequence on ONE line

    The challenge is to create the shortest algorithim, In any programming language.

    RULES:
    1. All code must be on one line.
    2. Languages that prevent this are disallowed. I.E Assembly, and of course COBOL. All other languages are fair game.
    3. Sequence must go up to at least 4181.


    If i missed a languge that should be disallowed please let me know...
    My solution is in Java. weighing in @ 108...
    See more | Go to post

  • DaemonCoder
    started a topic Making C User Friendly...

    Making C User Friendly...

    I an currently working on an os project, and it has take a twist. I have started writing classes on top of c to make it easier to use. Its actually starting to look a lot like java. Do you think that programmers would use a java like superset of C for their lower level programming needs? As of right now all of the function calls have workarounds for 32 bit protected mode. Would this have any value if i made it available for download?
    See more | Go to post

  • What did i do, and why does this obfuscated code work.?

    Code:
     
     
    typedef struct Out {
     void (*println) (void);
     
    } Out;
    typedef struct In{
     void (*getline) (void);
    } In;
    typedef struct System {
     In in; 
     Out out;
    } System;
     
    void println (void)
    {
     printf("\nsystem.out.println \n");
    }
    void getline (void)
    {
    printf("\nsystem.in.getline
    ...
    See more | Go to post

    Leave a comment:


  • [CODE=c]
    typedef struct Out {
    void (*println) (void);
    } Out;

    typedef struct In{
    void (*getline) (void);
    } In;

    typedef struct System {
    In in;
    Out out;
    } System;

    void println (void)
    {
    printf("system. out.println \n.");
    }...
    See more | Go to post

    Leave a comment:


  • Ok... So I spoke with my teacher and he says that C will be the hardest language to implement this in so he said to use C. This class is about Logic and i understand his reasons.. I still have a couple of questions though...

    Code:
     System system = {{actual_println}};
    I know that system is the base structure and we are creating an instantiation of it called system but what does the right had side of the equal mea...
    See more | Go to post

    Leave a comment:


  • One more thing... How would i define this as a namespace to have a function call like so??
    Code:
     
    #include <customSystem.h>
     
    using namespace System::Out
     
    System::Out::println("hello"); // equivilant to printf but with no bios calls...for use in protected mode...
    EDIT: Used code tag CPP colors were way too intense. Changed to text.
    See more | Go to post

    Leave a comment:


  • So i could do this in c++ like so?

    Code:
     
    using namespace std;
     
    class System {
     
    public:
    	System ();
    ~System (); 
    // do i have to define out here in some way?
     
    };
     
    class System::Out {
     
    	 public:
    		Out ();
    	 ~Out ();
    	  void println();
    }
     
    // and of course i have to define all the functions...
    ...
    See more | Go to post

    Leave a comment:


  • DaemonCoder
    replied to Problem in comparing two arrays
    in C
    Your welcome. Actually Banfa gave the answer I just made it easier to understand.
    See more | Go to post

    Leave a comment:


  • Is it possible to have multiple layers of nested functions in c

    I am curious if its possible to create a structure for an small SDK smiliar to that of java for C/C++. IE a System.Out.prin tln() that prints a statment in c?

    I would guess i would have to use a struct to create system first but how would i nest the other structs beneath it, and could i still access the functions in the same manner.... System would have a Timer() function as well as Out witch is another Struct ... Is this possible.....
    See more | Go to post
    Last edited by DaemonCoder; Mar 9 '08, 06:00 PM. Reason: Added another Code Sample.. / added end code tag
No activity results to display
Show More
Working...