feed   myspace   facebook   last.fm   send an email   twitter   tumblr   send a message via aim to graykicksass

Writing webapps in QuickBasic 4.5

Disclaimer: I realize this has no real valuable use whatsoever.

First off, credit where credit is due, when I initially had to setup the CGI I ran into a problem solved buy a guy on reddit, who managed to write a website clone in quickbasic. You have to do a simple C++ stub app that can direct the output from quickbasic apps into the server.

In order to pull this off, you’ll need a copy of the following tools:
1. Dev C++ (For compiling the stub app, to make your life easier, grab the one with a compiler built into the install) here

2.Quickbasic 4.5 (capable of generating EXE files) here

I also recommend xampp, very quick installation, works perfectly for this example. Grab it here


Now, to actually install quickbasic from this zip on windows, you have to create a fake A drive, or copy the files to a floppy.

The trick to doing this is a command line trick called subst

So, copy the quickbasic disk1 folder from the download, place it in a folder on C: like, FLOPPY1 and run this:
subst a: C:\FLOPPY1

Run the quickbasic setup app on the fake disk, when prompted to insert another disk, copy the contents of disk2 into the fake drive. Hopefully you’ll be able to run quickbasic now, and be greeted by this screen:

QuickBasic 4.5 welcome screen

QuickBasic 4.5 welcome screen

Once your in quickbasic, navigate the menus with ALT or your mouse, type out this simple program:

PRINT “Content-Type: text/html”
PRINT “”
PRINT “”
PRINT “
<h1>Hello World!</h1>

PRINT “”

Move over to the run menu and hit make EXE file, save your app. The app will be in the saved file directory, take it, rename it something simple (e.g. ‘app.exe’) and close.

Now, open up dev C++, navigate to File->New->Project and select console application, select C++ for the language, copy and paste this code into main.cpp:

#include <iostream>
#include <string>
#include <stdio.h>
int main(int argc, char *argv[])
{
std::string piper;
FILE* data = popen(“app.exe”,”r”);

for(char c = getc(data);c != EOF;c = getc(data))
{
piper.push_back(c);
}
pclose(data);

std::cout << piper;
return 0;
}

Press ctrl+F9 to compile or select compile from the menu. Open the directory where you saved the project, and copy the generated EXE file over to your cgi-bin directory (in htdocs for apache, with xampp it’s in the root directory of xampp/cgi-bin).

Now, with the stub in cgi-bin, rename your compiled quickbasic app to ‘app.exe’, and copy it to cgi-bin. Navigate to http://localhost/cgi-bin/stub.exe where stub.exe is whatever your compiled C++ application is called, you should now see a screen something like this:

hello world from quickbasic

hello world from quickbasic

Now you can run your webapps and display output in the browser, all you need now is to parse CGI variables, which is done via the ENVIRON$ function.

PRINT “Content-Type: text/html”
PRINT “”
PRINT “”
PRINT “
<h1>Hello World!</h1>

PRINT ENVIRON$(“QUERY_STRING”)
PRINT “”

QUERY_STRING is set by the CGI gateway, accessing this page with a url like http://localhost/cgi-bin/qload.exe?bla would print:
“Hello World! bla”

This has no real practical use anymore, but it’s just interesting to try out. Also, sorry about the code blocks here being screwed up, wordpress managed to mangle them.

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

X-ID3 header in modern web servers

I’ll keep this post short and straight to the point, it just seems like this idea should have followed suit right after streaming media became a common feature in HTTP Servers (e.g. lighthttpd).

With the standard format for online music being MP3 files, and the versatile format of streaming MP3’s (can be played while downloading), I see no reason why we shouldn’t be able to add some minimal support for these files in the web server.

It seems like a good idea to me to build an apache module in for MP3 metadata. It could be configured / disabled & enabled via the apache.conf file, preferably something that works with ID3 and HTTP headers. Which is why I propose the x-id3 header standard.

It should be simple enough, basically parsed Mp3 metadata in the Id3 format, passed in the HTTP headers in the following format:

x-id3-(id3 field name): Content

Just like every other HTTP header, I don’t know. Seems pretty basic and overlooked to me. I’d like to hear your thoughts though, so leave a comment with your opinion / ideas.

[Disclaimer: wrote this after pulling an all-nighter, so if it's written poorly, my bad]

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

Welcome to 2010. (And some new years resolutions..)

Howdy,

Man it’s been a while since I posted, so much on my plate and not a ton to post about. And the whole ‘not having time’ thing. Since I last posted we made it to 2010. Hell yea!

In my last year of blogging, looking back I did some pretty stupid stuff. Especially as far as my code went. Yikes.. But, although a bit late, this year I will actually set some solid new years goals that I can hopefully meet.

  1. By midyear, I hope to have a consistent revenue stream from online worth monthly. i.e. earning $xxxx a month. Would be nice to have a steady income stream.
  2. Be more successful with managing money.
  3. Post more on my blog in 2010, blog neglect must end!

Hopefully I’ll be able to stick to these ones, it shouldn’t be *too* hard.  Also, hopefully I should be back into the posting routinely scenario next week.. Maybe..

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

Watch the week, #1

Howdy,

So now that I’ve started blogging a bit more recently, I thought it was about time I come up with some weekly ritual-ish type of thing to do so that I get an incentive to post interesting content.

What I came up with, was ‘watch the week’. Basically I will post and embed what I’d say are pretty damn good shows/movies. You’ll see them all for the most part here, with no ads or popups.

For each one I post, I’ll do about a paragraph review to go with it. Just so you get a feel for what your about to watch. I’ll also give each a rating out of 5.

So then, I’ll get started with the first one ever:

TV Series:

I’ll open this one with a pilot episode I just finished watching:

Show: White Collar
Hulu’s Description: When the trail of elusive criminal “The Dutchman” deadends, FBI Agent Peter Burke teams up with a most unlikely partner to catch him; the imprisoned Neal Caffrey: master criminal, con man extraordinaire and Peter’s most accomplished collar.
Hulu Rating (At time of writing): 4 out of 5.
My Rating: 4 out of 5.

This episode is a very interesting pilot, for what looks like it will be a good season. Coming from USA network, which is starting to push some good ideas for new shows, this looks to be another good one.

Movie of the week:

For this one, I’ll go with a movie I just got around to watching based on reviews. It came out in 2000 but I hadn’t heard of it and don’t know how many people have seen it:

Movie: Boiler Room
IMDB Plot: A college dropout gets a job as a broker for a suburban investment firm, which puts him on the fast track to success, but the job might not be as legitimate as it sounds.
IMDB Rating: 6.9 out of 10
My Rating: 4 out of 5.

This is a very interesting movie to watch, the story moves quickly and is narrated in a style similar to ‘Fight Club’. As a forum member put it, ‘It’ll make you go out and want to make a million dollars.’ Well worth the watch.

Anyways that’ll wrap it up for this first post. Just keeps getting me thinking what I should do with this blog. If you got anything you think would be cool to watch / listen to, feel free to drop a comment!

Ciao,

- Gray

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

Axcid Search Engine

Sup,

So last night (10-20-09) I made a tweak to the search engine part of Axcid that greatly improved the service. So before yesterday, keyword searches such as:

mac dre, dr dre, rem

would return nothing. Also words under 4 letters in length weren’t counted, resulting in less relevance in search results & various other bugs. Last night I set out to correct that and did so successfully.

You’ll notice that specific searches now get more results, as well as the searches above which before returned nothing, now all return results.

This is just another step for Axcid’s future as a search engine, it gets better nearly every day.

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

This is clearwire

Alright, I’m fed up with this god damn service!

I have called ‘tech support’ many times and heard all kinds of crazy stories & ideas on how to fix my connection issues including but not limited to:

- Duct tape modem to window
- ‘Your modem is connecting to a tower across the lake when your surrounded by them’..
- ‘We know it’s slow’
- Youtube is not considered ‘normal internet use’

This bullshit is coming from a company that pitches ‘go beyond 3g’ on their billboards. If anyone wants proof t-mobile’s 3g on a wifi tether is faster then this feel free to drop a comment, but rest assured it kills it.

Clearwire reps/tech support also admit that it is slow and much slower then T-Mobile’s 3g. They make claims about Wi-Max but I doubt that service will be better. Not to mention it hasn’t rolled out yet.

Let’s just see the average day on clearwire’s speedtest:
Clearwire Speedtest

Which is about 1/3 the speed of decent dial up. Ugh.

This is with 5 out of 5 bars on the modem by the way. And this is on a day when the internet service itself actually works, outages are regular occurrences. I’m also on my second modem, due to the other one completely failing to connect _at_all_ after several months of use.

I have NEVER received the ‘1.5′ mbps of speed my service plan dictates. Yesterday, a 10mb download ended up taking 2 hours.

This is, without a doubt, the worst internet service I’ve ever used.

Edit:

So I decided to speedtest T-Mobile’s 3g to compare. A couple things first:

- Contrary to the image, I am not in kansas.
- The ping time went down about 200ms on average after I did this test.
- This is the WORST it has ever been (Tethered 3g), although it still kills clearwire it’s not SUPER fast.

T-Mobile's 3G

The proof is in the pudding here.

Edit Again:

So about a day after posting this (19 hours), my internet speed suddenly increased beyond anything it has before. Ever in 2 years of having it:
Clearwire's New Speed

I also noticed the amount of bars went from 5 to 3, and the speed increased significantly. Meaning the tower I was connected to changed, although the positioning of the modem did not. I find it a bit odd that the time I get the fastest internet I have had comes a day after posting this, but that’s a bit I’m not going to touch on.

Ciao,
Gray

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

Riptune

It’s like tunebin was a while ago:

http://riptune.org/

+ the conf*ulator radio/playlist thing. powered by the wonderful and awesome axcid.

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

@Android Developers

http://developer.yahoo.com/everything.html

It’s all there. Prettymuch everything that needs to be replaced. Collective effort anyone?

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

Android got screwed over

Let me just start by saying, since the start I have been an android supporter, and have invested a good $1000 or so into the platform as far as phones go.

Anyways, I did not use the ‘official’ rom, I used the rooted Cyanogen Mod. Which just received a cease and desist order from Google. Google’s official response seems to boil down to ‘Android is open, but google apps are not’. The bottomline being the phone doesn’t really function without those apps.

So here’s whats out:
-Contacts Sync
-Maps
-Youtube
-Gmail
-Google Talk
-And last, but most important, the ‘android market’

And anything else not in the android source tree.

Most of the community could probably live without those except android market, after all, the latest maps.apk can be downloaded and installed from android market. Without the market there is no consumer friendly way to install apps on the phone. Ouch.

Some people (Including myself) have kicked around the solution of rebuilding those apps. I personally like that idea and the idea of a ‘google stripped’ android. Most of what they provided could be recreated with public API’s.

It’s just something to think about though, with no real commercial open mobile os, developers are being placed in a walled garden no matter where they go.

I guess it’s a waiting game now for a developer to start the ‘openandroid’ tree or whatever it will be called. But I look forward to the day when that project starts with curiosity.

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr

Rebuilding a HTC Music Adapter (EMU Headphone Adapter)

Wassup?

After having at _least_ THREE ‘g1 headphone adapters’ die on me within the space of 5 months, and having to spend more then $10 a piece to replace them, I got sick of paying for these rubbish wires. The phone is great but the headphone adapters are not, but I managed to pull my self a Hi-Fi one with just a bit of DIY and Tape.

What you need:
(Minimum)
- A lighter
- Electrical Tape
- Wire Strippers
- Something with a 3.5 audio jack on the end (In my case, half of a audio splitter)

Connecting the wires:

First at the tip of each wire you see after stripping the coat from the original EMU connector cord, run a flame from the lighter under the wire until it catches fire, then blow it out. This exposes the wire by removing the chemical coating.

The annoying part about these (And I didn’t care to do much trial and error as to what does what) is that with Android, if several wires are not connected it won’t detect it as headphones.

In order to wire this up, you should have left, right and ‘center’ (gnd) coming from your 3.5 jack. See picture (http://graysblog.org/wp-content/uploads/2009/09/IMAG0010.jpg). All bronze / semibronze wires should be tied together and used as the gnd/center (at the ends where they were opened by burn). The blue and the white wire are microphone / button wires. You can safely set them aside.

The red(Organish) and green wires are respectively, right and left channel. See picture.

Wires all done:

In Progress

http://graysblog.org/wp-content/uploads/2009/09/IMAG0010.jpg

Taping it all up:

Alright this is pretty simple, the way I like to do it is a strip of tape on every separate connection you make, then tape everything up. I’d advise listening to the headphones while doing this, the risk of shortage is low and it ensures that it works. No solder or mess. And for lazy people like me little work

Finished Product

And.. It's done

And.. It's done

Surprisingly this works well, and the audio quality is great.

I apologize for the crap quality of this ‘miniguide’, I was rushed and just wanted the info out there

References:
(Soldering the wires)

http://hackaday.com/2009/05/24/soldering-headphone-wire/

http://www.alexwhittemore.com/?p=205

(Pinout)

http://androidforums.com/t-mobile-g1/4480-how-create-emu-3-5mm-headphone-jack-adaptor.html

Think this post is actually worth something? Why not share it?
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Twitter
  • StumbleUpon
  • Current
  • E-mail this story to a friend!
  • HackerNews
  • MySpace
  • Turn this article into a PDF!
  • RSS
  • Technorati
  • Tumblr