Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Post code

Name: Anonymous 2011-10-06 9:06

Any code you work with right now, and we'll criticize it(or not).

Name: Anonymous 2011-10-06 9:14

print ("print");

Name: Anonymous 2011-10-06 9:14

#define ngetext(string) strrchr(string,'.')
#define getext(string) ngetext(string)?ngetext(string):".???"
#define pos1(pos1_int1) (1<<(pos1_int1))
#define getbit(getbit_int,getbit_pos)    ((getbit_int&(pos1(getbit_pos)))>>getbit_pos)
#define bitchar(bitchar_bit)    (48|bitchar_bit)
#define getbitc(getbitc_int,getbitc_pos)  bitchar(getbit(getbitc_int,getbitc_pos))
#define digit2_byte(digit2_dig) ((digit2_dig)&0xF)
#define ten_e(ten_ex) (u8)(pow(10,ten_ex))
#define dec2byte(array_dec,dec_amult)  ((digit2_byte(array_dec))*ten_e(dec_amult))
#define deccar(deccar_str,deccar_ind,deccar_mul) dec2byte(deccar_str[deccar_ind+deccar_mul],deccar_mul)
#define declsum(declo18_str,declo18_ind) (deccar(declo18_str,declo18_ind,0)+deccar(declo18_str,declo18_ind,1)+deccar(declo18_str,declo18_ind,2)+deccar(declo18_str,declo18_ind,3)+deccar(declo18_str,declo18_ind,4)+deccar(declo18_str,declo18_ind,5)+deccar(declo18_str,declo18_ind,6)+deccar(declo18_str,declo18_ind,7)+deccar(declo18_str,declo18_ind,8)+deccar(declo18_str,declo18_ind,9)+deccar(declo18_str,declo18_ind,10)+deccar(declo18_str,declo18_ind,11)+deccar(declo18_str,declo18_ind,12)+deccar(declo18_str,declo18_ind,13)+deccar(declo18_str,declo18_ind,14)+deccar(declo18_str,declo18_ind,15)+deccar(declo18_str,declo18_ind,16)+deccar(declo18_str,declo18_ind,17))
//.dec2byte((dec2quads_String)[(dec2quads_Istart)+0],0)
//10*((dec2quads_String)[(dec2quads_Istart)+1]-48)
/* get
a^-1 = 1/a;     (-1)*a = -a.
    a^{m + n} = a^m * a^n
    a^{m - n} ={a^m}/{a^n}
    (a^m)^n = a^{m* n}
    (a * b)^n = a^n * b^n
*/
#define dec2quads(dec2quads_String,dec2quads_Slen,dec2quads_Retq,dec2quads_Istart) ;u8* (dec2quads_Retq)=malloc((((dec2quads_Slen)/18)+1)*8);for((dec2quads_Istart)=0;(dec2quads_Istart)<(dec2quads_Slen);(dec2quads_Istart)+=18){(dec2quads_Retq)[(dec2quads_Istart)/18]=declsum(dec2quads_Retq,dec2quads_Istart);}
// s/18 dec=x+1 8 bytes
char* merge(char* str1,const char* str2){
char* res=malloc(strlen(str1)+strlen(str2)+1);
strcpy(res,str1);strcpy(res+strlen(str1),str2);return res;}
s8 stoquad(char* str){s8 res;sscanf(str,"%lli",&res);return res;}
u8 stouquad (char* str){u8 res;sscanf(str,"%llu",&res);return res;}
//char* slice(char* str,u8 len){}
u1* bytetodec(u1* str,u4 srclen){
  /*SLow&horrible conversion of byte into decimal compatible arrays 000*/
u1* res=malloc(3*(srclen+1));
u4 i;for(i=0;i<srclen;i++){
if(str[i]<10){//decode:first byte from end by3 byte groups.
res[i*3]='1';
res[(i*3)+1]='0';
res[(i*3)+2]=str[i]+48;continue;}
if(str[i]<100){res[i*3]='1';
res[(i*3)+1]=(str[i]/10)+48;//num+48
res[(i*3)+2]=(str[i]%10)+48;continue;}
if(str[i]<200){res[i*3]='2';
res[(i*3)+1]=((str[i]-100)/10)+48;
res[(i*3)+2]=(str[i]%10)+48;continue;}
res[i*3]='3';
res[(i*3)+1]=((str[i]-200)/10)+48;
res[(i*3)+2]=(str[i]%10)+48;
;}
;
return res;
}


u1* dectobyte(u1* dec,u8 size){
u8 outsize=size/3;
u1* res=malloc(size/3);
for(u4 i=0;i<outsize;i++){
res[i]=((dec[i*3]-49)*100)+((dec[(i*3)+1]-48)*10)+(dec[(i*3)+2]-48);};
return res;}
//#define bbits(b)  (b&0x80?'1':'0')##(byte & 0x40 ? 1 : 0)##(byte & 0x20 ? 1 : 0)##(byte & 0x10 ? 1 : 0)##(byte & 0x08 ? 1 : 0)##(byte & 0x04 ? 1 : 0)##(byte & 0x02 ? 1 : 0)##(byte & 0x01 ? 1 : 0)

Name: Anonymous 2011-10-06 9:33

Working on a python irc script that sends out streams that are live to users who trigger it.



def check_online_own3d(streamID):
    f = urllib.urlopen("http://api.own3d.tv/liveCheck.php?live_id=" + streamID)
    liveLink = f.read()
    f.close()
   
    if '<isLive>true</isLive>' in liveLink:
        ready = 1
    else:
        ready = 0
  
    return ready


def on_text(word, word_eol, userdata):
    destination = xchat.get_context()
    triggernick = word[0]
    trigger = re.split(' ', word[1].lower())
   
    if trigger[0] == '!stream' and trigger[1] == 'list':
        strStreamListOwn3d = 'none'
        liveStreamListOwn3d = []
        inStreamListOwn3d = []
        #own3d
        loop = 0
        infile = open(os.path.join("C:\\Program Files\\XChat-WDK\\plugins\\streamFiles", "streamListOwn3d.txt"))
        findingLine = infile.readlines()
        infile.close()
        for i in findingLine:
            streamID = findingLine[loop].strip()
            if check_online_own3d(streamID) == 1:
                inStreamListOwn3d.append(streamID)
            loop += 1
       
       
        if '40553' in inStreamListOwn3d:
                 liveStreamListOwn3d.append('http://www.own3d.tv/live/40553/ComeWithMe')

        strStreamListOwn3d = str(liveStreamListOwn3d)
        
        if liveStreamListOwn3d == []:
            destination.command("say " + triggernick + ": No live streams currently online.")
        else:
            destination.command("say " + triggernick + ": Live Streams are " + strStreamListOwn3d)
       
       
        return xchat.EAT_NONE


xchat.hook_print('Channel Message', on_text)


Would appearciate help to optimize the bit that checks if it is online. Right now it takes about 10 secs to reply with the live links.

Name: Anonymous 2011-10-06 10:33

>>3
>dec2quads(
H.P.LOVECRAFT QUALITY

Name: Anonymous 2011-10-06 10:59

#if defined (__GNUC__)
#define VMCALL __attribute__((hot, fastcall))
#elif defined (MSVC)
#define VMCALL __fastcall
#else
#define VMCALL
#endif

#define VMDECL(name) static int VMCALL name(unsigned int op, thread* t)

Name: Anonymous 2011-10-06 11:09

[code]Sub unwrap()

Function trunc(kc, n)
k1 = kc
trunc = 0
While (k1 > n)
k1 = k1 - n
trunc = trunc + 1
Wend
End Function
   
Dim xx(311, 264)
nrow = 88: ncol = 35: nwraps = 2: nwrapcols = 20
sname1 = "wrapped": sname2 = "unwrapped":

Sheets(sname2).Select: Sheets(sname2).Cells.Select
Selection.ClearContents: Selection.Borders.LineStyle = xlNone

For kkrow = 1 To nrow: Cells(kkrow + 32, 2) = kkrow: Next kkrow
For kkcol = 1 To ncol: Cells(32, kkcol + 2) = kkcol: Next kkcol

For kkcol = 1 To ncol
Cells(33, kkcol + 2).Borders(xlEdgeTop).LineStyle = XlLineStyle.xlDouble
Cells(nrow + 32, kkcol + 2).Borders(xlEdgeBottom).LineStyle = XlLineStyle.xlDouble
Next kkcol
For kkrow = 1 To nrow
Cells(kkrow + 32, 3).Borders(xlEdgeLeft).LineStyle = XlLineStyle.xlDouble
Cells(kkrow + 32, ncol + 2).Borders(xlEdgeRight).LineStyle = XlLineStyle.xlDouble
Next kkrow

For kkrow = 1 To nrow: For kkcol = 1 To ncol
Sheets(sname1).Select
kkr1 = nwraps * (kkrow - 1) + trunc(kkcol, nwrapcols) + 1
kkc1 = kkcol - nwrapcols * trunc(kkcol, nwrapcols)
xx(kkrow, kkcol) = Cells(kkr1, kkc1)
Sheets(sname2).Select
Cells(kkrow + 32, kkcol + 2) = xx(kkrow, kkcol)
Next kkcol: Next kkrow

End Sub

Name: Anonymous 2011-10-06 12:49


#!/bin/bash
root=`echo ~`
watched_folder="$root/downloads/torrents/links"

if [ ! 1 -eq $# ]; then
        echo This script needs one argument
        exit 1
fi

file="$root/scripts/torrents/$1"

if [ ! -f "$file" ]; then
# History file does not exist yet
        touch "$file"
        echo Created a history file
fi

url="http://api.dailytvtorrents.org/1.0/torrent.getLatest?show_name=$1&just_link=yes"
link=`curl -s "$url"`
old_link=`cat "$file"`

# Change this by checking if .torrent file already there
if [ ! "$old_link" = "$link" ]; then
# Last download of the torrent != current try

# Do we need to start deluged?
        ps=`pgrep deluged`
        if [ "$ps" = "" ]; then
                sudo /etc/rc.d/deluged start
        fi

        cd "$watched_folder"
        curl -s -O "$link"

        echo "Got one"
# We remember it
    echo $link > $file
else
        echo "Nothing new"
fi


Coupled with some cron tasks = automated download of the series I watch.

Name: Anonymous 2011-10-06 12:52

>>4

if ...:
    ready = 1
else:
    ready = 0
  
return ready


why not "return ...". What you're doing is just ugly and Pythonic

Name: Anonymous 2011-10-06 13:05


#include "hurrdurr.h"

hurr
durr
herp
derp //derp

Name: Anonymous 2011-10-06 13:07

    Private Sub Process(ByVal ID As Byte)
        Dim Ev As Reflection.EventInfo
        Dim EvDel As System.Delegate
        Dim Args As New Collections.List(Of Object)
        Try
            Ev = PacketEvents(ID)
        Catch Err As Collections.KeyNotFoundException
            Throw New UnknownPacketException(ID)
        End Try
        EvDel = CType(GetType(Client).GetField(Ev.Name + "Event", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic).GetValue(Me), System.Delegate)
        For Each Arg As Reflection.ParameterInfo In Ev.EventHandlerType.GetMethod("Invoke").GetParameters()
            Dim Type As System.Type = Arg.ParameterType
            If Type Is GetType(Client) Then
                Args.Add(Me)
            ElseIf Type Is GetType(Boolean) Then
                Args.Add(Stream.ReadByte() <> 0)
            ElseIf Type Is GetType(Byte) Then
                Args.Add(Stream.ReadByte())
            ElseIf Type Is GetType(Short) Then
                Args.Add(Stream.ReadShort())
            ElseIf Type Is GetType(Integer) Then
                Args.Add(Stream.ReadInteger())
            ElseIf Type Is GetType(Long) Then
                Args.Add(Stream.ReadLong())
            ElseIf Type Is GetType(Single) Then
                Args.Add(Stream.ReadSingle())
            ElseIf Type Is GetType(Double) Then
                Args.Add(Stream.ReadDouble())
            ElseIf Type Is GetType(String) Then
                Args.Add(Stream.ReadString())
            Else
                Throw New System.ArgumentException
            End If
            For Each Attr As PacketTerminatorAttribute In Arg.GetCustomAttributes(GetType(PacketTerminatorAttribute), False)
                If Attr.Value = CLng(Args(Args.Count - 1)) Then
                    GoTo EscapeOuterFor
                End If
            Next
        Next
EscapeOuterFor:
        If EvDel IsNot Nothing Then
            EvDel.DynamicInvoke(Args.ToArray())
        ElseIf (Ev.GetAddMethod().Attributes And Reflection.MethodAttributes.Public) <> 0 Then
            RaiseEvent ReceivedUnhandled(Me, ID, Ev.Name)
        End If
        'System.Console.Out.Write("{0}:", ID)
        'For Each Arg As Object In Args
        'System.Console.Out.Write(" {0}", Arg)
        'Next
        'System.Console.Out.WriteLine()
    End Sub

Name: Anonymous 2011-10-06 13:13

>>10
imperative AIDS

Name: Anonymous 2011-10-06 13:16

#!/usr/bin/bash
cat /etc/passwd | sed -n '2,${p;n;}' | cut -d: -f1 | rev | sort -rd | awk "NR>=$MY_LINE1 && NR<=$MY_LINE2" | tr '\n' ',' | sed "s/,/, /g" | sed "s/, $/./" | tr -d '\n'

Name: Anonymous 2011-10-06 15:07


#ifdef _MSC_VER
#pragma warning( disable : 4820  )
#pragma warning( disable : 4514  )
#endif

#include <SDL/SDL.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#include <fcntl.h>

//#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#define MULTISAND_DEBUG

#include "defines.h"
#include "powder.h"
#include "menu.h"
#include "graphics.h"

//#include <getopt.h>


int main(int argc, char** argv)
{
    SDL_Event      MEvent;

    int    MouseX;
    int    MouseY;
    int    MouseSt;
    bool   UserQuit   = false;
    bool   brushchg   = false;
    ptype* pselection = &ptable[1];

    InitSDL("Multisand");

    if(init_particles() != 0)
    {
        puts("Error: Not enough memory!");
        exit(1);
    }

    while(!UserQuit)
    {
        //Clear menu area
        memset(menmem, 0, menmemsz);

        // Get mouse state and position
        while(SDL_PollEvent(&MEvent))
        {
            if(MEvent.type == SDL_QUIT)
            {
                UserQuit = true;
            }
        }

        MouseSt = SDL_GetMouseState(&MouseX, &MouseY);

        if(MouseSt & SDL_BUTTON(4) && brushsz < 7)
        {
            puts("Text");
            ++brushsz;
        }

        if(MouseSt & SDL_BUTTON(5) && brushsz > 0)
            --brushsz;


        //Is this optimized? TODO: Fix this, but later for sure
        if(update_menu(MouseX, MouseY, &pselection, MouseSt) & SDL_BUTTON(1) && MouseY < MENU_LOWEST_POINT)
        {
            brush_fill(MouseX, MouseY, pselection->ID);
            //vidmem[(XRES_BIT(MouseY)) + MouseX] = pselection->color;
        }
       // pmap[XRES_BIT(20) + 6] = pmap[XRES_BIT(20) + 7] = pmap[XRES_BIT(20) + 8] = 0xFF0000;
        //memcpy(vidmem, pmap, sizeof(pmap));

        SDL_UpdateRect(Video, 0, 0, 0, 0);
        SDL_Delay((Uint32)1);
    }

    SDL_Quit();
    return 0;
}

Name: Anonymous 2011-10-06 15:31


// deinterlace the 4 chunks from one imageData blob in one pass
// see appendix e of gif spec
//
// ideas: canvasize first, then deinterlace...
// and do canvas drawImage calls or putImageData calls to move the rows around
GIF.render.deinterlacePixels = function(oldpixels, w, h){

  var pixels = new Uint8Array(oldpixels.length);
  var stripes2 = Math.ceil(h/8); // the row where the 2nd interlaced chunk starts
  var stripes3 = Math.ceil(h/4);
  var stripes4 = Math.ceil(h/2);

  // pixels[(w*y) +x] = oldpixels[(w*y) +x] <- base calculation

  for(var y=0; y<h; y++){
    var interlacedRowOffset;
    var rowOffset = w * y;
    if (y % 8 === 0)
      interlacedRowOffset = w* (y/8);
    else if ((y + 4) % 8 === 0)
      interlacedRowOffset = w* ((y-4)/8+stripes2);
    else if (y % 2 === 0)
      interlacedRowOffset = w* ((y-2)/4+stripes3);
    else
      interlacedRowOffset = w* ((y-1)/2+stripes4);
    for(var x=0; x<w; x++)
      pixels[rowOffset+x] = oldpixels[interlacedRowOffset+x];
  }

  return pixels;
};

Name: Anonymous 2011-10-06 15:54

>>8
>root=`echo ~`
Why do this instead of using $HOME when needed?

Name: Anonymous 2011-10-06 16:12


#!/bin/bash

while true;
do
  runhaskell $1 &
  inotifywait -q -q -e modify $1
  killall ghc
done

Name: noob here 2011-10-06 16:21

How do you post so it's formatted correctly?

Name: Anonymous 2011-10-06 16:52

>>18

<paste code>

Name: Anonymous 2011-10-06 16:56


echo "SELECT key, concat('\'',val,'\'') FROM some_table" |  \
mysql -A -u user -p db01 | \
sed 's/^/SET /g' | \
redis-cli > /dev/null

Name: Anonymous 2011-10-06 17:00

>>18
You need to manually format it with BBCode. [ color=blue ]code[ /color ] (remove the spaces), etc.

Name: Anonymous 2011-10-06 17:35

Currently working on a mandelbrot set renderer and putting it into a screen saver.


No idea if this will actually format it correctly.
<paste code>
void Mandelbrot::Draw(Graphics* graphics)
{
    double minRe;
    double maxRe;
    double minIm;
    double maxIm;

    switch(_centerPosition)
    {
        // the image center effects where the image is zoomed into.
    case 6:
        // top left
         minRe = _x;
         maxRe = _x + _width;
         minIm = _y - _height;//_y + (_width-_x) * _imageBounds->Height / _imageBounds->Width;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
    case 7:
        // top middle
         minRe = _x - _width * 0.5;
         maxRe = _x + _width * 0.5;
         minIm = _y - _height;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
    case 8:
        // top right
         minRe = _x - _width;
         maxRe = _x;
         minIm = _y - _height;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
    case 3:
        // middle left
         minRe = _x;
         maxRe = _x + _width;
         minIm = _y - _height * 0.5;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
    case 4:
        // middle middle
         minRe = _x - _width * 0.5;
         maxRe = _x + _width * 0.5;
         minIm = _y - _height * 0.5;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
    case 5:
        // middle right
         minRe = _x - _width;
         maxRe = _x;
         minIm = _y - _height * 0.5;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
    case 0:
        // bottom left
         minRe = _x;
         maxRe = _x + _width;
         minIm = _y;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
    case 1:
        // bottom middle
         minRe = _x - _width * 0.5;
         maxRe = _x + _width * 0.5;
         minIm = _y;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
   
    default:
        // bottem right
         minRe = _x - _width;
         maxRe = _x;
         minIm = _y;
         maxIm = minIm +(maxRe-minRe)*_imageBounds->Height / _imageBounds->Width;
        break;
    }

    // local position data
    int imageHeight = (int)_imageBounds->Height;
    int imageWidth  = (int)_imageBounds->Width;
    unsigned maxIterations = GetIterations();
   
    BitmapData bitmapData;
    Bitmap bitmap(imageWidth, imageHeight);
    bitmap.LockBits(&Rect(0, 0, imageWidth, imageHeight), ImageLockModeWrite, PixelFormat32bppARGB, &bitmapData);
    UINT* pixel = (UINT*)bitmapData.Scan0;
    int stride = bitmapData.Stride / 4;

    double Re_factor = (maxRe-minRe)/(imageWidth-1);
    double Im_factor = (maxIm-minIm)/(imageHeight-1);

#pragma omp parallel for
    for(int y = 0; y < imageHeight; ++y)
    {
        double c_im = maxIm - y*Im_factor;

        for(int x=0; x < imageWidth; ++x)
        {
            double c_re = minRe + x*Re_factor;
            double Z_re = c_re, Z_im = c_im;
           
            double Z_re2 = Z_re * Z_re;
            double Z_im2 = Z_im * Z_im;
            unsigned n;
            for(n = 0; n < maxIterations; ++n)
            {
                Z_re2 = Z_re * Z_re;
                Z_im2 = Z_im * Z_im;

                if(Z_re2 + Z_im2 > 4)
                {
                    break;
                }

                Z_im = 2 * Z_re * Z_im + c_im;
                Z_re = Z_re2 - Z_im2 + c_re;
            }
           
            //if(c_re > 0)
                pixel[y * stride + x] = Color(n % 256, (byte)(255*((float)n / (float)maxIterations)),0).ToCOLORREF() + 0xff000000;
            //else
            //    pixel[y * stride + x] = 0xfffffffff;
           
            //if(n == maxIterations)
            //    pixel[y * stride + x] = 0xfffffffff;
        }
    }

    bitmap.UnlockBits(&bitmapData);
    graphics->DrawImage(&bitmap, *_imageBounds);
   
   
   
    std::wstringstream text;
    text << "Iterations: " << _maxIterations << " Current Iterations: " << _currentIterations
        << "\nX: " << _x << "\nY: " << _y  << "\nWidth: " << _width << " Height: "
        << _height <<"\nDtime: " << _outputText;
   
    std::wstring wstr = text.str();
    DrawString(graphics, wstr.c_str(), PointF(10,10));
}

Name: Anonymous 2011-10-06 17:37


  char day_name[7][10];
  int i;

  for (i = 0; i < 7; i++)
  {
    switch(i)
    {
      case 0: strcpy(day_name[i], "Sunday");
      case 1: strcpy(day_name[i], "Monday");
      case 2: strcpy(day_name[i], "Tuesday");
      case 3: strcpy(day_name[i], "Wednesday");
      case 4: strcpy(day_name[i], "Thursday");
      case 5: strcpy(day_name[i], "Friday");
      case 6: strcpy(day_name[i], "Saturday");
    }
  }


>>18
Don't listen to these trolls, use ... tags.

Name: george 2011-10-06 17:41

>>22
use recursion and threads it
should reduce sizeof( code );
if( cpu_cores > 1 ){
 (theoretically )speed_up( things );
}
i dont wanna sound like a dick by all accounts

Name: jc 2011-10-06 17:44

void R_RenderView( viewParms_t *parms ) {
    int firstDrawSurf;

    if ( parms->viewportWidth <= 0 || parms->viewportHeight <= 0 ) {
        return;
    }

    // Ridah, purge media that were left over from the last level
    if ( r_cache->integer ) {
        extern void R_PurgeBackupImages( int purgeCount );
        static int lastTime;

        if ( ( lastTime > tr.refdef.time ) || ( lastTime < ( tr.refdef.time - 200 ) ) ) {
            R_FreeImageBuffer();    // clear all image buffers
            R_PurgeShaders( 10 );
            R_PurgeBackupImages( 1 );
            R_PurgeModels( 1 );
            lastTime = tr.refdef.time;
        }
    }
    // done.

    tr.viewCount++;

    tr.viewParms = *parms;
    tr.viewParms.frameSceneNum = tr.frameSceneNum;
    tr.viewParms.frameCount = tr.frameCount;

    firstDrawSurf = tr.refdef.numDrawSurfs;

    tr.viewCount++;

    // set viewParms.world
    R_RotateForViewer();

    R_SetupFrustum();

    R_GenerateDrawSurfs();

    R_SortDrawSurfs( tr.refdef.drawSurfs + firstDrawSurf, tr.refdef.numDrawSurfs - firstDrawSurf );

    // draw main system development information (surface outlines, etc)
    R_FogOff();
    R_DebugGraphics();
    R_FogOn();

}

working on too late too late
bug fixes

Name: Anonymous 2011-10-06 17:45

>>23
Your code is bad. Use litterals:
char day_name[7][10] = {
  "Sunday",
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday"
};

Name: Anonymous 2011-10-06 17:46

>>24
I think that's all that OpenML does, it's not much more efficient on a 4 core machine.

I want to divide the bitmap into the number of cores and render each part on a separate core. There should be more cache hits that way rather then having it interlaced across the cores.

Name: Anonymous 2011-10-06 17:46

>>26
Sunday is the last day of the week and that's why you call Saturday and Sunday a weekend you stupid American faggot

Name: Anonymous 2011-10-06 17:47

>>28
I agree with you, but tell that to >>23.

Name: Anonymous 2011-10-06 17:52

>>23 dont listen to any of those stupid fucks
use cowboy codez

void name_that_day( int i )
{
 char req[ 1024 ];
 sprintf(req,"http://namethatday?int_to_char.php?%s", i);
 system( req );
 system("pause")//give yourself inf time to read it
}

Name: Anonymous 2011-10-06 18:05

>>26
you are wasting space on the days that are less than 9 chars

Name: Anonymous 2011-10-06 18:09

>>31
Yes, 13 * sizeof(char). If I had used pointers that'd be 7 * sizeof(char*) which is bigger on most architectures. The last alternative is using a Win32-like multistring but then retrieval would be slower.

Name: george@hotmail.com 2011-10-06 18:14

>>31
>>32
its called added protection assholes
new tech i ve been developing for the last 5 months

Name: Anonymous 2011-10-06 18:39

>>28
Do you put both of your bookends on the same side of your books? probably

>>26
Would it have helped if I had written it like this?

  char day_name[7][10];
  int i;

  for (i = 0; i < 7; i++)
  {
    switch(i)
    {
      case 0: strcpy(day_name[i], "Sunday");
      case 1: strcpy(day_name[i], "Monday");
      case 2: strcpy(day_name[i], "Tuesday");
      case 3: strcpy(day_name[i], "Wednesday");
      case 4: strcpy(day_name[i], "Thursday");
      case 5: strcpy(day_name[i], "Friday");
      case 6: strcpy(day_name[i], "Trollday");
    }
  }

Name: 11 2011-10-06 21:40

Yeah, that's right. My code is so great, you're all speechless.

Name: Anonymous 2011-10-06 22:04


#!/bin/sh
echo hello world
exit 24

Name: Anonymous 2011-10-06 22:34

Sub unwrap()

Function trunc(kc, n)
k1 = kc
trunc = 0
While (k1 > n)
k1 = k1 - n
trunc = trunc + 1
Wend
End Function
  
Dim xx(311, 264)
nrow = 88: ncol = 35: nwraps = 2: nwrapcols = 20
sname1 = "wrapped": sname2 = "unwrapped":

Sheets(sname2).Select: Sheets(sname2).Cells.Select
Selection.ClearContents: Selection.Borders.LineStyle = xlNone

For kkrow = 1 To nrow: Cells(kkrow + 32, 2) = kkrow: Next kkrow
For kkcol = 1 To ncol: Cells(32, kkcol + 2) = kkcol: Next kkcol

For kkcol = 1 To ncol
Cells(33, kkcol + 2).Borders(xlEdgeTop).LineStyle = XlLineStyle.xlDouble
Cells(nrow + 32, kkcol + 2).Borders(xlEdgeBottom).LineStyle = XlLineStyle.xlDouble
Next kkcol
For kkrow = 1 To nrow
Cells(kkrow + 32, 3).Borders(xlEdgeLeft).LineStyle = XlLineStyle.xlDouble
Cells(kkrow + 32, ncol + 2).Borders(xlEdgeRight).LineStyle = XlLineStyle.xlDouble
Next kkrow

For kkrow = 1 To nrow: For kkcol = 1 To ncol
Sheets(sname1).Select
kkr1 = nwraps * (kkrow - 1) + trunc(kkcol, nwrapcols) + 1
kkc1 = kkcol - nwrapcols * trunc(kkcol, nwrapcols)
xx(kkrow, kkcol) = Cells(kkr1, kkc1)
Sheets(sname2).Select
Cells(kkrow + 32, kkcol + 2) = xx(kkrow, kkcol)
Next kkcol: Next kkrow

End Sub

Name: Anonymous 2011-10-06 22:54


#!/bin/bash
echo "Segmentation fault" >&2
exit 139
# problem, lunix?

Name: Anonymous 2011-10-06 23:08

gcc code.c

segmentation fault

Name: Anonymous 2011-10-06 23:51

>>8
echo without quotes
laughing_hebrews.php

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List