Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Tuesday, April 9, 2013

OpenEmu Compiled for Mac

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
OpenEmu is a open source emulator that will play pretty any game you played 'back in the day'. My 'back in the day' games were the Pokemon games.

Now the only way to play Pokemon on a Mac is with GameBoy emulators. VisualBoy is a very good option, with the ability to fast forward time and use various cheats. But it is slightly unstable, and the cheats and the fast forwarding option does spoil the game because you will inevitably use them. It's like a cake on a table, in a room full of other people. You don't simply ignore the cake. You will eat every bit of it. Then you will become violently sick because the cake was poisoned. The cheats and the fast forwarding is the poisoned cake. It ruins the game and you can't help but use them.

Enter OpenEmu. Not only will this emulate any sort of Nintendo device, it is stable, and it doesn't have anything extra. Open app, play the game. Thats it. No fuss. The best part is that it looks like an official Apple app. It's like a mini iTunes for emulators and games. It is beautifully designed.








This is how an emulator for the Mac should look like. You can modify the keys, or hook up a gamepad and modify the keys accordingly.





You can compile it yourself. It takes less than 10 minutes to compile if you already have Xcode. Here's a very simple guide to compile it yourself. If you don't have Xcode, or you want to save yourself the bother, here's a version I compiled.

Download Link 1
Download Link 2

Wednesday, April 3, 2013

AutoShot: Automatic Screenshot Taker

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
AutoShot. I couldn't resist naming an elementary AppleScript script. It was too good a name to pass up.

Autoshot automatically takes screenshots of your Mac while you play your game, or work on your project, so you can document your work or play, without having to press the combination of keys to take a screenshot. There are full fledged apps out there that might do this, but this is a simple script that can do the same. You can decide the delay between each screenshot, and for how long should the script take the screenshots.

Here is the code incase you want to edit it anyway. I took bits of code from places, as I'm slightly rusty at this. To change the format of the image, simply edit the ".png" bit.

display dialog "AutoShot: Automatic Screen Capture Script 
Gap between each shot(in seconds)" default answer "" buttons {"OK", "Cancel"} default button 1 --Q&A for user, to determine factors of taking screenshots
set beta to text returned of result
display dialog "Period of time for the screenshots to be taken(in minutes)" default answer "" buttons {"OK"} default button 1
set zeta to text returned of result --period of time for shots to be taken
display dialog "Screenshots will be saved on folder named 'AutoShot' on Desktop" buttons {"OK"} default button 1

set dFolder to "~/Desktop/AutoShot/"

do shell script ("mkdir -p " & dFolder)

set zeta1 to zeta * 60 --converting input to seconds
set alpha to (zeta1 / beta) --calculating no. of times the screenshot code has to be repeated


repeat alpha times --Repeat Code
set tTime to do shell script "date +%H%M%S"
do shell script ("screencapture " & dFolder & tTime & ".png")
delay beta --Gap between each shot
end repeat

The download link for the app that doesn't need AppleScript editor. Its a standalone app, so it'll run the script on simply running the app.

Tuesday, April 2, 2013

Flipp Safari

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
I've finally made the Flipp extension for Safari! It took a bit of work, but I finally converted it. HTML for Youtube needs to be enabled to make it work. Although it does have many uses, it can primarily used for learning complex dance moves from youtube, or simply watching Youtube videos in a different way.



Before



After 'Flipping' it



Download link

Thursday, September 13, 2012

processing experiment 1

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
There's so much you can do with simple values. In this processing sketch, I'm only using a line and ellipse function to draw various shapes and abstract compositions on the canvas. Funny what random values can do.





Saturday, August 25, 2012

Terminal Mischief ;)

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
The Macintosh operating system is often thought to be extremely serious and po-faced, only dedicated to serving corporates and artists alike. But there is a fun, childish side to the Macintosh OS not many people know about, and even fewer know how to access it. Here's a guide to access those awesome features.

First open Terminal
[Applications>Utilities>Terminal] or use Spotlight





Now make your Mac speak anything out loud. Anything you want.
Simply type,
say [type text you want to hear your Mac speak aloud]

Unleash your Mac's artistic talents by producing ASCII art with a few keystrokes.
Type,
banner [text to be converted into ASCII art]


To save the ASCII art to a text file,

Navigate to Desktop.
cd Desktop
 Now type in the command,
banner [text] > [filename].txt 

Now open the file from Desktop.


To show it more clearly here, I converted the txt file to a pdf.



Awesome stuff isn't it? There are many more Terminal tricks. You can even access retro games  such as Pong, Tetris, and others using eMacs.

Thursday, August 9, 2012

Garfield Dashboard Widget [Macintosh]

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection


A few years ago, someone made a Garfield widget which displayed every comic since its inception. However due to circumstances only know to the wildly imaginative, the widget isn't available on the internet anymore. I took the basic algorithm of that widget and made another so that the interweb can still enjoy Garfield.

Download Link

I think the sunday strip doesn't appear for some reason. Don't ask why. I can't figure it out either.

Tuesday, April 24, 2012

Flipp Chrome

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
I created a Google Chrome extension that allows you to horizontally flip or mirror all HTML5 videos on a web page. Apparently this is good if you're dancer and you want to learn some dance moves.



But I think it'll be a lot more useful if you're sick of watching mirrored videos on Youtube. Flipp simply flips the videos back to the original format, and you can watch it normally. So this is a pretty good tool to watch that Top Gear episode on Youtube without having to suffer the mirroring. Also its also good way to have a laugh. Watching any video mirrored gives an entirely new feel to it.

To install this extension, simply download the file and open it. It only works on Google Chrome. I'll try and make a similar extension for Safari and Firefox as well.

Safari Extension for Flipp: Flipp Safari




To use this extension, goto settings on Youtube, and turn HTML5 video mode on. Only then will Flipp work. Link for Youtube HTML5 activation : http://www.youtube.com/html5




Download it here : Mediafire Link

Thursday, April 5, 2012

Mac Virus

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
Ok, this isn’t exactly a real Mac virus. But it’s a good way too prank your friends(or foes!). With the help of AppleScript you can instruct the Mac to perform several tasks. Although Applescript is generally used for boring stuff like sending bulk mails or doing something productive, it can also be extremely fun if you have a devious plan in mind!

Open AppleScript Editor.


Open AppleScript Editor


This is where you write the code.

 
AppleScript Editor


Type in,


say “Warning! Virus Alert!” using “Vicki”




Voice command



Mac will now issue a ‘warning’ and say whatever you type in using the voice Vicki, who is [I think!] spanish. Hmm....


Now,

display dialog “Virus Alert! Mac has detected a virus.” buttons {“OK”} default button 1




Dialog Command

Mac will now display a dialog with the warning.


Prompt


now type,

tell application "Finder"
shut down
end tell

Shut Down command


Mac will now shutdown!

Click Compile, and then save it as an Application.
Don’t click Run! Or your Mac will shut down!


Save
Save as Application


Now change the logo of the application, or do whatever but get your nemesis to open the application and face your wrath!

Tuesday, April 3, 2012

processing sketch : transparent circles

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection




I made this using processing. Ok, this isn't really processing per se, but it is processing.js. Both use the same coding just that processing.js is a lighter and more efficient way to display your processing sketches on a web page. In this simple sketch circles of varying opacity are drawn on the screen and the position of the circles are determined by the position of your mouse. The colour and the opacity are random. To clear the screen and to start again, press the key 'C'.

The code is given below. I have explained some lines of code so you understand what I have created.

void setup() //method to initialize the sketch. Only runs 1 time.
{
  size(600, 600); //determines size of sketch
  background(255); //background colour
  smooth(); //smoothens everything out
}
void draw() //method to draw on sketch. Runs every time till program is stopped.
{
  noStroke(); //circles don't have an outline
  float x = random(20, 60); // random size with limits from 20 to 60
  ellipse(mouseX, mouseY, x, x); // circles with position determined by mouse
  fill(random(200), random(200), random(255), random(100)); // random colour and opacity
  if (keyPressed) //detects if a key is pressed
  {
    if (key=='c'||key=='C') //now looks for key 'c'
    {
      background(255); //clears screen
    }
  }
}


Monday, April 2, 2012

Processing

Don't Copy From This Blog...

Protected by Copyscape Plagiarism Detection
Have you ever fantasized about being a computer programmer and create stuff simply by typing a few commands? Yet, like me, you hate the complexity and the learning curve of the Java, C++ and the rest? Fear not, for processing is here!



Processing is Java based compiler which requires basic Java coding know-how to create insanely cool graphics within minutes of downloading the compiler. It's extremely simple to learn processing, and with a few months of solid practice you can create anything you want with a few lines of code. Sounds too good to be true right? However, apart from a few minor problems with some geeky stuff which won't bother you anyway, it is fantastic. You can do 3D modeling on it as well!

So download processing and code away!


Here are a few examples,




Tree using recursion


 
//PART 2