Showing posts with label stuff. Show all posts
Showing posts with label stuff. Show all posts

Sunday, March 5, 2023

using .map() to iterate and modify objects in array

 const myUsers = [

    { name: 'shark', likes: 'ocean' },
    { name: 'turtle', likes: 'pond' },
    { name: 'otter', likes: 'fish biscuits' }
]

const usersByLikes = myUsers.map(item => {
    const container = {};

    container[item.name] = item.likes;
    container.age = item.name.length * 10;

    return container;
})

console.log(usersByLikes);

Source: https://www.digitalocean.com/community/tutorials/4-uses-of-javascripts-arraymap-you-should-know 

Wednesday, November 16, 2016

http://www.paintfont.com/

Create your own font using your handwriting

Sunday, September 25, 2016

Potential solution to keyboard not working during booting

Solution: USB Optimization was enabled. Enter the BIOS by holding onto the power button until you hear three beeps.

Source: http://superuser.com/questions/313024/how-to-get-into-bios-when-usb-keyboard-is-not-powered-and-have-no-ps-2-ports

Wednesday, July 22, 2015

Doing stuff in Ubuntu

The following works for Ubuntu 14.04.2 LTS

In the terminal:

- Checking the ubuntu version:
lsb_release -d

- Installing programs:
sudo apt-get install program-name

- Looking for a certain type of file within the current directory, e.g. .pdf files:
find -name "*.pdf"

- Increase the screen idle dim timeout for Ubuntu 14.04:
gsettings set org.gnome.desktop.session idle-delay number-of-seconds

- Opening files in the current directory:
xdg-open file-name


 Other:

- To create desktop shortcut, go to /usr/share/applications.
Select the icon and press Ctrl+c to copy it. Go to the desktop and press Ctlr+v.
Note that drag and drop won't work.

Wednesday, June 10, 2015

Changing colour of visited hyperlink in Microsoft Word 2010

Issue: You want the colour of a hyperlink to stay the default blue colour, but after clicking a link in Word, the colour changes to a purple-like colour.

Solution: http://answers.microsoft.com/en-us/office/forum/office_2010-word/hyperlinks-purple-and-microsoft-word-2010/93cb5832-dafc-4634-89a3-82358acf9b6a

Go to Page Layout, Colors, Create New Theme Colors. Change the colour of 'Followed Hyperlink' to the same colour as 'Hyperlink'.

Wednesday, May 13, 2015

Interesting Reads: Making of Crash Bandicoot

http://all-things-andy-gavin.com/2011/02/02/making-crash-bandicoot-part-1/

Andy Gavin and Jason Rubin, creators of the original Crash Bandicoot released in 1996, details the makings of the game, over a series of 13 blog posts.

Wednesday, April 29, 2015

Bolded text in pdf

Problem: After compiling latex, pdf containing images have text bolded. Problem only occurs within Adobe Reader

Solution: http://tex.stackexchange.com/questions/141/why-are-some-pages-in-my-pdf-coming-out-bold

To remove transparency in photoshop, Layer-> Flatten Image. Save the image, and recompile latex file. pdf should now look normal in Adobe Reader.

Thursday, March 12, 2015

Installing Cygwin

1. Grab the installation package from https://www.cygwin.com/
2. Install any packages you require. Common packages include: vim, gnuplot, x11.
- vim is a text editor.
- gnuplot to generate plots
- x11 to open up new windows. Need to use this for gnuplot
  • Attempting to open the gnuplot directly from the cygwin terminal won't work. Have to type in "startxwin", which will open another window. From this window, gnuplot will work.

Monday, November 10, 2014

Saturday, April 12, 2014

Using a Playstation controller (Dualshock 3) on the PC without bluetooth dongle

1. Download and install the appropriate software from http://www.motioninjoy.com/download
2. After installation, connect controller to pc via a usb cable. The cable used to charge the controller will work.
3. Start the DS3 tool program.
4. Go to the driver manager tab. After a minute or so, a driver will appear, something similar to Port_#0003.Hub_#0004
5. If nothing appears, do the following: Open up internet explorer, go to tools->internet options-> security. Change the security level to the lowest setting (default is Medium-high).
6. Open up DS3 tool again, go to driver manager tab, and a driver should appear. If not, try restarting the computer.
7. If you see the driver, click 'Load driver' and this will install the driver for the controller.
8. If it has been successfully installed, on the Profiles tab, instead of the message 'Wait for controller(s) to be connected', it will say  'Dualshock 3/sixaxis (USB)'. This indicates it has been installed properly, and can now use the controller on the PC, say, for a PS1 or PS2 emulator.

Saturday, October 26, 2013

Friday, August 17, 2012

How to play PS2 games

1. Download a Playstation 2 emulator. http://pcsx2.net/download.html
2. Download bios, and put in bios folder.
http://www.4shared.com/rar/VVnHPrYz/PS2_Bios_package.html
3. Install emulator.
4. Download roms to play games.
http://www.emuparadise.me/Sony_Playstation_2_ISOs/41
5. Check http://wiki.pcsx2.net/index.php?title=Main_Page to determine which configuration is best for the game being played.

Thursday, June 28, 2012

Thursday, May 3, 2012