Showing posts with label computer. Show all posts
Showing posts with label computer. Show all posts

Monday, June 22, 2009

My USACO Solutions: Your Ride is Here

I decided to do the USACO training program over the summer. Meanwhile, the darn program has all their solutions/analysis in C++, which I don't do... so I'm posting my solutions here for 1. Just for the heck of it and 2. So other people can tell me what I can do better

import java.util.*;
import java.io.*;

public class ride 
{
 public static void main(String [] args) throws IOException {
  
     BufferedReader f = new BufferedReader(new FileReader("ride.in"));
     PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("ride.out")));
    
     String comet = f.readLine();
     String group = f.readLine();
  
  //I didn't know if java has the ord() or char() function like python does
  //and I'm too lazy to find out. Besides, this is easier to understand
     String[] list_alpha = {"A","B","C","D","E","F","G","H","I","J","K","L",
   "M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
     ArrayList list = new ArrayList(Arrays.asList(list_alpha));
     
     int comet_num=1;
     int group_num=1;
     
  //At the time of submission, I split the loop to two for loops... >.>
  //didn't realize that they were same length
     for (int x = 0 ; x < comet.length() ; x++)
     {
      comet_num *= list.indexOf((comet.substring(x, x+1)))+1;
   group_num *= list.indexOf((group.substring(x, x+1)))+1;
     }
     
     if ((comet_num % 47) == (group_num % 47)){
      out.println("GO");
     }
     
     else out.println("STAY");
     
     out.close();
     System.exit(0);
 }
}
-runiteking1 Got comments? Post them below!

Friday, June 12, 2009

Anki

SAT is coming up for me and that means that I need to start expanding my vocabulary (and learn how to spell vocabulary...)! The method I'm taking right now is basically a beefed up version of the tried and trued method of flashcards: Anki.


So what is Anki? My take on this little software is flashcards with memory, the ability to increase the number of times hard words come up, and decrease the frequency easy words (for you) come up. In the developer's words:

Anki is a spaced repetition system (SRS). It helps you remember things by intelligently scheduling flashcards, so that you can learn a lot of information with the minimum amount of effort.
The algorithm by which the product operates is a thingy called Supermemo (sounds cool doesn't it?).

Still don't really get it? The site has a few videos demonstrating the usefulness and adaptability of the software. Another thing that entices me? That you can use Latex, put sounds in the cards, and edit the HTML code to your liking.

Crossing me fingers to hope that this is as good as it claims.
  • Anki (Windows, Mac AND Linux)
-runiteking1

Got comments? Post them below!

Wednesday, April 1, 2009

Arch Linux on A Gateway

So codersarepeople gave me an old laptop to mess with and I've been messing with it by installing Linux.  It's a Gateway M350WVN with a 2.8 Pentium, 512MB memory, 60GB harddrive and Intel graphics driver (this laptop is faster than my desktop by quite a bit... :-/, but its got a bonk soundcard). Somehow, installing Linux was such a hassle.

I wanted to use Ubuntu first, to minimize the hassle I get from configuring Arch Linux but after I put in the disk and spin up. The output was something about not syncing... kernel panic. Okay then, so Arch it is. I installed Arch (so much easier) and tried to configure the wireless Broadcom card. Failure... So I just did a ethernet cable to do a full system upgrade to see if the newest kernel might have somthing in it. Failure in updating... there's was dependency hell on the kernel. I boot up Ubuntu again, this time with acpi=off, success. I installed Ubuntu, restarted and came upon a pretty Gnome desktop. I tried to access the internet through the WiFi again.... failure.

I got sick of Ubuntu so I installed Arch again, this time from a server as to get the most up-to-date stuff. IT WORKS! Then I started to google like crazy to find out how to configure my wireless card. Stupid me, I found out that the BCM4306 rev 2 needs the b43legacy driver, not the plain vanilla b43 that comes with the Arch installation. Now the wireless setup went extremely smooth, but I do want to say that you should install netcfg by now to configure the network.

Now for the demon they call Xorg. From retrospect, I should've copied the Xorg from Ubuntu's config but I didn't think of it. A quick Xorg -configure did the trick, but I found out later that its not good enough. The display was fuzzy and not awesome. After manually configuring the fonts a little bit, messing with the resolution, changing the default stuff etc. I got it to be nice and crisp. So all is well right? Wrong. Then I wanted to have Compiz-Fusion on the computer. Installing it was not hard... but after activating it, the window decorators all went away. I followed countless forums but nothing did the trick... until I come upon another person who had the exact same graphics card with a working Compiz install that uploaded his Xorg.conf file! A copy-paste and moments later... Compiz wonderland!

The rest of the stuff is easy... pacman -S this pacman -S that, maybe a few yaourt -S this, but its starting to turn into a working computer again... except for the fact that it can't play any music.

I feel so stupid for not doing my homework before hand. 

EDIT: Screenshots


Software: Gnome, Gnome-Do with docky, Internet Explorer with Crossover, Firefox 3.5 beta, Mathematica 7

Non Busy one:

-runiteking1

Got comments? Post them below!

Wednesday, December 24, 2008

The Facebook Status Updater

So... I made a little script to calculate the time till Christmas and automatically update your Facebook status...

Requires Python and PyFacebook.

(This is a great way to annoy your friends if you change the wait time to .5 or some ridculously small number to flood their feed...) 

#! /usr/bin/env python

import facebook
import time
import string

def update():
    difference = 1230181201 - round(time.time())
    return "%.0f Hours and %.0f minutes till Christmas" %(round((difference/3600)-.5), round((difference%3600)/60-.5))

if __name__=="__main__":
    api_key = 'YOUR API KEY'
    secret_key = 'YOUR SECRET KEY'

    facebook = facebook.Facebook(api_key, secret_key)

    facebook.auth.createToken()

    # Show login window
    # Set popup=True if you want login without navigational elements
    facebook.login()

    # Login to the window, then press enter
    print 'After logging in, press enter... '
    raw_input()
    
    #Uncomment to following block if this is the first time
    #print 'Now you will need to authorize this script to update your status'
    #facebook.request_extended_permission("status_update", popup=False)
    #raw_input()
    
    facebook.auth.getSession()
   
    while (time.time() <1230181201) :
        facebook.users.setStatus(update() , False)
        time.sleep(58)
    
    facebook.users.setStatus("CHRISTMAS!!!" , False)
    






-runiteking1

Got comments? Post them below!

Saturday, November 8, 2008

The Virus of the American Dream

1. Congratulations President-Elect Obama! Hope you remember all your promises and wish you good luck at the White House! Take a listen to Obama's victory speech.



2. The worst possible virus...ever? How would you like to have a Miley Cyrus song play at full volume every time you turn on your computer? With no way to mute it, turn it down, or stop it?
Well, i was surfing the net at college yesterday on my laptop, im allowed to use it in lessons to take notes etc.
I shut it down after my free period and went to physics, switched my laptop on, and upon startup it started some EXTREEMLY annoying music

I looked at it, tried to put some headphones in (sadly my headphons jack appears to no longer be working) and my sound panel is blanked out, so i cant control the volume (MUTE IT!)
eventually i gave in that physics lesson and just used pen and paper.

so i got home and tried to mess about a bit with it, it appears to have a strange virus.
It plays "Miley Cyrus - See You Again" upon startup, each and every time, and just repeats at full volume, it wont accept headphones (just sees them as not there and continues to play)

I found miley.exe as a process, and im assuming thats what controlling it, but when i close it, its just reopens itself and starts playing again

anyone have any ideas? As i absolutly hate pop music, and this takes the buscuit -.-
3. A prototype cure of the AIDS virus?A possible breakthrough in AIDS research may be here due to a bone marrow transplant. Dr. Gero Hütter was performing a bone marrow transplant and accidentally might have removed all traces of the HIV virus from the patient's body.
Doctors have not been able to detect the virus in his blood for more than 600 days, despite his having ceased all conventional AIDS medication. Normally when a patient stops taking AIDS drugs, the virus stampedes through the body within weeks, or days.
-runiteking1

Got comments? Post them below!

Monday, October 20, 2008

My AP Comp Sci Skit... Except I didn't follow instructions...

Well, I'm suppose to make the parent the ignorant one, but I didn't read the directions so here goes:

(Lewis is in his room playing Spore while Mom is making dinner)

Lewis: Oh man! I lost all my creatures on Planet Number 6!
Mom: Time for dinner!
Lewis: But Mom! I have to rebuild my army now, by tomorrow!
Mom: Fine, five more minutes.

(Mom comes to the Lewis' room to see his creatures)

Mom: So... what new creatures did you create?
Lewis: Take a look at this little beauty! It got a dragon head mutated with an advance leg system.
Mom: (sarcastically) Uhm, that's nice.
Lewis: I've got to use the restroom... (runs to use the restroom).

(While Lewis isn't here, he started receiving messages from "hotchick16")

 hotchick16: Hey there hottie Lewie. So do you want to proceed with the deal. Remember, its FIFTY bucks for just taking off your shirt!
Mom: Oh my dear me.... what kind of friends does Lewis have? I better check his chats.
Mom: (While reading chats) Seems like Lewis needs a chit chat on web safety... OH MY WHAT IS THIS!!! (quickly closes the window after seeing "sporn" in his mail).
Mom: LLLEEEWWWIISSS GET YOU BUTT OUT HERE PRONTO!
Lewis: But I'm still using the restroom.
Mom: Get out here NOW!
Lewis: Okay, okay... (gets out of the restroom).
Mom: What have you been doing with Spore?
Lewis: Well, I've been creating creatures and starting to controlling the universe...
Mom: Any other thing relating to chats with other people?
Lewis: Uhh, well, I made some new friends.
Mom: Like who?
Lewis: Well, this girl has been contacting me and we did some Spore projects together....
Mom: You know there are some really bad people out there.
Lewis: Well, the person sounded really considerate!
Mom: First of all, how do you know that she is a... "she"?
Lewis: What do you mean?
Mom: How do you who it is?
Lewis: Well, she told me all about her.
Mom: It could all be lies, after all, you did lie about your age when you signed up for Runescape a couple of years ago.
Lewis: You still remember?
Mom: l-o-l of course I remember, I'm a computer scientist and a mom, I'm suppose to remember this stuff.
Lewis: I'm sorry mom about the stuff I created.
Mom: I'm extremely disappointed at you for creating porn like images using Spore...
Lewis: She was so subtle! It started small, then she started asking for more and more.
Mom: And now she asked for you to take of your shirt?
Lewis: Uhhh, I didn't know about that.
Mom: Take a look at this (brings up the recent message).
Lewis: I see how it  using me to slowly create child pornography.
Mom: Now do you know not to accept chats from people you don't know or from people you don't know that well?
Lewis: Yes mommy.
Mom: Good boy.

-runiteking1

Got comments? Post them below!

Thursday, August 28, 2008

Ubiquity

One of the coolest thing on the web right now... and because I'm too lazy to write anything while doing homework...


Ubiquity for Firefox from Aza Raskin on Vimeo.

Download here: http://labs.mozilla.com/2008/08/introducing-ubiquity/

-runiteking1

Got comments? Post them below!

Tuesday, August 19, 2008

The Power of the Fox

(Don't even bother reading this if you have a Mac, Preview pwns all...)

As the school years rolls around, we find ourselves using the computer for school work more often. One of the major repercussions of that is the use of Portable Document Format, ie PDF. PDF is one of the greatest things that has happened to computers (in my opinion), there will be no discrepancy between one system to another and always looks the same.

But the thing that always bug me is the use of Adobe Reader...

Adobe Reader is one of the most bloated software on the entire earth. Who needs to download some 40MB to read a single document? And who needs to sit there and watch the splash screen load longer than we need to look at the file? Welcome to the world of Foxit...

Foxit Reader (download page here, click on download, not purchase) is one of the best PDF readers on the planet. Its super small, super fast and super.. super. Its pretty much loaded on features... anotations, ability to write in the document, editing tools, drawing tools etc. more than you will ever need. And still loads instantly.

Hope you enjoy it as much as I do.

-runiteking1

Got comments? Post them below!

Sunday, May 11, 2008

Windows XP Scare...

So today I went through my program files and started uninstalling stuff that I didn't need. As I went through, I delete: Office 2000 (how did that get here?), old Java stuff, HP Extended Capabilities, Microsoft Works, Formulator ML (a program I used to use) and "fixed" a Kodak program.

Well, after restarting, XP showed this prompt (or some variant...):

hal.dll cannot be found or may be corrupt
This got me extremely worried, so I turned on my little geek switch and went problem hunting.

First of all, I rebuild the boot.ini file and that took a really long time. The result? It @#$ing didn't work...

After searching through the forums a bit, I found out that I needed a Windows XP disc but I don't have one. Again, searching through some forums, I found out that HP have a copy of the XP installation disc in the D:\I386 file.

This being known, I booted the computer to the XP Recovery Console and entered this command:

expand d:\i386\hal.dl_ c:\windows\system32\hal.dll
Of course, my computer being the stupid thing it is, it didn't work...

So I played around it for a while and found out that taking out the "hal.dll" from the end of the command worked magic for me.

-runiteking1

Got comments? Post them below!

Friday, May 2, 2008

The Joys of no McAfee

Recently, I've been thinking about axing McAfree virus and firewall services. In the past few days, I finally did it.

Boy, is my PC now soooo much faster and better than McAfee!

Software I substituted for McAfee, both free and better:



-runiteking1

Got comments? Post them below!

    Sunday, April 27, 2008

    Geekiest Pants Ever!

    Browsing through del.icio.us and came up to this website. So some sick (but inventive) person invented pants with keyboard, mouse and joystick built-in.

    Take a look:

    beauty_geek4

    beauty_geek

    Though I agree this is creative, what if you accidentally hit the space bar a bit, uhm, too forcefully?

    -runiteking1

    Got comments? Post them below!

    Sunday, July 8, 2007

    Lego Aircraft Carrier

    This is pretty cool, a really large carrier made of legos, not as cool as the K'NEX computer though :)

    http://www.techeblog.com/index.php/tech-gadget/lego-aircraft-carrier