1,260 karma · joined Nov 2, 2009 (17y ago) · 479 submissions
comment 16y ago · link · parent
In my opinion, working without a reset of some kind is quite similar to writing C++ classes where data members are not initialized to meaningful values... you just can't trust what you'll end up with.
comment 16y ago · link · parent
comment 16y ago · link · parent
var loc = window.location.href.split('?')[1].split('#')[0].split('&');
var qs = {};
$jq.each(loc, function(ix, el) {
var m = el.split('='), k = m[0], v = m[1];
qs[k] = v;
});
var args = {
pid: qs.pid, // photo ID
id: qs.id, // photo owner ID
subject: Env.user, // user ID to remove
name: '', // not checked
action: 'remove',
__a: 1,
fb_dtsg: Env.fb_dtsg,
post_form_id: Env.post_form_id,
post_form_id_source: 'AsyncRequest'
};
$jq.post('/ajax/photo_tagging_ajax.php', args);
It seems to me that now it should be easy to adapt this to work on the "photos of me" page if you don't mind reloading it after each removal - $jq('a.UIPhotoGrid_PhotoLink:first'); should find the first link to a photo, and you can tokenize it instead of window.location.href on the first line.comment 16y ago · link · parent
var loc = window.location.href.match(/pid=(\d+)&id=(\d+)/);
var args = {
pid: loc[1], // photo ID
id: loc[2], // request sender id? photo owner id? not sure, haven't tested, but my user ID worked when trying to remove someone from a photo in my album
subject: loc[2], // user ID to remove
name: '', // not checked
action: 'remove',
__a: 1,
fb_dtsg: $jq('input[name="fb_dtsg"]').val(),
post_form_id: $jq('#post_form_id').val(),
post_form_id_source: 'AsyncRequest'
};
$jq.post('/ajax/photo_tagging_ajax.php', args);
It doesn't update the UI. The fb_dtsg and post_form_id are required and seem to be anti-CSRF tokens. Haven't experimented enough to know if they can be reused multiple times.comment 16y ago · link · parent
See, EA is not all bad. :-)
comment 16y ago · link · parent
comment 16y ago · link · parent
comment 16y ago · link · parent
At a quick glance, I'd say ErrantX is correct.
comment 16y ago · link · parent
comment 16y ago · link · parent
I just bought one of these http://www.amazon.co.uk/gp/product/B001E03444/ and swap out the drives as I need them. + two Fractal 120mm fans (incredibly quiet yet powerful, highly recommended) from the sides to keep the heat away. I chose that instead of building a similar frame, since a frame for 25 drives (that's what I have :-) ) would need some serious additional cooling and power, whereas the swapping solution doesn't.
comment 16y ago · link · parent
In line with what was mentioned below, VC6 used a series of lea to seek (a*x+b)th byte in a structure whereas VC2010 just uses a single multiply.
And something I was surprised by, VC6 always used fnstsw ax; test ax, 40h; jz $+16; to compare floating point values. VC2010 uses jp instead, I'd presume for a good reason as well.
Anecdote: One time and one time only I witnessed GCC write more "clever" code than MSVC, though I haven't benchmarked this:
switch(val) {
case 1:
case 2:
case 6:
case 15:
return foo;
default:
return bar;
}
Both compilers returned > 15 normally, but optimized differently: MSVC compiled this into a normal two-step jumptable mov eax, table1[dl] // assuming dl contains val, table1 contains either 1 for bar or 0 for foo
jmp table2[al] // contains addresses of two branches
GCC did the equivalent of this: return ((1 << val) & ((1 << 1) | (1 << 2) | (1 << 6) | (1 << 15)))
? foo
: bar
;comment 16y ago · link · parent
If you develop a desktop app on your company's time, your boss will find a million more important things to do than to make sure keyboard accelerators work, make sense, or are configurable. If you do it on your own, you will probably find a different million of things to improve, like the main number crunching loop. After all, you're coding it primarily for yourself so why do you care what Alt-W or Ctrl-U do in your app, you use the mouse. Maybe if you publish it, you'll get some feedback from users and you fix it, but it's more likely that they'll just decide it's "no more limited than that other tool" and you'll never know that it is a problem for them.
Not to mention there are varied GUI toolkits available depending on the programming language you use, each with its own style - Borland's VCL, especially with its button graphics which stand out to this day; MFC; wxWidgets... each with their own idea of how things should be handled. And there's OwnerDraw, giving the more "hardcore" coders another chance to shoot themselves in the foot by allowing the application to draw the control as it saw fit, which of course means they cannot take advantage of the new Windows common controls themes.
comment 16y ago · link · parent
Derived() : Base() {
THISCALL(0x535AA0);
*(DWORD*)this = 0x7E1AF4;
}
That's the kind of code I get to write in my hobby project.comment 16y ago · link · parent
comment 16y ago · link · parent
comment 16y ago · link · parent
I get a lot of bitching and negative outside feedback in my project too, including some very uninformed and unreasonable comments, boiling down to "$past_competitor released much more often than you do" and ignoring the fact that their releases were much buggier and less polished. I am not sure what I can do to reduce the amount of complaints like that...
comment 16y ago · link · parent
I am not that familiar with GitHub, so I can't give you specific instructions or examples, but the project I'm working on uses Mantis for this, and it works a treat - we integrated it with SVN and now svn commits create new Product Versions, revision commit messages are automatically posted as issue comments + issues get marked as "resolved" if applicable, changelogs for latest changes, roadmaps for future plans, etc.
comment 16y ago · link · parent
When I inherited this project, it was relying on (cast)s and macros all around and this led me to some nasty traps, I switched to building a lot of templates, they've so far proven invaluable in saving debugging time, enforcing type safety, and communicating expected data types to other developers. Templates are good. And macros are traps, but everyone already knew that.
Granted, the project is a niche, I don't think there are many similar projects out there, so not sure how useful my knowledge of the object model is. I'm reversing/extending a C++ game with no source, btw. DLL injection and all that goodness.
comment 17y ago · link · parent
When publishers/developers don't give a bleep, the fans take up the task of fixing the bugs themselves. I happen to run one such project in my spare time (for C&C: Red Alert 2), and it's amazing how much stuff is broken. It's not as "serious" as other projects mentioned here, but still a reason to know ASM. (And a good way to see bad programming practices in action :) )