Warning: mysql_real_escape_string(): No such file or directory in /home/vincentprimecom/vincentprime.com/wp-content/plugins/easy-google-syntax-highlighter/easy-google-syntax-highlighter.php on line 50

Warning: mysql_real_escape_string(): A link to the server could not be established in /home/vincentprimecom/vincentprime.com/wp-content/plugins/easy-google-syntax-highlighter/easy-google-syntax-highlighter.php on line 50
Blog « Vincent Prime
Welcome to Vincent Prime.com
Latest |
Why SOPA will have Zero effect on Piracy - 

SOPA Blacklisted domains will be blocked by denying DNS requests. DNS (Domain Name System) is essentially a phone-book relating easy to remember words, to static Internet addresses. Just like in a phone-book, if you deny access to a record the web site’s IP address (phone number) will still work. The IP address will still continue […]

Filed under: How To,Random
Tags:
By Vincent on December 30, 2011 @ 3:10 am

Why SOPA will have Zero effect on Piracy

SOPA Blacklisted domains will be blocked by denying DNS requests. DNS (Domain Name System) is essentially a phone-book relating easy to remember words, to static Internet addresses. Just like in a phone-book, if you deny access to a record the web site’s IP address (phone number) will still work. The IP address will still continue to work without a DNS record. If users just use a different phone book, or write the address down somewhere else; they could still access the blocked websites like nothing has happened.

As a user you can write your own “phonebook” that is SOPA safe by editing your operating system’s hosts file. It’s essentially the same as writing a name and phone number down on a sticky note.
In windows this is in C:\windows\system32\drivers\etc\hosts
In Linux & Mac OSX it’s in /etc/hosts

Knowing this

  1. SOPA only affects DNS systems that the US Government can control.
  2. DNS is not required to access other machines across the Internet.
    – DNS is used as a human friendly way to get the address to a server’s location, and to choose a particular service on that server.
  3. While DNS names are required to access many web services using shared IP addresses, it doesn’t matter where you get an IP address for a DNS name just as long as that IP address is correct.
    – For SOPA blocked sites, a user can edit their hosts file to include the domain name and correct IP address.
  4. The users of the site could switch to an alternate DNS provider outside of SOPA’s control.
    – This is an easy 3 minute process that can be done to any OS or common household router. Here’s a guide from google, it can be adopted for any DNS provider.
  5. P2P Software systems used for piracy do not directly rely on DNS.
    – While DNS names may be used to connect to trackers, it’s not a requirement. Nearly all systems just use IP address to interconnect users, completely bypassing DNS.

While initially this will thwart some forms of piracy,  these pirates will very quickly move to alternative pre-existing SOPA safe methods that do not rely on DNS. Some of these include offshore USENET, IRC + DCC, Bittorrent, WASTE, and Freenet

The only people who will be hurt by this legislation are those who are not actually involved with piracy.



Filed under: How To,Web Development
By Vincent on July 29, 2011 @ 4:32 am

How to load more content whilst scrolling: like bing image search

This is great for any page that could contain potentially an large to infinite amount of data. When a user scrolls to the bottom of the page, in the background a javascript-server connection will feed more data to the page.

User facing page

<!DOCTYPE html>
<html>
<head>
<title>Scroll Forever</title>
<style>
.bump{
display:block;
border: 1px solid black;
padding: 10px;
}
.loading{
display:block;
border: 1px solid black;
padding: 10px;
background-color: green;
marquee-style: slide;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
index = 0; //The current position of the index
perPage = 40 - 1; //The count per page, we minus one because arrays start at zero.
contentSelector = "#content"; //The CSS selector for the content block
postSelector = ".bump"; //The CSS selector for each post
loadingSelector = ".loading"; //The CSS selector for the loading block
handle = "handle.php"; //The php file to get the JSON data from

function loadData(i,p,clear){
$(loadingSelector).show(); //Show the loading screen
a = typeof(clear) != 'undefined' ? clear : false; //Set to clear the page as false as the default.
$.getJSON(handle, //jQuery function to get JSON data.
{
"index": i, //The index
"max": p, //The maximum posts per load
},
function(data){ //Take the JSON data
var html = "";
var postId = 0;
while(postId < data.length){
html += "<div class='bump'>" + data[postId] + "</div>"; //Do something with it
postId++;
}
if(clear == true){
html += "<div class='loading'>Loading...</div>";
$(contentSelector).html(html);
index = index + perPage; //Advance the index to match the new data.
} else {
$(loadingSelector).before(html);
index = index + perPage; //Advance the index to match the new data.
}
$(loadingSelector).hide();
});

}

$(window).ready(function(){
loadData(index,perPage); //Initially load the data

var w = $(window); //Saving the context to a shorthand variable.
w.scroll(function(){ //When we scroll
if(w.scrollTop() + w.height() == $(document).height()){ //Check if the position is the bottom of the page
loadData(index,perPage); // If so, then we will load more data.
}
});
});
</script>
</head>
<body>The idea of this demo is to be able to continuously scroll through data.

For the demo, the javascript will grab new JSON data from a php file that just gives a larger and larger number.

<div id="content">
<div>Loading...</div>
</div>
</body>
</html>

Back end (save as handle.php)

<?php
/*
Handle.php - Part of the Continueous Scroll demo.
Spits a continueously larger and larger number in an array.
*/

if(isset($_REQUEST['index']) && isset($_REQUEST['max'])){
$start = $_REQUEST['index'];
$max = $_REQUEST['max'];
$i = 0;
$data = array();
while( $i <= $max ){
$data[$i] = $i + $start; //Heres a random note. I found that if you don't know how much you're expecting to get, it's eaiser to just start the array at zero. You can put a unique ID within a sub level array.
$i++;
}
} else {
$data = array(
"Error" => "Please post with the index and max argument",
);
}
echo json_encode($data);
?>

One idea for a modification, is to begin loading when the user is scrolled halfway through the newly loaded content. This way even newer content is loaded before the user even sees the end.

Click here to see it in action



Filed under: How To,Linux
Tags: , , , ,
By Vincent on June 16, 2011 @ 2:20 pm

Removing or Modifying svn client passwords

For how common this task is, it’s incredibly hard to find on Google. You’ll need to remember this for anytime you want to change your user account, password, or just delete your account from your subversion client. This works in Netbeans, RabbitVCS, and a majority of other subversion clients that just connect with the svn package.

  1. Open a terminal (This can be done in a file manager’s search tool, but I’ll show you how in a terminal so you get a better idea of how it works)
  2. enter the command
    grep -r "<HOSTNAME>" ~/.subversion/auth/

    (Replace <HOSTNAME> with the SVN’s hostname, so for instance http://svn.vincentprime.com/applepie/svn would be svn.vincentprime.com) Grep searches inside files for whatever you put in the ” “. The -r makes it recursive, so it will look through all the files in all folders deeper than where it was directed to at the end of the line.

  3. You will get a line that looks something like this
    /home/vincent/.subversion/auth/svn.simple/888c928072e9643a13b38ea43532896d:<http://svn.vincentprime.com:80> My Projects

    You want the path before the “:”

  4. Now just enter
    rm /home/vincent/.subversion/auth/svn.simple/888c928072e9643a13b38ea43532896d

    to remove the file, and have subversion forget your account credentials.

  5. Next time you run your subversion, you will be asked for your username and password again.


Filed under: How To,Linux
Tags: , , , , , ,
By Vincent on April 2, 2011 @ 12:40 pm

Writing a script to toggle a pointing device in linux

I recently purchased a new laptop, and installed Ubuntu Linux. There’s one major problem with the laptop; the trackpad is too sensitive and resting your palm will click the mouse. The computer includes a shortuct (FN + F9) to disable the trackpad, but natrally from linux this doesn’t work.

Here’s how you can solve this:

  1. You need to get the name of the pointing device that you wish to disable, so open a terminal and type “xinput list”. (Note: if you have a second pointing device plugged in, unplug it before running this command to prevent confusion.)
    Example: The trackpad that I wish to disable is called “PS/2 Logitech Wheel Mouse”
  2. Create a new empty document someplace where you will remember the location (I recommend placing this in it’s own folder), and both you and whoever else that may use the script has write access to the containing directory. Name the document “togglemouse.sh”. (I like to put helpful scripts within a “scripts” folder in my home directory, but if you have a multi-user machine then you could put it in a shared drive or directory.)
  3. Open the new document with a text editor, and paste the following script.
    #!/bin/bash
    mouse="/tmp/mymouse"
    if [ -e $mouse ]; then
    xinput set-int-prop "PS/2 Logitech Wheel Mouse" "Device Enabled" 8 1
    rm /tmp/mymouse
    else
    xinput set-int-prop "PS/2 Logitech Wheel Mouse" "Device Enabled" 8 0
    echo 1 > /tmp/mymouse
    fi
  4. Change where it says “PS/2 Logitech Wheel Mouse”, to the name of the pointing device that you found in step 1. Then save.
  5. Now to disable the pointing device, you just need to run the script. The script will check the temp directory for a file called mymouse, if the file exists then it will enable the mouse and delete the file, if the file doesn’t exist then it will disable the mouse and create the file.
    • If you’re using Ubuntu, you can create a keyboard shortcut to run this script by going to
      System > Preferences > Keyboard Shortcuts
      Select “Add”, write a descriptive name for the shortcut, place the location of the script in the command, hit ok, click the right column next to the new shortcut and press the keys desired for your new shortcut.

EDIT: Moved the location of the mouse disabled file into the temp directory (/tmp/mymouse), so it goes away on reboot.



Filed under: Game Development,Web Development
By Vincent on February 15, 2011 @ 6:38 pm

Constructing an JavaScript/HTML5 Isometric Game Engine

I’ve been taking on the task of creating an isometric game engine displayed in HTML 5’s Canvas and ran primarily on JavaScript. So far the venture’s been pretty sucessful. The hardest part is remembering the simple algebraic formulas that goes behind scaling and transforming objects across the screen. When I’m finished I’ll likely release something that’s open source, though that’s when I’m finished and I’m no where near that yet.

Click here to play

Current Features

  • All JavaScript, CSS, and HTML. None of this requires flash or any special plugin
  • Runs on Android, should run in iOS.
  • Screen scales with your browser window.
  • Basic alert window
  • Basic win condition
  • Infinite layers over the map
  • Movement authenticated over the server
  • Map data received by the server
  • Pre-loader and Loading screen
  • Basic UI elements
  • Being built from the ground up to work for multi-player games.
  • The game’s tile set and tile image sizes can be changed by editing a single array.

Coming Soon

  • Change movement and positioning, so the character can move around freely and isn’t locked to a grid.
  • Allow for the user to hold down a button to move. Currently you have to tap the direction to move each block.
  • Reduse bandwidth and lag by adjusting how movement is handled in client-server communication.
  • Reduce bandwidth and lag by using WebSockets to poll.
  • Replace the tileset with a cool custom tileset.
  • Map to map teleportation.
  • Multi-player functionality.
  • Quest System
  • Character registration and creation.
  • AI systems for guided movement
  • AI systems for combat

Click here to play



Filed under: Random,Web Development
Tags: , , , ,
By Vincent on January 6, 2011 @ 6:18 pm

My First WebGL application

About a week ago I begun to dig through a few WebGL frameworks. I tried GLGE, CopperLicht, and SceneJS. I went through a few tutorials in each, and then I decided to do something with SceneJS.

I wrote a PHP class that was a recursive backtracer maze generator (will post regarding this later), so what I did was create a second class that transforms the map data from the recursive backtracer and translate it into a 3D Scene.

So far it’s fairly simple, I have a premade set of prims for each wall, ceiling, and floor. Then I just run through the map cell by cell, cloaning the prims and then just adding the row number and column number to the X and Z positions.

The camera view is first person, but you can still walk through walls I haven’t learned how to keep that from happening yet.
I marked the end of the maze with a gold goblet.

Visit the application (Requires a WebGL browser)



Filed under: Web Development
By Vincent on October 9, 2010 @ 4:45 pm

Inspirational Websites

When looking to design a new website, it helps to look at pre-existing work. Here’s some of the websites I like to visit to become inspired.

Nike – http://www.nike.com
Nike looks just as cool being worn, as it does on the internet. Their website sports the same futuristic sporty look that Nike has always been known for. It’s going to be years before this website looks “old”, because besides just looking futuristic it’s very well designed and truthfully very simple. There’s not much maintence and if they want to vastly change the look of any one page, they just have to switch out the background.

Apple – http://www.apple.com/
Apple is well known for easy to use products, and good design. Many of their products actually look like they were designed by Dieter Rams. Their website is a perfect personification of their design principals. Timeless, and minimalistic.

Microsoft – http://www.microsoft.com
Microsoft has to be the most difficult site to design, not because their design is complicated but because their business is so huge. Microsoft has so many diffrent departments, and each one want’s a piece of the home page. Microsoft somehow hit it right, and designed a site that will bring you right to where you need to go with minimal effort or hunting.

Selected Web Design – http://www.selected-webdesign.com/
Selected Web Design is a website full of other very good and interesting designs, they’ve got categorys and other ways to filter the selections and find a site similar to your taste. You can find your own inspirations here.



Filed under: Random
By Vincent on September 14, 2010 @ 7:13 pm

My business card

Since my move to Phoenix, I’ve had more time to do freelance work. To help get my name out I began designing a business card.

I’m a designer, and a programmer so I really wanted something that looked unique yet technical. All I wanted the card for was my name, what I did, and ways to contact me. I went over multiple styles, and with the tips of a few graphic designer friends at Angelworld forums (Vincent Lai, Ikomi, Crays, and McLaranium) I decided that a very simple style is the best.

I finished the design, and my next task was finding a printer. My design is very simple, has a high tolerance for printer issues, and I wasn’t looking for any special effects. Most printers are able to do the job well enough. It ended up at who would provide the best quality paper, at the best price and still have a good rap for decent printing. After reading some reviews online, and consulting with local printers I decided to go with GreatFX.

The work done by GreatFX at GreatFXBusinessCards.com was outstanding and fast. I sent the cards to print on September 7th, and received them in the mail September 14th. The ink didn’t smudge, the lines were crisp, and the fine print was very readable. I’m happy with the work done by GreatFX.

It’s time for me to start handing out my cards!



Filed under: Web Development
Tags:
By Vincent on August 20, 2010 @ 8:47 am

Dieter Rams 10 Principles of Good Design

From the website http://www.vitsoe.com
“As good design cannot be measured in a finite way he set about expressing the ten most important principles for what he considered was good design.”

1. Good design is innovative.
2. Good design makes a product useful.
3. Good design is aesthetic.
4. Good design makes a product understandable.
5. Good design is unobtrusive.
6. Good design is honest.
7. Good design is long-lasting.
8. Good design is thorough down to the last detail.
9. Good design is environmentally friendly.
10. Good design is as little design as possible.



Filed under: How To,Secondlife
Tags: ,
By Vincent on August 13, 2010 @ 7:19 pm

How to make Lenticular Images in Secondlife

Found an article on Sculpt Blender where the author Murgy has discovered a neat effect in the second life viewer that allows for Lenticular Images (the images that change depending on what angle you view it). He goes into a bit of detail on how he discovered it, I’m going to give you a step by step process and provide you with the sculpted texture.

I’m assuming you understand the basics of creating objects in secondlife.

Step 1 – Creating the prim
Upload this sculpted texture, and name it something useful to you.
Create a new prim,  a cube works. Open the object tab, change the building block type to “sculpted”. Select the uploaded texture. Then change the stitching type to “Plane”. Open the texture tab, and change the transparency to 1 or higher.

You now have the basics of a lenticular lens, if you move the viewer from left to right you will see the texture change a little.

Step 2 – Creating the texture
Create a texture in photoshop, the maximum height for textures is 1024 in secondlife.
If you want a 4:3 aspect ratio for the images, set width as 341px and height to 1024px .
Viewing from Left to Right the first image is going to be on the bottom.
Set a guide for Y axis 770px, under this guide you can put your first image. This will be a bit shorter than the second image.
Set a guide for Y axis 370px, above this guide you can put your second image.
The middle, it’s best to leave clear or a color that matches the border of your images.
Here’s a .PSD with guides already set.
Now you can upload your texture to secondlife and apply to the prim, then rotate the texture -90 degrees and set the transparency to at least 1. Now check out your new Lenticular image!



Next Page »