Update 2024-03-27: Greatly expanded the "Samples" page and renamed it to "Glossary".
Update 2024-04-04: Added 5 million mid-2011 posts from the k47 post dump. Browse (mostly) them here.
Update 2024-04-07: Added ~400 October 2003 posts from 4chan.net. Browse them here.

Welcome to Oldfriend Archive, the official 4chan archive of the NSA. Hosting ~170M text-only 2003-2014 4chan posts (mostly 2006-2008).

Threads by latest replies - Page 11

[1394235810] Where should I start Game Dev now?

No.957209 View ViewReplyLast 50OriginalReport
So, I have CS degree, MMO dev experience in a native language (think WoW and its scripting language (LUA?), except standalone,) and a lot of 2D games developed in C# XNA.

I want to move to C++ but I'm not sure where to start. At the moment I'm looking at GameDev.net.
53 posts omitted

[1395482647] Reals

No.958166 View ViewReplyOriginalReport
Why do so many languages include the type of "real" numbers if real numbers are physically impossible to represent in any computer? There are no and will never be realnums in any computer, stop deluding yourselves.
12 posts omitted

[1395641744] please

No.958280 View ViewReplyOriginalReport
teach me bayesian networks<i>!</i>
5 posts omitted

[1395715096] Why distinguish symbols and strings?

No.958340 View ViewReplyOriginalReport
Lisps have a special data type called a "symbol." If you compare two symbols with the same name against each other with eq? the result is guaranteed to be true. This is apparently not the case with strings, at least in Scheme; two identical strings are not guaranteed to be eq?/be located in the same memory location.

Most of the more modern dynamic languages, however, use "interned" immutable strings, such that any two identical strings are guaranteed to be stored in the same memory location and thus be (the language's equivalent of) eq?.

Given this development, what is the purpose of differentiating between strings and symbols in a modern programming language? Lua programs, for instance, get by just fine using its immutable strings in much the same way that a Scheme user would use symbols. Are they practically the same thing, just stored in a different namespace, as Common Lisp stores variables and functions in separate namespaces? Is this just some historical cruft that Scheme accumulated from a time when interning immutable strings was not practical, or is there some real benefit that comes from distinguishing between the two?

[1395506044] C++: Move a character around on the screen?

No.958186 View ViewReplyOriginalReport
You know how in Roguelike games, your character might be a "@" and you can move it around the screen in by using the directional keys or clicking? How can I do that in a simple Win32 console program?

I'm not looking to have the code written for me. I just need someone to point me in the right direction.
9 posts omitted

[1395045465] Programming Drugs

No.957885 View ViewReplyOriginalReport
I want to score some amphetamines from one of the Tor market place

Prescription pills are outrageously overpriced so I'm actually looking at some ``street speed''.

Any recommendation? Where do you buy your programming drugs, /prog/?
18 posts omitted

[1395255322] corona sdk programming

No.958034 View ViewReplyOriginalReport
Please I need some expert's help in checking/modifying the codes below so they work! For now the problem is when ball hits the balloons, the balloons won't disappear. The cannonball hits it and disappears.

function scene:createScene(event)
 local group = self.view
 
background = display.newImage( "bkg_clouds.png")
group:insert(background)
background.x = 230
background.y = 195
 
scoreText = display.newText( "0", 0, 0, native.systemFont, 32 )
scoreText:setFillColor( 0,0, 0 )
scoreText.x = 87
scoreText.y = 28
group:insert( scoreText )

questionText = display.newText('a', display.contentCenterX, display.contentWidth/4, native.systemFont, 40)
group:insert(questionText)

infoBar = display.newImage ("infoBar.png")
group:insert(infoBar)
infoBar.x = 10
infoBar.y = 25
 
restartBtn = display.newImage ("restartBtn.png")
group:insert(restartBtn)
restartBtn.x = 470
restartBtn.y = 300
 
cannon = display.newImage ("cannon.png")
group:insert(cannon)
cannon.x = 10
cannon.y = 270
 
cannon.anchorX = 0.5
cannon.anchorY = 0.5
restartBtn.isVisible = true

         local balloon = display.newImage ('balloon_fat_red.png', 495, 125)
         group:insert(balloon)
         balloon = display.newImage ('balloon_fat_red.png', 495, 175)
         group:insert(balloon)
         balloon = display.newImage ('balloon_fat_red.png', 495, 225)
         group:insert(balloon)
        
         local balloonText1 = display.newText('\227\129\130', 495, 125)
         balloonText1:setFillColor( 1,1, 0 )
         local balloonText2 = display.newText('\227\129\132', 495, 170)
         balloonText2:setFillColor( 1,1, 0 )
         local balloonText3 = display.newText('\227\129\134', 495, 225)
         balloonText3:setFillColor( 1,1, 0 )
        
         balloon.name = 'balloon'
         physics.addBody(balloon)
         balloon.bodyType = 'static'
         table.insert(balloons, balloon)        
       
         group:insert(balloonText1)
         group:insert(balloonText2)
         group:insert(balloonText3)



function ballCollision(e)
   if (e.other.name == 'balloon') then
            scene.updateScore()
            e.target:removeSelf()
            print ('remove balloon text')
            e.other:removeSelf()
            audio.play(pop)
        end
    end
   
function cannonCharge:touch(e)
  if(e.phase == 'began') then
        impulse = 0
        cannon.isVisible = true
        Runtime:addEventListener('enterFrame', charge)
    end
end
function charge()

local degreesPerFrame = 0.5
cannon.rotation = cannon.rotation - degreesPerFrame
     impulse=impulse-0.2
    
     if(cannon.rotation < -46) then
          cannon.rotation = -46
          impulse = -3.2
        end
end
function shot:touch(e)
    if(e.phase == 'ended') then
    
        Runtime:removeEventListener('enterFrame', charge)
        cannon.isVisible = true
        cannon.rotation = 0
       
        cannonBall = display.newImage('cannon ball.png', 84, 220)
        physics.addBody(cannonBall, {density = 1, friction = 0, bounce = 0})
        group:insert(cannonBall)
    
-- Shoot cannon ball
cannonBall:applyLinearImpulse(3, impulse, cannonBall.x, cannonBall.y )

--Collision listener
cannonBall:addEventListener ('collision', ballCollision)
   
    end
end


end
5 posts omitted

[1105741677] I was bored

No.287 View ViewReplyOriginalReport
...so I wrote something that I won't understand five bits of in 5 years.
See if you can understand what it does without compiling it. It's valid C++, except for the __int64 type, which is Microsoft-specific (replace with whatever your compiler uses).

Have fun.

#include <iostream>
using namespace std;
typedef __int64 pszint; /* FOR 64-BIT POINTERS */
typedef unsigned __int64 uint64;
typedef const char* charptr;

template<typename T> inline void For( T val, const T& end, T (*inc)( const T& ), void (*proc)( const T& ) ) { if( val < end ) { proc( val ); For( inc( val ), end, inc, proc ); } }
template<typename T> inline T If( bool cond, T (*proc)(), T (*eproc)() ) { return ( cond ? proc() : eproc() ); }
template<typename T, typename Q> inline Q Comp( T (*one)(), Q (*two)( const T& ) ) { return two( one() ); }
//template<typename T> inline pszint TypeId() { static T tag; return (pszint) &tag; }

void NullProc() {}
int IncrementInt( const int& i ) { return i + 1; }
uint64 GetValue() { return 36762444129608; /* BIG-ENDIAN */ }
charptr ToString( const uint64& str ) { static uint64 temp; temp = str; return (charptr) &temp; }
charptr GetString() { return Comp<uint64, charptr>( GetValue, ToString ); }
void PrintAndPause( const charptr& str ) { cout << str; getchar(); }
void InnerProc() { Comp<charptr, void>( GetString, PrintAndPause ); }
void Body( const int &i ) { If<void>( i <= 5, InnerProc, NullProc ); }
int main() { For<int>( 1, 10, IncrementInt, Body ); }
23 posts omitted