Forum Settings
       
Reply To Thread

Break meFollow

#27 Mar 24 2006 at 1:25 PM Rating: Good
Techincally, wouldn't returning all user PM's be the simplest?
#30 Mar 24 2006 at 1:30 PM Rating: Excellent
Code Monkey
Avatar
****
7,476 posts
The sad part is, I made it just to look for a PM from somebody...

...but by the time I finished writing the code, I forgot what I was looking for
____________________________
Do what now?
#31 Mar 24 2006 at 1:33 PM Rating: Good
I wish I could say I've never done that.
#32 Mar 24 2006 at 1:38 PM Rating: Decent
****
4,596 posts
Quote:
The sad part is, I made it just to look for a PM from somebody...

...but by the time I finished writing the code, I forgot what I was looking for


No big deal, It was just asking when you planned on giving me my 6.3 back. You didn't have to write a search engine to find find it, you could have just asked me what it said. Sheesh...
____________________________
Nicroll 65 Assassin
Teltorid 52 Druid
Aude Sapere

Oh hell camp me all you want f**kers. I own this site and thus I own you. - Allakhazam
#33 Mar 24 2006 at 1:40 PM Rating: Decent
***
1,254 posts
I just wrote a Java app to take all the linebreaks out of a file, because I don't know how to use VI or really anything about PERL.

Sad thing is I had a file buffer problem and had to copy the results from the console.

The file had 204,000 characters, on over 11,000 lines. I wasn't going to do it manually. Stupid large XML message.
#36 Mar 24 2006 at 1:53 PM Rating: Good
***
1,863 posts
searched for:

%20


brought back:

Messages TO eq420
Subject Sent Size

Messages FROM eq420
Subject Sent Size


No messages in either category, and I've never received correspondance from anyone with that name.

===============

search for:

%\k


brought back:

Messages TO aaabank
Subject Sent Size
Messages FROM aaabank
Subject Sent Size


===============


Same deal, none in either category. Looks like if the search matches a valid username it presents the "subject sent size" thing even if no messages are returned.

Also, the search field handles regular expressions in a very interesting way.

Edited, Fri Mar 24 14:00:14 2006 by Wingchild
#37 Mar 24 2006 at 2:11 PM Rating: Good
Gurue
*****
16,299 posts
C:\DOS

C:\DOS run
#38 Mar 24 2006 at 2:44 PM Rating: Excellent
Code Monkey
Avatar
****
7,476 posts
Wingchild wrote:
Also, the search field handles regular expressions in a very interesting way.


It's the default mySQL way.

You're right though, if there's no results I shouldn't print any headers.
____________________________
Do what now?
#39 Mar 24 2006 at 3:03 PM Rating: Good
****
4,596 posts
Quote:
Your project in perl


#!/usr/local/bin/perl

my $output_file = "output_file.txt";
my $input_file = "input_file.txt";
my $textdump;

open(INFILE, "$input_file") or die "Can't open $input_file: $!";
open(OUTFILE, ">$output_file") or die "Can't open $output_file: $!";

while (<INFILE>){
$textdump .= $_;
}

$textdump =~ s/\n//ismg;

print OUTFILE qq($textdump);

close INFILE;
close OUTFILE;


Your project in VBScript:

 
Const ForReading = 1 
Const ForWriting = 2 
 
Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set objFile = objFSO.OpenTextFile("c:\urfile.xml", ForReading) 
 
strContents = objFile.ReadAll() 
objFile.Close 
 
strContents = Replace(strContents, vbCrLf, "") 
 
Set objFile = objFSO.OpenTextFile("c:\urfile.xml", ForWriting) 
objFile.Write strContents 
objFile.Close 


Edited, Fri Mar 24 15:04:46 2006 by xythex
____________________________
Nicroll 65 Assassin
Teltorid 52 Druid
Aude Sapere

Oh hell camp me all you want f**kers. I own this site and thus I own you. - Allakhazam
#40 Mar 24 2006 at 3:13 PM Rating: Excellent
Code Monkey
Avatar
****
7,476 posts
Your project in Real Man's perl:

perl -pe 's/\n//;' infile > outfile

Edited, Fri Mar 24 15:21:09 2006 by Danalog
____________________________
Do what now?
#41 Mar 24 2006 at 3:17 PM Rating: Good
****
4,596 posts
Quote:
Your project in Real Man's perl:


My VBScript is longer than your perl...
____________________________
Nicroll 65 Assassin
Teltorid 52 Druid
Aude Sapere

Oh hell camp me all you want f**kers. I own this site and thus I own you. - Allakhazam
#42 Mar 24 2006 at 4:07 PM Rating: Good
What do you have in place to avoid an SQL injection line (beyond 30 char max)? Do you parse out special characters from the search variable before you seed your SQL string?
#43 Mar 24 2006 at 4:14 PM Rating: Good
***
1,863 posts
If it's accepting % on the search line, I'd argue that special characters aren't being stripped yet.

Actually allowing % is kind of fun as it lets you do some pattern matching (if you can only remember part of someone's name), but the tool as-written stops at the first name matched.

i.e., if I search for kao% I will get the header for all messages to/from Kao, but not Kaol, Kaoli, or Kaolian.
#44 Mar 24 2006 at 4:19 PM Rating: Excellent
Code Monkey
Avatar
****
7,476 posts
there's a quote() function that does all that for us.... pretty much every single query on the site either has an explicit "$::db->quote($string)" or an implicit "$query->prepare(qq(blahblah ? borkbork ?)); $query->execute($var1,$var2)"
____________________________
Do what now?
#45 Mar 24 2006 at 4:24 PM Rating: Good
Danalog the Vengeful Programmer wrote:
there's a quote() function that does all that for us.... pretty much every single query on the site either has an explicit "$::db->quote($string)" or an implicit "$query->prepare(qq(blahblah ? borkbork ?)); $query->execute($var1,$var2)"
Wonderbar.
#46 Mar 24 2006 at 4:28 PM Rating: Excellent
Code Monkey
Avatar
****
7,476 posts
your project in assembler (nasm, to be specific):
 
extern getchar,putchar 
global main 
main: 
    call getchar 
    cmp eax,-1 
    jz done 
    cmp eax,0xA 
    jz main 
    push eax 
    call putchar 
    pop eax 
    jmp main 
done: 
    ret 


Edited, Fri Mar 24 16:35:07 2006 by Danalog
____________________________
Do what now?
#47 Mar 24 2006 at 4:34 PM Rating: Good
D4n4l0g the V3ng3ful Pr0gr4mm3r wrote:
My nerd > your nerd.


Fixed.
#48 Mar 24 2006 at 4:41 PM Rating: Excellent
Code Monkey
Avatar
****
7,476 posts
your sig is way too damn long
____________________________
Do what now?
#49 Mar 24 2006 at 4:44 PM Rating: Good
Danalog the Vengeful Programmer wrote:
your sig is way too damn long
I didn't set the limits, I just work with them. Smiley: tongue
#50 Mar 24 2006 at 6:23 PM Rating: Good
I broke it.

Enter this in the user box:
<a href="Foo.html">Hi</a>
#51 Mar 24 2006 at 9:03 PM Rating: Excellent
Code Monkey
Avatar
****
7,476 posts
Stunted Quick Hands wrote:
I broke it.

Enter this in the user box:
<a href="Foo.html">Hi</a>


good catch, fixed
____________________________
Do what now?
Reply To Thread

Colors Smileys Quote OriginalQuote Checked Help

 

Recent Visitors: 259 All times are in CST
Anonymous Guests (259)