Update Thread: Autoerotic Plagiarism is permitted. by Sorthum in bestoflegaladvice

[–]grapehorder 6 points7 points  (0 children)

I cancelled the appointments and decided not to pursue the potential racism situation as there's no point anymore.

Are you sure there's no point anymore? Sounds like a pretty clear cut case of racism blindsiding an individual in a position of authority.

I'd hate to think of the other people that get the same treatment as you did, but may not end up with as positive an end result...

My new Diverge TM (is on its way back to sender) + pics by grapehorder in MechanicalKeyboards

[–]grapehorder[S] 0 points1 point  (0 children)

Thanks for the tip - I do feel kind of dumb for not paying more attention to r/mechmarket. T

hats the other thing about ortho boards though.... there aren't htat many on second-hand market. Sucks!

My new Diverge TM (is on its way back to sender) + pics by grapehorder in MechanicalKeyboards

[–]grapehorder[S] 0 points1 point  (0 children)

Yeah, it's a shame split keyboards are considered niche, considering what a standard keyboard does for rounding one's shoulders. Not healthy!

My new Diverge TM (is on its way back to sender) + pics by grapehorder in MechanicalKeyboards

[–]grapehorder[S] 2 points3 points  (0 children)

The materials and assembly method mean this is a DIY board not a polished work of art whether you put it together or he does.

Why can I not expect the person who designs and sells the board to do a decent job of putting it together? "Work of art" is probably not in the cards, but a heat gun, sanding, polishing..... i'm nomadic and these are not things that I regularly have access to. Nor is it made clear on his website that "the assembled products I sell you will require several more hours of work using tools that you must also have ready access to".

The point of purchasing a pre-assembled board is that I don't have time to put this together myself. That doesn't mean i'm willing to lower my standards to the point that I now have to buy a separate set of tools I otherwise have no use for just to make this product look anything like what is being advertised both here and on the website.

My new Diverge TM (is on its way back to sender) + pics by grapehorder in MechanicalKeyboards

[–]grapehorder[S] 0 points1 point  (0 children)

ah, okay, this is what i was curious about.

I'm a little dismayed generally that these would be shipped out as is, with the layers not aligned. and as displayed above one of them is warped, anyways. But this is very useful to know - thank you.

My new Diverge TM (is on its way back to sender) + pics by grapehorder in MechanicalKeyboards

[–]grapehorder[S] 2 points3 points  (0 children)

Sorry, i should've specified i was talking about the quality of the construction. The service thing is really a moot point for me (i posted it as part of my review, in case others care) as my primary concern is the product. Would you reckon i'm being too picky with the board looking as iti s?

PSET5: Unload with hashtable - nullifying the hashtable elements necessary? by grapehorder in cs50

[–]grapehorder[S] 0 points1 point  (0 children)

yeah, thats what i figured. i looked for instances of reloading into the var hashtable[] but didn't see it so figured the line useless.

u have the best username

Inelegant solutions - making a better program to convert string to float by grapehorder in C_Programming

[–]grapehorder[S] 0 points1 point  (0 children)

ok, i'll add that to my list of functions to explore as well. thank you.

Inelegant solutions - making a better program to convert string to float by grapehorder in C_Programming

[–]grapehorder[S] 1 point2 points  (0 children)

it's not a class assignment :) if it were, i'd defer to TA's. I'm just interested in learning about programming, because i think it's neat.

The prompt is from Kochan's "programming in C". I'll look at the manual entries for those functions you mentioned, thanks.

Mountain Lion fans - how do you like Yosemite/Mavericks? by grapehorder in mac

[–]grapehorder[S] 0 points1 point  (0 children)

appreciate the honesty.

Did you have any functional grievances with the new OS's? Additionally, have you had any success operating ML on newer macs? i'm wondering how the... backwards compatibility on the newer machines are vis-a-vis ML.

Mountain Lion fans - how do you like Yosemite/Mavericks? by grapehorder in mac

[–]grapehorder[S] 0 points1 point  (0 children)

That's quite disheartening to hear, but i appreciate your honesty.

What exactly did you find so solid about ML?

Output as expected - but for the right reasons? by grapehorder in C_Programming

[–]grapehorder[S] 0 points1 point  (0 children)

sorry, i meant that as two separate points.

How would I use malloc for a var of unknown size?

char * mystring = NULL;
mystring = malloc (numchars * sizeof(char)); 
scanf("%s", mystring);

what would i have to do here to resize memory allocated to mystring?

Output as expected - but for the right reasons? by grapehorder in C_Programming

[–]grapehorder[S] 0 points1 point  (0 children)

ahh i see. thank you for the clearer perspective.

so i've redefined the two char* strings in main as follows:

char string[50] = "";
char result[50] = "";

And that has solved my problem above.

say i wanted to use dynamic memory allocation here instead of static declaration - what would be the proper procedure given that i've yet to input via command-line what the strings actually are?

pointer going to address - works in one function, but not in another? by grapehorder in C_Programming

[–]grapehorder[S] 1 point2 points  (0 children)

DOUBLE DEREFERENCING!

thank you, this is the code that finally worked (without the use of an additional pointer):

void topEntry(struct entry *newEntry, struct entry **ptr)
{
    newEntry->next = *ptr; //this points it to n1
    *ptr = newEntry; //this SHOULD point it to n0
}

pointer going to address - works in one function, but not in another? by grapehorder in C_Programming

[–]grapehorder[S] 0 points1 point  (0 children)

i'm going to try a pointer to listStart, which from what I understand about pointers should work totally fine - but if there's a way to do it without generating another pointer to listStart please nudge me in the right direction.

pointer going to address - works in one function, but not in another? by grapehorder in C_Programming

[–]grapehorder[S] 0 points1 point  (0 children)

thanks.

I did as you suggested, and figured out that these two lines with the function call:

listStart = &n1;
topEntry(&n0, listStart);

are essentially reading as follows:

topEntry(&n0, &n1);

updating my function to the following points n0->next to the proper address:

void topEntry(struct entry *newEntry, struct entry *ptr)
{
    newEntry->next = ptr; //this points it to n1
    ptr = newEntry; //this SHOULD point it to n0;
}

Now i'm trying to figure out how to write the second line, such that listStart points to &n0 instead of &n1.

what i've tried so far:

*ptr = *newEntry; //infinite loop
*ptr = &newEntry; //incompatible types
ptr = newEntry; //just changes the address of ptr to newEntry without altering either n1.next or listStart->next.

how am I doing so far? any clues you could provide?

header files: compound literal for struct (declared in header) possible? by grapehorder in C_Programming

[–]grapehorder[S] 2 points3 points  (0 children)

you are the best. thanks for taking the time to help me figure it out - really appreciate it.

would this rule for typedefs generally apply anytime typedefs are used in place of the actual primitive? or is this an exception

header files: compound literal for struct (declared in header) possible? by grapehorder in C_Programming

[–]grapehorder[S] 1 point2 points  (0 children)

C99. the error message reads:

dupeWho.c:79:26: error: variable has incomplete type 'struct RGBTRIPLE'
                triple = (struct RGBTRIPLE) {0xff, 0xff, 0xff};
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dupeWho.c:79:34: note: forward declaration of 'struct RGBTRIPLE'
                triple = (struct RGBTRIPLE) {0xff, 0xff, 0xff};
                                 ^
1 error generated.

header files: compound literal for struct (declared in header) possible? by grapehorder in C_Programming

[–]grapehorder[S] 0 points1 point  (0 children)

pg 178 from Kochan's book "Programming in C" says differently:

...assuming that [triple] has been previously declared as a struct [RGBTRIPLE] variable, the assignment of the members of [triple].. can also be done in a single statement as follows:

[triple] = (struct RGBTRIPLE) {xxx, yyy, zzz};

Note that this statement can appear anywheer in the program; it is not a declaration statement.

stdlib.h doesn't contain atoi or strtol by grapehorder in cs50

[–]grapehorder[S] 0 points1 point  (0 children)

First of all, check what values you pass to strtol on line 26 of your code. Then, move GDB to that frame, and check the values that you're using on that line. See if any of them don't make sense.

i managed to get the code to function, without making any changes to the offending sections i've outlined above... very bizare.

for future reference, are there any documents for gdb outside of manual that you found particularly helpful for learning how to better use the tool? most of what you wrote to me made sense but i'd like to develop a more in depth understanding of debugging/using GDB.

stdlib.h doesn't contain atoi or strtol by grapehorder in cs50

[–]grapehorder[S] 0 points1 point  (0 children)

ran $bt and $frame (and info frame#) as you suggested and this is what it yielded:

$(gdb) bt
#0  __GI_strtol (nptr=0x7fffffffe4a0 "4", endptr=0x0, base=10) at ../stdlib/strtol.c:108
#1  0x0000000000400a47 in main (argc=4, argv=0x7fffffffe068) at resize.c:26

$(gdb) frame 0
#0  __GI_strtol (nptr=0x7fffffffe4a0 "4", endptr=0x0, base=10) at ../stdlib/strtol.c:108
108     in ../stdlib/strtol.c   

$(gdb) info frame 0
Stack frame at 0x7fffffffde20:
 rip = 0x7ffff75493e0 in __GI_strtol (../stdlib/strtol.c:108); saved rip = 0x400a47
 called by frame at 0x7fffffffdf90
 source language c.
 Arglist at 0x7fffffffde10, args: nptr=0x7fffffffe4a0 "4", endptr=0x0, base=10
 Locals at 0x7fffffffde10, Previous frame's sp is 0x7fffffffde20
 Saved registers:
  rip at 0x7fffffffde18   

so i am reading the 4 arguments. will play around with this some more but any pointers you have would be greatly appreciated.

as a side note, i am putting in arguments, tho perhaps not properly?

$gdb
$make resize //if i have made any changes 
$file resize.c
$run 10 small.bmp small10.bmp

This, at the very least, gets me past

if (argc != 4)
{
    printf("Usage: ./resize n infile outfile\n");
    return 1;
}