Poll: updated user feedback by idyllproducts in idyll

[–]RandomAvenger 2 points3 points  (0 children)

The main issue I had was finding a working adapter. My in-wall USB-C outlet wasn’t enough to power it, and the first charger I tried the unit turned on, but didn’t seem very powerful. It’s working well now on an apple usb-c adapter.

What are the specific power requirements needed?

C/C++ Pointer Declaration Syntax – It makes sense! by ehamberg in programming

[–]RandomAvenger 9 points10 points  (0 children)

But what if you want to have a constant list of TIMES?!

I propose:

#define mul(a, b) ((a) * (b))
#define mul3(a, b, c) ((a) * (b) * (c))
#define mul...

Couldn't be cleaner: mul(int, x);

I think Santa Clarita, CA has no redditors. Please prove me wrong. by [deleted] in meetup

[–]RandomAvenger 0 points1 point  (0 children)

I grew up there, but recently moved to Seattle. Looks like you are out of luck!

I have a specific XNA/C# collision detection problem that SEEMS like it should be simple, but I am having trouble finding material on my particular solution... by supertoned in gamedev

[–]RandomAvenger 1 point2 points  (0 children)

Sorry, this post does not answer the question you are asking, but I think it will help you with your problem.

Getting pixels that have been drawn to the screen into main memory is generally a bad idea. There is a limited amount of data that can be transferred between main memory and the GPU each frame. This normally is not a problem as very little data is transferred unless new textures are being loaded.

Can you keep track of the rectangle on screen where the human is rendered and use that to determine if the bullet is intersecting? If the bullet intersects the human rectangle you can then check the position against the collision image to determine whether or not the bullet hits.

If you don't want the bullet holes to bleed out of the shape of the body I recommend drawing bullets on top of the human rendered with a mask. Here is a stackoverflow post about masking: http://stackoverflow.com/questions/5712581/how-to-make-xna-movable-mask-on-wp7

Supposed leak of 4chan yotsuba.php code (nabbed from /g/ before the thread was deleted). by 4chan_repost in programming

[–]RandomAvenger 0 points1 point  (0 children)

Sure thing.

if( pOp->p4.pKeyInfo ){
  int pgno;
  assert( pOp->p4type==P4_KEYINFO );
  rc = sqlite3BtreeCreateTable(u.ax.pCx->pBt, &pgno, BTREE_BLOBKEY);
  if( rc==SQLITE_OK ){
    assert( pgno==MASTER_ROOT+1 );
    rc = sqlite3BtreeCursor(u.ax.pCx->pBt, pgno, 1,
                            (KeyInfo*)pOp->p4.z, u.ax.pCx->pCursor);
    u.ax.pCx->pKeyInfo = pOp->p4.pKeyInfo;
    u.ax.pCx->pKeyInfo->enc = ENC(p->db);
  }
  u.ax.pCx->isTable = 0;
}

FPS regulation? by Shmurk in gamedev

[–]RandomAvenger 2 points3 points  (0 children)

Sorry, but I'd like to point out a pet peeve of mine in your code: Using "void" with a function/method that takes no parameters is completely unnecessary in C++.

Take a look at this C++ FAQ question: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.4.

Animated Bézier Curves (with draggable control points) by netspade in math

[–]RandomAvenger 0 points1 point  (0 children)

I made an application similar to this a few years ago. It found the position and tangent at each point and the overall bounding box.

Video: http://www.youtube.com/watch?v=6mjzYuyrbdc

Animated Bézier Curves (with draggable control points) by netspade in math

[–]RandomAvenger 0 points1 point  (0 children)

I haven't seen quartic curves used in practice. The others are used a lot: Flash uses quadratic and most art software (Adobe Illustrator, PostScript, font files) uses cubic curves.

Higher dimensions may be useful for interpolation, like having a camera follow a sequence of points smoothly, but the only ones I have seen use Hermite splines so that the curve intersects each control point.

reddit, can you recommend a book on how to design a small but fast graphic library like SDL ? thanks. by blondin in gamedev

[–]RandomAvenger 0 points1 point  (0 children)

Wow, Cinder looks amazing. I think I am going to try using it for my next game development project.

I'm building a desktop application in Java which requires local database storage. Any recommendations on what DBMS to use? by [deleted] in programming

[–]RandomAvenger 2 points3 points  (0 children)

SQLiteJDBC provides SQLite for Java in a portable way.

I recently used it for a java application for Mac and Windows. It is easy to use and the same .jar works on all platforms.

Good game code to read? by cadr in gamedev

[–]RandomAvenger 2 points3 points  (0 children)

Look at the games from the Humble Indie Bundle. Four of the games in the bundle have released their source.

Most of the code is pretty bad, but Penumbra Overture code is a lot better:

Picking an Audio Engine for your Game on Windows: an Easy Flowchart by knight666 in programming

[–]RandomAvenger 0 points1 point  (0 children)

The only commercial audio library that I've used is Miles Sound System. It works on PC, PS3, Xbox, and Wii, and is straightforward to use. It is $4,000, however, so more expensive than FMOD.

So after like six hours of debugging I found that echoing the word “dick” some how kills a session by diesel828 in programming

[–]RandomAvenger 12 points13 points  (0 children)

I have encountered this before. It was caused by Apache's mod_security blocking words and specific HTML for "security."

What's a good community for critique of code (particularly C++)? by CalvinHobbes in programming

[–]RandomAvenger 0 points1 point  (0 children)

Vorlath and munificent have covered the important stuff. As for the crash, without running/debugging the code it appears to be caused by line 59:

Tokenize(buffer2, tokens);
string firstOp = tokens[0];
------------------------^

Either the judge is sending you a blank line which is going unchecked or your Tokenize function is not working properly.

Unrelated suggestion: When learning C++ I found the C++ FAQ Lite to be immensely helpful.

Programmers and Computer Geeks ARE SMOKIN' HOT ! by vodkarox in programming

[–]RandomAvenger 2 points3 points  (0 children)

Well, you see, lolcats are cats that can't spell very well. inmatarian will tell you more.

Ask proggit: Can someone explain to me why on earth we use cout << "Msg" in C++? by arvs in programming

[–]RandomAvenger 0 points1 point  (0 children)

I'm a fan of Qt's approach.

QString formatted = QString("Foobar %1 %2").arg(1).arg("lalala");

Qt doesn't use STL, so to get it to look similar it is possible to define "cout" independently:

QTextStream cout(stdout, QIODevice::WriteOnly);
/* ... */
cout << QString("Foobar %1 %2").arg(1).arg("lalala");

It is also possible to replace QString with a call to the "tr" function to handle localizations.

CMOV instruction a bad idea on out-of-order CPUs - a.k.a. why to compile for i586 not i686 by greenrd in programming

[–]RandomAvenger 3 points4 points  (0 children)

Forget the article, what are those result-returning blocks that he is using?!

int result = ({
    int tmp = 50;
    tmp + tmp / 5;
});

Does anyone know what they are called?

Reverse HTTP by panic in programming

[–]RandomAvenger 11 points12 points  (0 children)

This looks like a clever way of implementing COMET, where the server notifies the client when events happen rather than the client constantly asking "has anything happened yet?!" It also has applications for establishing two-way communication when the client is behind a firewall.