-  [WT]  [PS]  [Home] [Manage]

Name
Email
Subject   (new thread)
Message
File
Password  (for post and file deletion)
  • Supported file types are: GIF, JPG, PNG, TXT
  • Maximum file size allowed is 5120 KB.
  • Images greater than 200x200 pixels will be thumbnailed.
  • Currently 405 unique user posts. View catalog

  • Blotter updated: 2009-07-22 Show/Hide Show All

File 125872185188.jpg - (280.28KB , 942x1449 , 1181208617331.jpg )
6289 No. 6289 Stickied hide watch expand quickreply [Reply]
Hi guys, I'm crossposting >>/b/389653 here to get /pr/'s help on this issue for the new /local/ board idea I'm working on, but still don't have a really concrete way to approach this using PHP. I'd appreciate some input on a good way to approach this, from a programming standpoint.
3 posts omitted. Click Reply to view.
>> No. 6308
IP addresses tell you the location of one's ISP, and not the local of the terminal. The choice of board should NOT be automatically determined by IP. That is just asking for fuck-up. My ISP is 25 miles away, on the other side of the largest city in my state that I live nearby. People should choose. One's IP would work well with "recommendations", but it shouldn't to any extent be a restriction. If I want to browse /local/-Tokyo while in America, I should.


tl;dr: This, a million times this:
>>6298


File 125867399974.jpg - (17.51KB , 240x306 , 149_dragonite2.jpg )
6224 No. 6224 hide watch expand quickreply [Reply]
1 post omitted. Click Reply to view.
>> No. 6254
>>6232
sure thing!

import sys, time, re, crypt
t=raw_input("Enter in a string to be bruteforced: ")
chars=range(97,123)
if raw_input("Enter 1 to try alphanumeric combinations or 0 to just try alphabet: ") == "1":
chars=range(48,58)+chars
pt=time.time()
def mktripcode(pw):
salt = (pw + 'H.')[1:3]
salt = re.compile('[^\.-z]').sub('.', salt)
trip = crypt.crypt(pw, salt)[-10:]
return trip
def checkPassword(password):
Message too long. Click here to view the full text.
>> No. 6257
>>6254
Oh thank god you didn't use BBCode to preserve the FIOC

I hate it when people assume I want to use the same indent scheme they do.
>> No. 6290
>>6257
Well I'll do it anyway just to make you mad.

import sys, time, re, crypt t=raw_input("Enter in a string to be bruteforced: ") chars=range(48,58)+range(97,123) pt=time.time() def mktripcode(pw): salt = (pw + 'H.')[1:3] salt = re.compile('[^\.-z]').sub('.', salt) trip = crypt.crypt(pw, salt)[-10:] return trip def checkPassword(password): if re.search(t, mktripcode(password), re.I): ct=time.time() print "" print "match [" + password + "]" print "tripcode [" + mktripcode(password) + "]" print "in", ct-pt, "seconds." raw_input("") sys.exit() def recurse(width, position, baseString): for char in chars: if (position < width - 1): recurse(width, position + 1, baseString + "%c" % char) else: checkPassword(baseString + "%c" % char) maxChars = 6 for baseWidth in range(1, maxChars + 1): sys.stdout.write("checking passwords width [" + `baseWidth` + "]...") recurse(baseWidth, 0, "") print ""



File 125865931098.jpg - (305.23KB , 640x470 , secrethistoryofhacking.jpg )
6210 No. 6210 hide watch expand quickreply [Reply]
Writing my own disassembler for fun. (Just going to work on flat 16-bit binaries in x86 for now, no need to bother with different executable formats) Unfortunately I'm not really sure how to begin translating the hundreds of possible instructions to strings that represent the correct mnemonics. I mean I could do it in an incredibly unsophisticated, but it would be horribly inefficient and just a big waste of time, and very difficult to maintain.

So my problem is thinking up how I can do this. I already have the Intel IA-32 instruction reference manual and I understand how the opcodes are encoded. I'm just not sure how to properly turn them into a string in a manner that isn't embarrassing. Tips?
7 posts and 2 images omitted. Click Reply to view.
>> No. 6294
Maybe I should just parse the definitions like "1111 011w : 11 111 reg" somehow
>> No. 6306
>>6294
no, use LA
>> No. 6311
>>6306
Why?


File 125868942683.jpg - (12.75KB , 240x240 , 41WDWECWVCL__SL500_AA240_.jpg )
6262 No. 6262 hide watch quickreply [Reply]
ITT: Books every pro grammar needs. Pro vide pics, god damn nit, it isn't that hard to open up amazon dot com, search for the book, and save the thumb nail.

I'll start.
>> No. 6271
>>6262
The C Programming Language, also known as K&R
SICP :P
>> No. 6310
File 125875375693.gif - (1.26KB , 337x253 , prog snake.gif )
6310
>>6271
my other car is a cdr lol xD


File 125869385668.jpg - (1.15MB , 2816x2112 , pict0133.jpg )
6266 No. 6266 hide watch expand quickreply [Reply]
i reciently decided that enough was enough and i backed up all my pirated movies and music and jammed a sabayon linux 5.0 live DVD in my aging toshiba laptop after some cussing and hitting anything but the laptop. so about an hour later and a few bloddy knuckels and headache i rebooted into my new GUI beautiful! well it worked 99% ootb and a few little hitches here and there all thet a wonderful sabayonfiveoh@IRC graciously helped with (even play my countrestrike source on it) but nothing could compaire to the acpi fan not working well im too buizy to screw with it all day every day but i need to have my computer usable and if i cant have it open source i will hurt sombody so i did what i do best and built something that would other wise cost somewhere in the nabourhood of $50 - $150 with trash and spare parts laying around my garage
desktop prosessor fan, some lengths of wood, two sheets of heavy duty speaker protective mesh and 4 dozzen screws
but i still strive to make my poor old shit box satalite keep itself cool
9 posts and 4 images omitted. Click Reply to view.
>> No. 6283
File 125870550374.jpg - (38.21KB , 432x285 , mr freeze.jpg )
6283
>>6277
Basically, blue leds lower the computer's temp, reds increase hurtz, and green ones increase both but only by 25% of what you'd get using red/blue ones.
>> No. 6296
>>6283
Wut, blue light has more energy than red.
>> No. 6309
>>6283
.............and no led doesn't do anything. but it makes you feel leet so go ahead and drool over it.


File 125859020980.jpg - (110.91KB , 323x500 , coke.jpg )
6173 No. 6173 hide watch expand quickreply [Reply]
So its 2 AM and you've been programming for 12 hours, what are you drinking?

I'm a coke man myself.
15 posts and 2 images omitted. Click Reply to view.
>> No. 6292
Tea, you damned children.
>> No. 6295
Bawls or Ramune
>> No. 6307
MONSTER ENERGY RAWR I'M SMART AND FUN


File 125851754685.gif - (19.20KB , 335x296 , Visual-Basic-Objects.gif )
6156 No. 6156 hide watch expand quickreply [Reply]
This is a script I found that changes the target paths of all shortcuts in a directory. It works, but is there anything I can add/change to make it affect subfolders as well? I might also need it to change the "Start In" path.

strComputer = "." strDrive = Chr(39) & "E:" & Chr(39) strPath = Chr(39) & "\\Programs\\" & Chr(39) strExt = Chr(39) & "lnk" & Chr(39) strOldTarget = "E:\" strNewTarget = "C:\" strQuery = "Drive = " & strDrive & " AND Path = " & strPath & " AND Extension = " & strExt Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colFiles = objWMIService.ExecQuery _ ("Select * From CIM_DataFile WHERE " & strQuery) '& " AND Path = " & strPath & " AND Extension = 'lnk'") For Each objFile in colFiles Set objShell = CreateObject("WScript.Shell") Set objShellLink = objShell.CreateShortcut(objFile.Name) strTarget = Replace(objShellLink.TargetPath, strOldTarget, strNewTarget) objShellLink.TargetPath = strTarget objShellLink.Save() Next

4 posts omitted. Click Reply to view.
>> No. 6302
bump?
>> No. 6303
Recursion is the most fundamental form of looping. In practice, it's a function which calls itself.

For example, if we (naively) view the filesystem as a binary tree, the psuedocode would be this:

TreeNode { TreeNode left, TreeNode right, List shortcuts }

changeTargetPath(TreeNode):
// Change all the target paths in TreeNode
if hasLeft(TreeNode)
changeTargetPath(left(TreeNode))
if hasRight(TreeNode)
changeTargetPath(right(TreeNode))

Well, you get the idea.
>> No. 6304
>>6303
I do get the idea, but like I said, I'm unfamiliar with VB and I'm not sure how to translate that to fit my needs. I was hoping somebody who knows how I'd code it would come in here and post the code for me to add.


File 125870181691.jpg - (31.06KB , 435x272 , shot4.jpg )
6278 No. 6278 hide watch quickreply [Reply]
how hard would it be to write a passive sonar program to use a stereo mic (or a bank of them) to capture loud sounds like glass breaking or a car backfiring and identify the location? thnks
>> No. 6279
Read this http://waterloolabs.blogspot.com/2009/08/fps-with-real-guns-episode-02.html they used three accelerometers to play FPS with real guns. They have code there too.
If you don't need much precision it shouldn't be too hard, software-wise. I think the hardest part would be minimizing the number of mics while retaining enough precision and making it work cheaply (no idea how much a mic hub would cost).
>> No. 6299
That sounds fucking awesome. Really, it does.
>> No. 6301
If you find a way to hook up the sonar to your computer, it wouldn't be hard at all.


File 125867487348.jpg - (123.23KB , 500x656 , linux-device-drivers-3rd-ed.jpg )
6227 No. 6227 hide watch expand quickreply [Reply]
hey guys, its linux device drivers time. i am missing something very essential to understanding how these work, hopefully you can enlighten me.

in a simple character driver, i understand that when you try to read the file in /dev/ it is redirected to the read function you specify within the driver, which should look something like this:

static ssize_t char_read(struct file * file, char * buf, size_t count, loff_t *ppos){...

so my question is how do invoke this in a c program? say i were to fread the file in /dev/ from a c program, how does the corresponding char_read function in the driver get the right argument values? the signatures for fread and for the driver's read function are totally different. how can i tell the driver what count and *ppos should be? i need the driver to copy a range of digits to the user, and it needs to know how many to generate and where to start reading.
4 posts and 1 image omitted. Click Reply to view.
>> No. 6253
right so calling fread like this (where size is passed to main in the c program):

fread(buffer, sizeof(char), size / sizeof(char), file_to_be_read);

causes the driver's count paramater to be set to 1024 and ppos to be set to 0 for any value of size under 1024. once size is over 1024, it sets count to 1024 and ppos to 1024 and the read function is called twice. what? all i need to be able to do here is pass a value to count and pass a value to ppos from the c program. once i can consistantly do that the rest of it falls into place. i'm relatively sure fread is what i should be using to read the file, does anybody know how i can call it so that the driver's read receives the right values for count and ppos?
>> No. 6282
>>6253
The kernel probably use some kind of buffering. Why do you need it to return something specific?
>> No. 6293
>>6282
apparently thats the way its supposed to be done (its for a class) originally i just had the driver churn out the digits endlessly and then just fseek'd it and fread the section i wanted, and it worked perfectly. apparently the driver itself is supposed to return the substring. i'm going to ask about it today though i feel like that can't be right, it doesn't make any sense.


File 125814705191.jpg - (170.25KB , 1790x1005 , coding_02.jpg )
6034 No. 6034 hide watch expand quickreply [Reply]
Lets learn coding, total noob with no life and i could be super awsome coder but im way to lazy !
i totaly need some kick in the ass!

why not learn together ? evry one can add some stuff to it maybe its getting good
44 posts and 4 images omitted. Click Reply to view.
>> No. 6284
>>6281
Looking at it from a purely learning perspective, if the goal is the learn to program, to really learn the concepts, wouldn't it be best to pick the language that we can apply a lot of concepts to? Object Oriented is a very important concept to learn in terms of programming. And you can argue that C is less efficient than C++, but lets face it, on our scale, that's really not that important, and what's important is the conceptual points and not the actual language itself.

One can learn all the concepts that C++ has to offer and apply that information to other programming languages as needed. If someone is in need of a more efficient language, its pretty easy to go from C++ to C. It's a bit more difficult to go the other way around because if you go for a strictly procedural language like C, moving to an object based language is much harder.

Even in terms of a learning experience, you start learning C++ by essentially learning procedural coding, in other words you learn C, but there are some difference in the language that would show later on in the learning experience.
>> No. 6285
>>6284
How about from/to Visual Basic?
>> No. 6291
cpp it is then

Now what?


Delete post []
Password  
Report post
Reason  
Previous [0] [1] [2] [3] [4] [5] [6] [7] [8]