Typically when I work on a client's website they have already got several working php pages which select or insert data from a mysql database. More often than not, I see people using very unsafe methods of inserting their data. In this tutorial I ...
A LAMP server is short for a Linux Apache MySQL PHP server. It is basically just an Apache web server with PHP and MySQL installed on it running on a Linux platform. In this tutorial we will be installing the LAMP server on Ubuntu but the same ...
Being a former freelance web developer, I’ve worked with many clients and many servers. As you can probably imagine, I saw a lot of passwords on a very regular basis. Every client typically has a MySQL, FTP, and hosting Control Panel login and ...
Code:
; Game of 8.
; The game where you have a 3 x 3 grid with 8 numbered tiles
; One space is blank and you have to order the rest of the tiles
; numerically (or if the tiles are painted, complete the picture)
(define theGoal #(1 2 3 4 5 6 ...
So you're trying to write an AI for a game, let's say tic-tac-toe, so that a human can play against your AI and not feel like they're playing against a retarded monkey. This is much easier to do than one might think.
Tic-Tac-Toe
Organization:
...
My AI definition
Code:
; Does not implement alpha-beta-pruning
(define *zok-ai-def*
(lambda (player timeleft)
; It's not that they're "infinity" they're just out of the domain of eval-state
(define -inf -9999999999999999)
(define +inf ...
Because SO many people have been asking me questions about my calendar scripts, I figured I'd post the code here:
Here's an annotated version (highlighted version at:
http://pastebin.org/42847):
Code:
function print_cal($month,$year) {
...
I wrote some code to mess around with the way icons are displayed on your desktop. Now you can display icons as if you were looking at them in explorer with detail and list view. You can also turn off icons and keep just the text.
Written in C++, ...
I wrote this command-line utility for changing your desktop wallpaper to go along with a batch-driven shell I was programming many moons ago. It's fairly straight forward. Written in C#.
Code:
using System;
using ...
Similar to the one found in java.math.BigInteger. This was originally supposed to be a part of .net 3.5, but they removed it for reasons I can't remember.
This code also contains a usage sample.
TrueScript is a pair of programs and a library for immediate execution or on-the-fly compilation of local or remote scripts written in a .Net language. All immediate execution scripts are sandboxed at the same level as your local computer's ...
Redirect the output of a command to a file and detaches it from the parent process.
(Can be used to make an application continue running even after logout)
Code:
#include <stdio.h>
#include <unistd.h>
#include ...
I'm currently working in the textile recycling industry.
We have many boxes scattered around Sacramento and the central Valley where people can drop off used clothes and shoes. We collect the clothing and shoes and then resell them as
credential ...
I wrote this program to learn how to read hiragana while living in Japan. It is currently geared specifically toward hiragana, but the code is set up to allow for easy integration of other character sets such as katakana, kanji, cyrillic, etc.
It's ...
A simple low-level keylogger that only uses functions from kernel32.dll which is loaded in to every process' virtual address space. Keys are stored to an alternate data stream under the system32 folder. This stream cannot be deleted without ...
Writing something for work, I found the need to search a list of objects. Here's the function I wrote:
Code:
def Select(SearchList = [], **SearchTerms):
for SearchKey, SearchValue in SearchTerms.iteritems():
SearchList = [SomeObject ...
I don't know if anyone will find this useful but this is the completed first project for my Comp 3160 class. It is sort of commented well.
It contains examples of how to:
Load data from a text file - Parser.java
properly form a binary search tree
...
I just posted this in NS&H, but it's a proof of concept that it doesn't take much to create your own captcha cracker, for use in bots and whatnot. The captcha that's in it (slpctrl.freehostia.com/captcha.php) I'm not sure if I had completely ...
I've been coding in C++ for a while now and started learning OpenGL. Basically I just torrented a PDF copy of 'Beginning OpenGL game programming' and have been following through it. Does anyone else know of any really good sources of information on ...
With this script you can put a bunch of pics in a folder and this will randomly display them just insert wherever you want it to show up in your webpage. It supports jpg, png, gif and html.
Just save the following code as rotate.php and put it in ...
A PHP class for the mail() function with support for HTML emails and easy file attachment syntax...
Example to send a Plain Text / HTML Email
Code:
<?php
require_once('email.class.php');
# Message Variables
$email_address = ...
Here's a PHP/Javascript adaptation of a Wolfenstein type engine adapted to PHP from this tutorial
http://student.kuleuven.be/~m0216922/CG/raycasting.html. Ray Casting, as opposed to Ray Tracing, is a very efficient, low resource way of projecting a ...
Got bored, made this in five minutes..
I seriosly need some idea's for projects.
Anyway, have at it;).
http://pastebin.com/f5d1f519e
Code:
#include <iostream>
using namespace std;
int main()
{
int input;
cout << ...
Hi, I recently needed to import a bunch of names & addresses into Google Earth. The Pro version has this option, but the free version does not. So, I looked at the Google Maps API tutorial and modified it to suit my purposes.
This takes a CSV ...
I'm a n00b at programming in C, and I wanted help trying to delete a certain folder in a certain path.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
void Give()
{
char answ[20];
...
About as simple as it gets but it gets the job done.
Code:
function bbcode($replace)
{
include ("include/getvars.php");
$bbcode = array(
"'\[center\](.*?)\[/center\]'is" => ...
Code:
<?php
function convertToUnixTimestamp($dcDate) {
# dcDate is in the format YYYYMMDDHHiiSS
$unixTimestamp = mktime(substr($dcDate,8,2), substr($dcDate,10,2), substr($dcDate,12,2), substr($dcDate,4,2), substr($dcDate,6,2), ...
These ten lines allow you to access $_GET style data in situations where $_GET is not populated as usual (I wrote this to get around such a limitation in smarty)
Rather than using
...random_script.php?var=1&other=2
you would do
...
As I am eagerly awaiting admittance into The VIP Lounge I need to keep track of my post count. That being said, it's far too much work to constantly check my profile page. Unfortunately, Zoklet does not give you your post count anywhere else that I ...

I've just finished the second version of my Zoklet post count
Greasemonkey script. Per 1337's request it now displays the post count of each user in a thread as well. To facilitate this, it makes use of a simple caching mechanism.
There are still ...

I've just finished the second version of my Zoklet post count
Greasemonkey script. Per 1337's request it now displays the post count of each user in a thread as well. To facilitate this, it makes use of a simple caching mechanism.
There are still ...
UPDATE:
4cdl now backs up the original thread and rewrites links to work with archived images!
Version 6 has been released, same link!
UPDATE:
http://cal.freeshell.org/2009/12/4chan-image-downloader/
Now available as executables(windows) via ...
Attached is a simple, no-frills launcher application for Windows. It will open programs, documents, URLs, and run console commands. No installation necessary, just run the binary. It's not perfect, but it works just fine for me.
I've included the ...
Digging through some old code, came across this little gem I wrote. This is a small program that allows you to manipulate any open window. With this software, you can force windows to be always on top (or prevent windows from being always on top), ...
When a user scrolls down the page on slashdot, older posts will load below so the user never actually hits the bottom of the page. I have duplicated this in greasemonkey for zoklet.
Try it out with this thread:
...
just install "9menu" and this is simply point and click... edit the files in the folowing posts to fit your needs as according to this script.....and the prophesy.
Code:
9menu '/etc/init.d/apache2 stop' '/etc/init.d/apache2 start' ...
I wrote a "stealth" ssh worm, it should be fully undetectable from IDSs because it doesn't try to bruteforce the password. Instead, it enables SSH multiplexing on the infected hosts and listens for a ssh connection to be made. Then it ...
I wrote this > 2 years ago when gigaloaders were popular, just recently remembered it. I have never seen anyone make something quite like this, so I figured eh might as well post it. It's pretty simple, but could be relatively powerful if you ...
I just wrote this at work and I figured that someone else might have a use for it eventually. It's not very efficient, but it gets the job done.
I've written a small python module to connect to a MS SQL server over ODBC and export all of the data in a table into a csv file (with column headings).
You will need to download and install
pyodbc first.
Here is the code:
As a server admin, often times you will want to implement a script that will kill long SQL queries - queries that cause table locks that build up requests, eventually using up all the available connections and bring down the server.
This is a small Python module that lets you get GPS data using the XML RPC client
of your choice. This is for Windows. If you're on Linux, just use
gpsd.
It requires the
pySerial module and the NMEA parser module from
pygps.
I've only tested it ...
Code:
for(0..255){print(chr) if((25*(27/9))-1==$_);
if(m/^[^421503679]+?[435]+?$/){push@aa,$&;}};
unshift@aa, pop@aa;for(@aa){print(lc(chr));};
for(-5..$aa[0]){m/[4A][0B]/?print chr ...
http://cal.freeshell.org/2010/04/python-criagslist-search-script/
It's a pretty simple script. It performs a search for your query on any number of areas.
Start the script and enter the cities you want separated by commas but no spaces:
...
This class allows you to raise any event on any thread without illegal cross-thread operations. It allows you to update UI components on separate threads without temporary object instantiation or locking.
Code:
using System;
using ...
Okay firstly I'm not a programmer. I just want to get an idea about people in here. It would be interesting.
I am a 'heavy' PC user usually with the newest hardware and software going, I use a computer at home as well as at work - But I'm not ...
I've been programming with Flash for a while now and I don't see many Flash developers in Zoklet, so I thought I'd share some knowledge. I've never written a tutorial so give me a break. Also, this might be oriented towards people who have some ...
Attached are two ZIP files containing source code and binaries (debug and release builds) for two different utilities:
- PortProbe does just what it says: it attempts to connect to a single TCP port on a single host. If it can, it will tell you the ...