Kevin Whitman's Blog

Tag: Google

I’ve been playing with Node.js

For about the past month and a half I’ve been playing with Node.js. Node.js is server-side JavaScript, using Google’s V8 JavaScript engine. Node.js can run a HTTP server, or any other type of socket connection. I’ve really only experimented with it’s HTTP server using the Express framework

I’m coming from a PHP background, so writing server backend’s in JavaScript while being asynchronous requires a slightly different mindset. In PHP, a user hits your Web server and Apache fork’s a new process, the PHP interpreter runs the script from top to bottom, then it gives the output to Apache and then dies. With Node.js, you have one process for the whole Web server. Also I find myself passing around the request and response objects a lot, unlike with PHP where you have a start.php or config.php file with variables accessible by any of the code. But after a while the stuff will come naturally to you.

I’ve started experimenting with writing a cloud based video encoding related application(not giving many details on that yet, not promising anything.) within Express, I use EJS(Embedded JavaScript) for template files so I can keep my application logic away from my views. I have configured my app I’m working on to have PHP styled open and close tags, since I’m used to template files being that way in PHP.

Another thing you have to do is define all your routes, guesses very similar to the frameworks like Ruby on Rails. Also with Express, I created a static file store to store my CSS, public JavaScript files, images and anything else I would want served statically.

Another thing I really love about Node.js is NPM(Node Package Manager). NPM is a package manager similar to apt-get that comes with Node.js. In the NPM, you can install modules, and publish modules. I’ve already wrote a few modules, to help me out on my own applications.

Some modules I wrote already are:

diskspace.js

A module to check how much free space, and total space the hard drive has. Node.js didn’t really have any native functions for this. This module works on both Linux, Mac and Windows. On *nix systems it uses df -k and on Windows it calls a small little C# application I wrote called DriveSpace(My first C# app) that comes bundled with the module.

Revolver

A simple generic round-robin. Great for database connections pools.

MailKit

A simple but powerful email wrapper around Nodemailer. Also uses Basic Template, another tiny module I wrote.

Range Check

A module to detect if a IP is valid, it’s version and check if its within a certain range. I mainly wrote this to use in node_CloudFlare.

node_CloudFlare

I use CloudFlare to supercharge my websites. I wanted this in Node.js, and I couldn’t really find any existing modules, So I wrote my own.

datamask.js

A simple module to mask emails, domains and even regular strings! Will turn [email protected] into t**t@e****le.com

HTTPRequest

A simple yet powerful HTTP request library inspired by jQuery and LSL written in JavaScript for client and server JavaScript. I wanted a nice and clean simple to use HTTP request library for both the server and client, so I wrote one.


So those are some of the modules I wrote so far. I really enjoy Node.js, but sometimes it feels overkill compared to just whipping out a .php and just writing something quickly. I guess I’ll get more used to Node.js and get better at it as time goes on. I also want to get in to mobile development, so I think Node.js would be a great tool to write backend’s in.

Looking at Google+

I just got my Google+ invite, after being sent five. One finally worked!

So once an invite works, it will ask for your name, gender and stuff. Then it will bring you to a page to complete your profile, some videos about it.

Okay. I’m kidding. It’s not using the same color scheme as Facebook. But you can make Google+ look like Facebook using a User Style at http://userstyles.org/styles/50051/google-facebook

Theres the real home page, for real. I kinda think I liked the Facebook color scheme better, but doesn’t mean I like Facebook social network. Continue reading

Looking at the social web

2003-2006

The year is 2003-2006, MySpace is where you could just find about everyone your age. Everyone I knew in School had a MySpace, I had a MySpace. Teachers, Law Enforcement and adults would bad mouth and speak out against the website making it seem worser then it really was by saying it was unsafe. Maybe it was unsafe back then due to some hacks, but other than that talking to a random dude at a bus stop is kinda unsafe also, it’s a risk you can take, you could meet a creepy serial killer or some nice guy because you never really know till you try to talk to someone and get to know them. I remember one of my teachers got this crazy woman who seemed Anti-Tech to come in and give a slide show. She showed how she would hack in to MySpace and show all this set private information. At the end, where people would ask questions, people asked how she hacked it and she said she wasn’t going to tell because she knew we kids would do it.

I kinda think looking back now, she wasn’t really hacking as you would think. I looked up information on it before and all the so called “hacks” don’t work anymore. The way they would work is you would take the persons MySpace user id, not the username, but the number like say 10290292298(random number i just typed) and use that id with different urls because it didn’t check privacy in some areas. Also teachers and other adults would say privacy settings didn’t matter. I never understood why, maybe because of the hacks that got fixed. I always did and i do today trust privacy settings when they are set right and implemented by the social networking site correctly.

So back then All of us young people liked it. Teachers hated MySpace. I once taught people in my class in English back in middle school how to use proxies. About a few days later, after different teachers noticed people were on MySpace when it was blocked, our principle went to the class rooms in the eighth grade one morning to talk to us about it. He told us if any of us got caught from now on we would lose our computer privileges for the rest of the year. He said he would also report our MySpace name to MySpace so they would delete our account. I’m not sure if MySpace would really delete an account just because a principle told them to, i really doubt it. I think he was saying it just to scare us. Not all of us was under 13. But i don’t think the principle or any teachers really found out who showed people how to use proxies. Continue reading

Are Search Engines just as bad as the Gnutella network that LimeWire used?

Well recently you may have seen in the news that the Limewire pear to pear operations has been shut down and if you visit the Limewire website you will see a notice stating why.

LimeWire Legal Notice

LimeWire Legal Notice

So LimeWire p2p got shutdown because they allowed people to download illegal content. Not all content on the network was illegal but most people abused it. Some people will make a version of Linux or do podcasts and use the Network to send them out without having to host it using bandwidth transfer and disk space on their own web server/hosting plan. This is the same with torrents. So the Torrent and LimeWire technology can be used for good but it sadly abused.  LimeWire is a client that connects to the Gnutella network. There are still clients out there that can connect to the Gnutella network not made by LimeWire.  The way P2p file sending works is someone will add a file to the network and with their client open, the file is accessible. Each client acts as a node on the network. Clients can search Gnutella index or the torrent trackers index. A client will then start downloading from all the nodes with that file on the network. So basically Gnutella or Torrent Tracker stores information that contains where the file is located. The file itself isn’t on the trackers server. LimeWire use the Gnutella network by default or you could give it a torrent file from some other tracker/network. This is my understanding on this technology and please correct me if I am wrong.

So lets put this in context. Your web browser of choice is a client.  Google is the network Index. Some other server hosts the file. Continue reading

Pizza Delivery in the future

About a week ago Google Announces they have played around with a self driving car. So this is my vision of how you would order pizza using this technology.

The Car i vision. Crappy picture i drew in paint.

 

We all know pizza sucks unless its Delivery. So the ordering process would be.

1. Call or visit the web like you would today. You would have to give your phone number also.

2. The pizza place makes your order and loads your order.

3. They send the car off to your location you told them when ordering.

4. The car goes to your location and you pay then get your order.

5. The car goes back to pizza shop.

So when after your order is done being made, on the computer that they put your order in via phone or you via web they pick a car, So say Car Id 7  is available. The computer loads the order information, The list of your order and price. They open the handle on the slot and put the pizza in and close it. It then locks it. They then back away and after it detects no one is close to it, it then starts driving to the house or place of business of the customer.

Then when the car gets to your location the car will then alert the pizza company computer system the car is at your location, how long it drove and triggers a phone call. It then keeps calling every 1 minutes up to 10 times and then leaves if you don’t pick up. Then once you pick up, it then adds 10 minutes to the timer. Once 10 min is up, it calls you and if you pick up it adds 10 more else if leaves. Once you get to it. The car will say your name (Jane Doe in this case and the price.) You pay it via credit card or put money in similar to how you would with a soda vending machine. You open the handle and take your order out. It also prints a receipt or maybe they could put it on the box. Once you close the door on the pizza vendor built-in to the side of the car, The car drives back to the pizza place after it detects if safe to do so. Also these cars would not have to be full size. Could be built-in to a smaller 2 door car.

Then maybe they can come up with a way to make pizza by robots and load them on the car. Then maybe we can have 24/7/365¼ Pizza ordering!

Copyright © 2010 - 2024 Kevin Whitman's Blog

Back To Top ↑