Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,486,614
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-26-24 09:51 AM
Guest: Register | Login

Main - Posts by Cellar Dweller

Pages: 1 2 3 4 5 6 7 8

Cellar Dweller
Posted on 02-20-07 02:16 AM, in Favourite out-to-eat / fast food? Link | Quote | ID: 1468


Snifit
Level: 39

Posts: 1/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
I'm totally hooked on Taco Bell food. When trying to choose a place to get food while in town, I often think to myself "I really need to think of somewhere to eat besides Taco Bell", but go there anyway.

Sometimes I'll go to Subway(Pizza sub), McDonalds(Chicken nuggets, bacon egg and cheese biscuts), Arby's(Roast beef), or rarely somewhere not listed.

Cellar Dweller
Posted on 02-26-07 11:36 PM, in Programming Poll #1: Indent Style Link | Quote | ID: 8046


Snifit
Level: 39

Posts: 2/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
I use the K&R bracing style (aka The One True Bracing Style) with a four space indent. I have my editor configured to use spaces for tabs.

The following is a code sample that I appear to have stopped in the middle of coding some time ago.


int decode_recr(struct decode_state *ds, char *wp)
{
uint64_t cmd;
GBI_MATERAL_NODE *matp;
GBI_TRIANGLE_NODE *trip;
// GBI_VERTEX_NODE *verp[3];
int i;

for (;;) {
if (wp < ds->buf || (wp+8) > ds->buf_end) {
printf("wp has gone out of bounds in decode_recr()\n");
return 0;
}
cmd = rbeu64(wp);
//printf("%02x ", (int)(*wp));
wp+=8;
printf("%08x : %016llx %02x\n", ((int)(wp-ds->buf)), cmd, GBI_EX_CMD(cmd));

switch (GBI_EX_CMD(cmd)) {
case F3D_NOOP:
break;

case F3D_VTX:
if (ds->seg != (exfld64(cmd, 24, 8))) {
printf("vertex reference to other segment\n");
return 0;
} else {
int i;
int j;
char *vwp;
char *vwp_end;

i = exfld64(cmd, 52, 4); /* number of vertices -1 */
j = exfld64(cmd, 48, 4); /* where to load */
if ((i+1)*16 != exfld64(cmd, 32, 16)) {
printf("vertex command not consistant with self\n");
return 0;
}
if (i+j > 0x0f) {
printf("vertex command would overflow vertex cache\n");
return 0;
}
vwp = ds->buf + exfld64(cmd,0,24);
vwp_end = vwp + (i+1)*16;
if (vwp_end > ds->buf_end) {
printf("vertex command points past end of segment\n");
return 0;
}
while (vwp < vwp_end) {
ds->vertex_cache[j].pt[0] = rbes16(vwp);
ds->vertex_cache[j].pt[1] = rbes16(vwp+2);
ds->vertex_cache[j].pt[2] = rbes16(vwp+4);
/*todo: support colors and normals*/
ds->vertex_cache[j].tc[0] = rbes16(vwp+8);
ds->vertex_cache[j].tc[1] = rbes16(vwp+10);
vwp+=16;
j++;
}
}
break;

case F3D_DL:
if (ds->seg != exfld64(cmd, 24, 8)) {
printf("Ignoring external DL at this time.\n");
} else {
if (!(decode_recr(ds, ds->buf+exfld64(cmd, 0, 24)))) {
return 0;
}
}
break;

case F3D_ENDDL:
return 1;

case F3D_TRI1:
/*Search materals until a match is found*/
matp = ds->lg->mat_head;
while (matp && !(ds->curr_mat.is_same_as(matp))) {
matp = matp->next;
}
if (!matp) {
GBI_MATERAL_NODE *matq;

matq = new GBI_MATERAL_NODE;
if (!matq) {
printf("out of memory\n");
return 0;
}

*matq = ds->curr_mat;
matq->next = ds->lg->mat_head;
ds->lg->mat_head = matq;
matp = matq;
}

trip = new GBI_TRIANGLE_NODE;
if (!trip) {
printf("out of memory\n");
return 0;
}

for (i=0; i<3; i++) {
GBI_VERTEX_NODE *srchpat;
/* search vertices until a match is found */
srchpat = &(ds->vertex_cache[exfld64(cmd, 8*(2-i), 8)/10]);
trip->v[i] = ds->lg->vertex_head;
while (trip->v[i] && !(srchpat->is_same_as(trip->v[i]))) {
trip->v[i] = trip->v[i]->next;
}
/* if no matching vertex is found, create a new one */
if (!trip->v[i]) {
GBI_VERTEX_NODE *nvn;

nvn = new GBI_VERTEX_NODE;
if (!nvn) {
printf("out of memory\n");
}
*nvn = *srchpat;
nvn->next = ds->lg->vertex_head;
ds->lg->vertex_head = nvn;
trip->v[i] = nvn;
}
}
/* triangle complete! join the other triangles! */
trip->next = matp->triangles;
matp->triangles = trip;
break; /*phew!*/

case RDP_RDPLOADSYNC:
break;

case RDP_SETTILE:


case RDP_SETTIMG: /* 0xfd - 11111101 fffss... ....wwww wwwwwwww pppppppp pppppppp pppppppp pppppppp*/
ds->curr_mat.tex.img.pixelformat = exfld64(cmd, 53, 3);
ds->curr_mat.tex.img.pixelsize = exfld64(cmd, 51, 2);
ds->curr_mat.tex.img.width = exfld64(cmd, 32, 12);
ds->curr_mat.tex.img.segptr = exfld64(cmd, 0, 32);
ds->curr_mat.tex.img_defined = 1;
break;

default:
printf("unknown GBI command %x\n", (int)(GBI_EX_CMD(cmd)));
}
}
}


Cellar Dweller
Posted on 02-27-07 04:16 AM, in Candy Link | Quote | ID: 8201


Snifit
Level: 39

Posts: 3/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
Except for Paday bars, I haven't been eating much candy lately.

After Easter, I think I'll try to get a bunch of hollow chocolate eggs on clearance and a jar of peanut butter. Mmmmm...

Fun Smarties related story: My brother saw a classmate(high school IIRC) crush one or more Smarties in class with a textbook and snort the resulting powder.

Cellar Dweller
Posted on 02-27-07 09:40 PM, in Double Posting Link | Quote | ID: 8470


Snifit
Level: 39

Posts: 4/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
Considering that this board is supposed to be better coded, I'm surprised that the string subscrips are not quoted.

Cellar Dweller
Posted on 02-27-07 10:11 PM, in no edit post feature... Link | Quote | ID: 8492


Snifit
Level: 39

Posts: 5/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
I strongly suggest that edits be logged to a table. One reason is that edit times could be time zone corrected and the names of the editors would update with name changes. The other reason is so that old versions of the post text could retained. Access to the old versions could be limited to the poster and staff. If a recent enough version of MySQL is used, a single DB query could be used to get all of the edits on the current page, and then the PHP script would match the the edits to the correct post.

Cellar Dweller
Posted on 02-27-07 10:45 PM, in no edit post feature... Link | Quote | ID: 8507


Snifit
Level: 39

Posts: 6/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
It would prevent people from posting abusive content and then changing it before a staff member sees it, and if someone reports abusive content the staff can fully review the allegation. Also it would prevent data loss if a staff member goes on a power trip or thier password is compromised.

Cellar Dweller
Posted on 02-27-07 11:05 PM, in how come none of the original acmlmboard code was used here? Link | Quote | ID: 8523


Snifit
Level: 39

Posts: 7/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
There is a very good reason not to rely on direct DB access to perform admin functions. There was an event that happened a couple months before I first registered that involved a slip of the fingers and a large number of accounts being deleted as a result.

As a matter of policy, I don't think accounts should ever be deleted. Posts should never be allowed to be deleted by anyone except by the poster, if at all. Abusive content should only edited out (or hidden), and the edit logged.

Also, why do admin functions need to be in a "panel"? All user specific functions could be accessed from profiles and all global functions could be linked in the page header.

Cellar Dweller
Posted on 02-27-07 11:28 PM, in no edit post feature... Link | Quote | ID: 8533


Snifit
Level: 39

Posts: 8/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
Posted by Stifu
On the other hand, it would take up a fair load of database space, making backups bigger, etc... *shrugs*


I don't think it would take up that much space, as most posts are never edited. And real smart admins compress backups before moving them off the server anyway.

The only potential problem I see is that the record size of the edit table might be sort of large, causing slowdowns. The old text of the edits could be put in thier own table like posts are now. Also, there are some database servers that automatically move large variable size text coulmns to thier own table while continuing to present them as part of the original table (PostgreSQL does, I don't know if MySQL can).

Cellar Dweller
Posted on 02-27-07 11:45 PM, in how come none of the original acmlmboard code was used here? Link | Quote | ID: 8542


Snifit
Level: 39

Posts: 9/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
Point taken, but I think many of those could be spread out whether they are in a panel or not. eg. Photo album managment linked from the photo album, IP bans initiated from ipsearch or online users, etc..

Cellar Dweller
Posted on 02-27-07 11:55 PM, in Programming Poll #1: Indent Style Link | Quote | ID: 8552


Snifit
Level: 39

Posts: 10/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
I used <pre>, but first I replaced every newline with a <br> tag. When the board adds the <br> tags, it leaves the newlines in place, causing <pre> to double space the text. Actually, it might just be converting half of a CRLF to a <br> tag and leaving the other half.

Cellar Dweller
Posted on 03-09-07 03:25 AM, in here's how to stop newlines from doubling in pre tags Link | Quote | ID: 12466


Snifit
Level: 39

Posts: 11/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
I second blackhole98's suggestion. In fact, if he had not suggested it, I would have suggested it myself.

How would that break anything?

Cellar Dweller
Posted on 03-10-07 05:00 AM, in Quick login box? Link | Quote | ID: 13136


Snifit
Level: 39

Posts: 12/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
I don't have much use for either. Loading the login page is insignificant because I stay logged in, and my password is so cryptic and new that I have to look it up to log in. I tend to think over my posts, so loading the new reply page is insignificant.

Anyway, something I wanted to point out was that the time at the bottom of the page has little to do with the actual time between clicking a link and the page being loaded. Before the timer starts, there is overhead in establashing the TCP connection, sending the request, and loading the PHP scripts(or locating them in the server's cache). After the timer stops there is buffered output that still needs to be sent over the network and rendered by the user's browser. For example, the timer at the bottom says that it took 0.050 seconds to render this page, but I counted almost seven seconds between clicking the new reply link and the reply form appearing on the screen.

Cellar Dweller
Posted on 03-10-07 05:32 AM, in Just a reminder. Link | Quote | ID: 13181


Snifit
Level: 39

Posts: 13/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
Posted by Peardian
Personally, I think DST wastes more energy than it saves.

...somehow.


Yesterday there was an interview on NPR with a guy that wrote a book about daylight savings time. He explained that while extra daylight will let people leave thier lights off longer, people will take advantage of the extra daylight to get in thier cars and go to town. For that reason, much of the push for DST over its lifetime has been retailers who want people to shop more at the end of the day. Even the confectionary industry wanted DST to be extended beyond October 31st so kids could collect more candy on Halloween and drive candy sales.

Cellar Dweller
Posted on 03-16-07 06:44 AM, in Programming Poll #5: { } Link | Quote | ID: 15664


Snifit
Level: 39

Posts: 14/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
1. Curly braces, as others have stated.

2. My code is 1TBS compliant.

3. I generally use braces even if one one line is in the block. This is a habit that solidified during my brief experience with Perl, in which the braces are manditory.

If anyone wants to see some of my code, I have already posted a code sample in another thread.

Posted by Kernal
So, to you people who use K&R style, why don't you also put the closing curly bracket at the end of the last line of the block?


In my case, I don't line up brace to brace, I line up the ending brace to the control construct that precedes the block of code.

Cellar Dweller
Posted on 03-25-07 06:22 AM, in A suggestion for profiles (rev. 4 of 03-25-07 08:57 AM) Link | Quote | ID: 18955


Snifit
Level: 39

Posts: 15/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
We could allow for many types of contact information without cluttering up the profile pages, the edit profile/edit user pages, or the users table. There could be a table for contact classes and a table for contacts. The contact class table would have columns for the name of the type of contact (eg. website, email, etc), a template for displying the contact to be processed through a text replacement (eg. '<a href="$CONTACT_STRING_SAFE$">$CONTACT_STRING_SAFE$<a>' for a website), some instructions for users adding contacts, and perhaps additional stuff. The contacts table would have columns for the user id the contact belongs to, the class id of the contact, the contact content, an access level(eg. everyone, regestered users, registered users not banned, or staff only), and perhaps additional stuff.

For example, to display the contact in profiles something like this could be done(edit to adapt):

if ($log) {
if ($isstaff || $loguserid==$uid) {
$level = 3;
} else if ($isbanned) {
$level = 1;
} else {
$level = 2;
} else {
$level = 0;
}
$contacts = mysql_query("SELECT contact_type, template, content FROM contacts, contact_classes WHERE contacts.ccid = contact_classes.id AND uid=$uid AND level>=$level ORDER BY contact_classes.id, contact.id");
$curr_contact_type = "";
while ($contactrow = mysql_fetch_array($contacts)) {
$tmplex=explode('$', $contactrow['template']);
$n = count($tmplex);
for ($i = 1; $i < $n; $i += 2) {
switch ($tmplex[$i]) {
case "CONTACT_STRING_BARE":
$tmplex[$i] = $contactrow['content'];
break;
case "CONTACT_STRING_SAFE":
$tmplex[$i] = htmlspecialchars($contactrow['content']);
break;
}
}
if ($curr_contact_type == $contactrow['contact_type']) {
$accumulated_contacts .= "<br/>".implode("", $tmplex);
} else {
if ($curr_contact_type) {
/* TODO
* display a row in the profile with
* $curr_contact_type on the left and
* $accumulated_contacts on the right
*/
}
$accumulated_contacts = implode("", $tmplex);
$curr_contact_type = $contactrow['contact_type'];
}
}
if ($curr_contact_type) {
/* TODO
* display a row in the profile with
* $curr_contact_type on the left and
* $accumulated_contacts on the right
*/
}


EDIT: fixed a bug in the example code

Cellar Dweller
Posted on 03-27-07 09:57 PM, in Looking for a little advice on working with headers in C++ (rev. 2 of 03-28-07 12:06 AM) Link | Quote | ID: 20004


Snifit
Level: 39

Posts: 16/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
The standard way of dealing with this problem is to put a guard ifdef/define around the contents of each header file. For example:

astuff.h
#ifdef _ASTUFF_H_
#define _ASTUFF_H_

#include "bstuff.h"

class aclass {
bclass *b;
void some_method();
};

#endif /* _ASTUF_H_ */


bstuff.h
#ifdef _BSTUFF_H_#define _BSTUFF_H_

#include "astuff.h"

class bclass {
aclass *a;
void some_other_method();
};

#endif /* _BSTUF_H_ */



The ifdefs/defines prevent infinite recursion, yet all of the needed declarations are provided.

Cellar Dweller
Posted on 04-05-07 06:15 PM, in Seeing through solid objects in OpenGL Link | Quote | ID: 23682


Snifit
Level: 39

Posts: 17/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
Are you making sure to draw the alpha blended objects last? It looks like you are drawing the alpha blended object before drawing the wall. This causes the depth buffer to be set at the depth of the alpha blended object, and then the wall fails the depth test and is not shown.

Cellar Dweller
Posted on 04-06-07 05:21 PM, in Seeing through solid objects in OpenGL Link | Quote | ID: 24067


Snifit
Level: 39

Posts: 18/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
Multiple alpha blended objects will show up correctly if they are drawn back to front. I don't think its worth the trouble to do that for a N64 game viewer/editor, as alpha blended objects seem to be used sparingly, and the N64 has the same alpha blending limitation.

This is all because after an alpha blended object is drawn, the renderer doesn't have enough information to blend another object in behind it.

Cellar Dweller
Posted on 04-09-07 03:42 AM, in Attachments from the archives broken Link | Quote | ID: 24971


Snifit
Level: 39

Posts: 19/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
It might help to specify which files are broken. Also, have you tried the archive on ||bass's server?

Cellar Dweller
Posted on 04-09-07 04:20 AM, in Attachments from the archives broken Link | Quote | ID: 24989


Snifit
Level: 39

Posts: 20/287
EXP: 385185
Next: 19586

Since: 02-19-07
From: Arkansas

Last post: 4052 days
Last view: 3219 days
I visited some random pages in the archive3 screenshot thread, and tried the first three attachments I could find. I tried two pictures and an IPS patch. All of them loaded normally.
Pages: 1 2 3 4 5 6 7 8


Main - Posts by Cellar Dweller

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.232 seconds. (335KB of memory used)
MySQL - queries: 139, rows: 171/171, time: 0.222 seconds.