Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
foobar mitzvah ceremony
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
ComputerNerd
n00b
n00b


Joined: 27 Feb 2013
Posts: 23

PostPosted: Thu Jun 27, 2013 2:55 am    Post subject: foobar mitzvah ceremony Reply with quote

For those of you who don't know foobar mitzvah is when a hacker stands in-front of other hackers and recites part of the system source code. I will begin.
Code:

int savePNG(char * fileName,uint32_t width,uint32_t height,void * ptr)
{
   //saves a 24bit png with rgb byte order
   png_byte * dat=ptr;//convert to uint8_t
   FILE * fp=fopen(fileName,"wb");
   if (fp==0)
      return 1;
   png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, (png_voidp)0,0,0);
   if (!png_ptr)
      return 1;
   png_infop info_ptr = png_create_info_struct(png_ptr);
   if (!info_ptr){
      png_destroy_write_struct(&png_ptr,(png_infopp)NULL);
      return 1;
   }
   if (setjmp(png_jmpbuf(png_ptr))){
      png_destroy_write_struct(&png_ptr, &info_ptr);
      fclose(fp);
      return 1;
   }
   png_init_io(png_ptr, fp);
   png_set_IHDR(png_ptr, info_ptr, width, height,8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);//must be called before other png_set_*() functions
   png_set_compression_level(png_ptr,Z_BEST_COMPRESSION);
   uint32_t y;
   png_set_user_limits(png_ptr, width, height);
   png_write_info(png_ptr, info_ptr);
   for (y=0;y<height;y++)
      png_write_row(png_ptr, &dat[(y*width*3)]);
   png_write_end(png_ptr, info_ptr);
   png_destroy_write_struct(&png_ptr, &info_ptr);
   fclose(fp);//done with file
   return 0;//will return 0 on success non-zero in error
}

_________________
http://geekwithcomputer.com/ A website about programming and electronics
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7939
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Jun 27, 2013 3:30 am    Post subject: Reply with quote

Moved from Portage & Programming to Off the Wall. Not about Gentoo so it fits better here.

- John
_________________
I can confirm that I have received between 0 and 999 National Security Letters.
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1569
Location: U.S.A.

PostPosted: Thu Jun 27, 2013 5:01 pm    Post subject: Reply with quote

How are we supposed to enjoy this without somebody in the background doing a Gregorian chant of the relevant header files.
_________________
"The accumulation of all power, legislative, executive, and judiciary in the same hands...may justly be pronounced the very definition of tyranny."
--James Madison, Federalist 46
Back to top
View user's profile Send private message
ComputerNerd
n00b
n00b


Joined: 27 Feb 2013
Posts: 23

PostPosted: Fri Jun 28, 2013 3:29 am    Post subject: Reply with quote

BoneKracker wrote:
How are we supposed to enjoy this without somebody in the background doing a Gregorian chant of the relevant header files.

Code:

#pragma once
#include "config.h"
#include <avr/pgmspace.h>
void wrReg(uint8_t reg,uint8_t dat);
uint8_t rdReg(uint8_t reg);
#ifdef MT9D111
uint16_t rdReg16(uint8_t reg);
void wrReg16(uint8_t reg,uint16_t dat);
#else
struct regval_list {
   uint8_t reg_num;
   uint8_t value;
};
void setRes(uint8_t res);
void wrSensorRegs8_8(const struct regval_list reglist[]);
extern const struct regval_list ov7670_default_regs[];
#endif
void initCam(uint8_t bayerUse);

_________________
http://geekwithcomputer.com/ A website about programming and electronics
Back to top
View user's profile Send private message
sikpuppy
n00b
n00b


Joined: 12 Jun 2012
Posts: 34
Location: Central Coast, NSW

PostPosted: Fri Jun 28, 2013 5:48 am    Post subject: Reply with quote

God what a tease! Got me to the point of orgasm and then I ran out of text.
Back to top
View user's profile Send private message
bogamol
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2009
Posts: 84
Location: Detroit, Michigan - The Home of Rock and Roll

PostPosted: Fri Jun 28, 2013 10:44 am    Post subject: Reply with quote

Code:
do while sikpuppy.status != refractory

_________________
Freedom is the oxygen of the soul. -Moshe Dayan

Juniper wrote:
I fail to see the relevance.
Back to top
View user's profile Send private message
energyman76b
Advocate
Advocate


Joined: 26 Mar 2003
Posts: 2031
Location: Germany

PostPosted: Sat Jun 29, 2013 7:02 pm    Post subject: Reply with quote

89 f0 mov %esi,%eax
ff ce dec %esi
83 fe ff cmp $0xffffffff,%esi
74 0f je 47bd78 <metalen+0x18>
80 3f 83 cmpb $0x83,(%rdi)
74 12 je 47bd80 <metalen+0x20>
ff ce dec %esi
48 ff c7 inc %rdi
83 fe ff cmp $0xffffffff,%esi
75 f1 jne 47bd69 <metalen+0x9>
f3 c3 repz retq
66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
ff c0 inc %eax
48 83 c7 02 add $0x2,%rdi
eb da jmp 47bd62 <metalen+0x2>
66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1)
_________________
AidanJT wrote:

Libertardian denial of reality is wholly unimpressive and unconvincing, and simply serves to demonstrate what a bunch of delusional fools they all are.

Satan's got perfectly toned abs and rocks a c-cup.
Back to top
View user's profile Send private message
ComputerNerd
n00b
n00b


Joined: 27 Feb 2013
Posts: 23

PostPosted: Sat Jun 29, 2013 8:23 pm    Post subject: Reply with quote

Code:

void ReadChip(uint32_t sz)
{//sends entire flash content to serial
   datIn;
   PORTB|=(1<<3)|(1<<4)|(1<<5);//CE# OE# WE# all high
   PORTB&=~((1<<3)|(1<<4));//CE# OE# to low
   uint32_t addr;
   for (addr=0;addr<sz;++addr){
      shift24(addr);
      serialWrB(rdDat());
   }
   PORTB|=(1<<3)|(1<<4);//CE# OE# to high
}

_________________
http://geekwithcomputer.com/ A website about programming and electronics
Back to top
View user's profile Send private message
pieterhog
n00b
n00b


Joined: 20 Nov 2012
Posts: 10
Location: Groningen, NL, EU

PostPosted: Mon Jul 01, 2013 11:58 pm    Post subject: Reply with quote

LOL @ all posters - I LOVE this hilarious humour.

Also, since it's July 2, we can all chant the following verse:

Code:
 rcu_scheduler_active = 1, debug_locks = 0
     4 locks held by setfiles/2123:
      #0:  (&sb->s_type->i_mutex_key#13){+.+.+.}, at: [<ffffffff8114cbc4>]
    walk_component+0x1ef/0x3e8
      #1:  (&isec->lock){+.+.+.}, at: [<ffffffff81204bca>]
    inode_doinit_with_dentry+0x3f/0x41f
      #2:  (&tbl->proxy_timer){+.-...}, at: [<ffffffff8106a803>]
    run_timer_softirq+0x157/0x372
      #3:  (class){+.-...}, at: [<ffffffff8141f256>] neigh_proxy_process
    +0x36/0x103
   
     stack backtrace:
     Pid: 2123, comm: setfiles Tainted: G        W
    3.1.0-0.rc2.git7.2.fc16.x86_64 #1
     Call Trace:
      <IRQ>  [<ffffffff8108ca23>] lockdep_rcu_dereference+0xa7/0xaf
      [<ffffffff8146a0b7>] __in_dev_get_rcu+0x55/0x5d
      [<ffffffff8146a751>] arp_process+0x25/0x4d7
      [<ffffffff8146ac11>] parp_redo+0xe/0x10
      [<ffffffff8141f2ba>] neigh_proxy_process+0x9a/0x103
      [<ffffffff8106a8c4>] run_timer_softirq+0x218/0x372
      [<ffffffff8106a803>] ? run_timer_softirq+0x157/0x372
      [<ffffffff8141f220>] ? neigh_stat_seq_open+0x41/0x4
Back to top
View user's profile Send private message
ComputerNerd
n00b
n00b


Joined: 27 Feb 2013
Posts: 23

PostPosted: Wed Jul 03, 2013 6:24 pm    Post subject: Reply with quote

Code:

if (argc>1){
      int arg;
      for (arg=0;arg<argc;++arg){
         if (strcmp(argv[arg],"-f")==0){
            ++arg;
            if (strcmp(argv[arg],"x")==0)
               xF=1;
            else
               frames=atoi(argv[arg]);
            continue;
         }
         if (strcmp(argv[arg],"-w")==0){
            ++arg;
            img_w=atoi(argv[arg]);
         }
         if (strcmp(argv[arg],"-H")==0){
            ++arg;
            img_h=atoi(argv[arg]);
         }
         if ((strcmp(argv[arg],"-h")==0)||(strcmp(argv[arg],"--help")==0)){
            puts("Arguments are: -w width in bytes (eg 2 bytes per pixel you would specify 1600 for 800) -H heigh -h help -f n replace n with how many frames you want doing -f x means keep going until CRTL+C gets pressed");
            puts("This program is licensed with GPLV3 or later");
            return 0;
         }
      }
   }

_________________
http://geekwithcomputer.com/ A website about programming and electronics
Back to top
View user's profile Send private message
Prenj
n00b
n00b


Joined: 20 Nov 2011
Posts: 13

PostPosted: Wed Jul 03, 2013 8:20 pm    Post subject: Reply with quote

Code:

#news server:
import zmq, json
x = zmq.Context()
s = x.socket(zmq.PUB)
s.bind("tcp://*:1234")
while True:
   news = {"title":"blahblah","content":"asdasdasdasdasdasdasdasdlkjasdljksd"}
   s.send(json.dumps(news))


#news client(s):
import zmq, json
x = zmq.Context()
s = x.socket(zmq.SUB)
s.connect("tcp://teh_server:1234")
while True:
   news = json.loads(s.recv())
   print news

_________________
“If You Meet the Buddha on the Road, Kill Him”
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum