Monday, October 17, 2011

How to solve Flash problems on Ubuntu 11.10 Oneiric Ocelot

19 Zulkaedah 1432H
Updated: 26 Ramadan 1433H / 13 Aug 2012M, Is.
26 Jamadilawal 1433H / 18 Apr 2012M, Rabu.
25 Safar 1433H / 19 Jan 2012M, Khamis.
19th Oct 2011, Ra.


My old Toshiba Satellite M100 laptop has met the end of its service life :(. Starting its service life in the place of the old  laptop is a new Lenovo IdeaPad Z470 laptop. The switch from old to new laptop happened around the Ubuntu upgrade from Ubuntu 11.04 Natty Narwhal to Ubuntu 11.10 Oneiric Ocelot.

The new laptop comes pre-installed with Windows 7. For reasons not-so-important-to-mention, the laptop has been setup to dual boot: Windows 7 or Ubuntu. i'm running Ubuntu 11.10 (64-bit).

Among the problems i face are:
  • Adapting to the oddly placed Delete button on this keyboard. i miss the old keyboard :'(. Next time i get a new laptop, it's going to be a Toshiba! :D
  • Adapting to how odd the keyboard on this new laptop feels when typing
  • Problems with the touch-sensitive buttons (all the buttons in the volume button row) specific to this laptop. Problem isn't solved yet.
  • Flash problems with FireFox and Chromium
  • Bluetooth is turned on automatically at start-up. i want it turned off.

Below are the simple steps to solve the Flash problem with FireFox. i took the solution from here, Re: Problems with flash player in Ubuntu 11.10 and refined the explanation.

===
Update: 26 Ramadan 1433H / 13 Aug 2012M, Is.
James Maxwell (http://www.blogger.com/profile/12426809746992406630) suggested this post for Windows Firefox:
3 Tips to Fix Firefox Crash Problem
http://remote-technician.blogspot.in/2012/08/3-tips-to-fix-firefox-crash-problem.html
===

1. Run your FireFox browser.


2. Referring to Pic 1, from FireFox's toolbar: Tools > Add-ons

The Add-ons Manager tab will appear in the browser. See Pic 2.

Pic 1 - Refer Step 2.


Pic 2 - Refer Step 2. The Add-ons Manager tab in the FireFox browser.



3. In the Add-ons Manager tab, go to Get Add-ons tab. See Pic 2.

Referring to Pic 3, type the term flash in the search field then press the Enter button to search for the Flash-Aid extension.

The Search tab will automatically appear above the Get Add-ons tab. Look for the Flash-Aid extension in the search results. The current version at the time this post is written is Flash-Aid 2.2.1. Click the Install button to download the extension.

Pic 3 - Refer Step 3. Searching for the Flash-Aid extension and downloading it.



4. After downloading is done, click the Restart now link (located beside the extension's name) to restart your FireFox browser then install the extension, see Pic 4. Fret not, any opened tabs will be reloaded after restarting your browser.

Pic 4 - Refer Step 4. Restarting FireFox to install the Flash-Aid extension.



After restarting FireFox, to check whether the Flash-Aid extension is installed, go to the Extensions tab, see Pic 5.

Satisfied, close the Add-ons Manager tab, there's no further need for it.

Pic 5 - Refer Step 4. Checking for the Flash-Aid extension in the Extensions tab.



5. In your FireFox browser, notice the Flash-Aid button (see Pic 6) at the right-hand-most on the same row of the address bar. See Pic 7.

Pic 6 - Refer Step 5. The Flash-Aid button.



Pic 7 - Refer Step 5. Flash-Aid button position in my FireFox browser.



Click-hold the Flash-Aid button. A pop-up menu appears. Choose Wizard Mode for aid to correct the flash errors. See Pic 8.

The Flash-Aid Wizard window appears, see Pic 9.

Pic 8 - Refer Step 5.



6. In the Flash-Aid Wizard window, Installation Options; under the question:
Which version of flash you want to install?

Choose from the drop-down menu the version of flash you want to use depending on your architecture, then click the Next button. See Pic 9.

If you're running Ubuntu 32-bit, use:
  • Adobe Stable, from repositories (32bit with compatibility wrapper)

If you're running Ubuntu 64-bit, you can choose to use:
  • Adobe Stable, from repositories (32bit with compatibility wrapper), or
  • Adobe Beta, from Adobe Labs

i chose "Adobe Beta, from Adobe Labs".

Pic 9 - Refer Step 6.



7. Still in the Flash-Aid Wizard window, Removal Options; under the question:
Which installed plugins you want to remove?

Tick the box for the plugins you want to remove then click the Next button. See Pic 10.

i left all the boxes ticked and simply clicked the Next button.

Pic 10 - Refer Step 7.



8. Still in the Flash-Aid Wizard window, Tweaking Options; under the question:
Which optimization tweaks you want to apply?

Tick the box for the tweaks you want to apply then click the Next button. See Pic 11.

i left all the boxes ticked and simply clicked the Next button.

Pic 11 - Refer Step 8.



9. Still in the Flash-Aid Wizard window, Script Options; under the question:
What do you want to do?

Choose what you want to do then click the Finish button. See Pic 12.

i left the option at Execute and simply clicked the Finish button.

Pic 12 - Refer Step 9.



The Flash-Aid Wizard window will disappear and a Terminal window will appear. See Pic 13.

Pic 13 - Refer Step 9.



10. In the Terminal, follow the commands that appear.

If requested, type in your password then press the Enter button. See Pic 13.

When asked:
Do you want to continue [Y/n]?

Type in y then press the Enter button. See Pic 14.

Pic 14 - Refer Step 10.



11. When the process in the Terminal has finished, see Pic 15; close the Terminal, then restart your FireFox browser.

Pic 15 - Refer Step 11.



12. Try going to a website with flash contents to check if your flash has been installed correctly.



Flash problems return

After quite sometime, it appears the flash problem suddenly returns for no reason. It's possibly because of the new Ubuntu updates for flash or browser. A notification (see Pic 17) is supposed to automatically appear to inform about updates. Most of the time i don't notice it :P

13. Simply go to the Flash-Aid icon (see Pic 6), click-hold, then select Check Update. See Pic 16.

A notification will appear to inform about any update, see Pic 17. If there is a new update, choose the update method (Wizard Mode / Quick Mode / Advance Mode) you are comfortable with. i'm sure by now you have a preferred method :).

Pic 16 - Refer Step 13. Checking for update.



Pic 17 - Refer Step 13. Update notification. Update available.



This this just my opinion: Even if there is an update, if your flash is working OK, just leave it be -- Don't update. It's not broken, so why fix?

Tuesday, October 11, 2011

This Blender n00b is modelling a house

14 Zulkaedah 1432H

Sharing my attempt at learning Blender by following the guide, Blender 3D: Noob to Pro, starting from nil. The closest i've come to anything 3D is using CATIA in my previous study/ramble.

The following pics were modelled using Blender 2.59 on my husband's PC running Ubuntu 11.04.

By the way, my old Toshiba Satellite M100 laptop has performed its duty excellently and reached the end of its service life (the fan has stopped spinning for the second time), while the new Lenovo IdeaPad Z470 laptop is at the service center for hard disk problems :( *sigh*... which also means i'm currently unable to continue writing my over-delayed thesis, and it's nearly TWO weeks already! That's why i'm learning Blender at the moment -- to use time as wise as possible.

Pic 1 is the result from this page:
- Blender 3D: Noob to Pro/What is a Mesh?

Pic 1 - Cat face! :D


Pic 2 is the result of these pages:
- Blender 3D: Noob to Pro/Quickie Model
- Blender 3D: Noob to Pro/Quickie Render

Pic 2 - N00bie house.


Pic 3 is the result of this page:
- Blender 3D: Noob to Pro/Improving Your House

Pic 3 - It's a house. It's a bank. It's a...


Pic 4 is me rambling before starting the next lesson:
- Blender 3D: Noob to Pro/Modeling a Simple Person

Pic 4 - Traditional Malay house on stilts. Nostalgic, huh?


A lot more reading to do! :-\

Thursday, August 11, 2011

How to set different page margins within the same chapter in LaTeX

Update: 24 Aug 2011M/ 24 Ramadan 1432H, Ra.
8 Ramadan 1432H

My thesis has fixed (consistent) margins throughout the whole document, so it's no problem to set the margins once and leave it be.

But what if a thesis has different margins for different pages within the same chapter? -- This problem most probably hits book-writers too.

For instance, it is required the top margin for
the page-with-"Chapter" be 5cm (see Pic 1 and Pic 5), while
the page-without-"Chapter" be 3cm (see Pic 2 and Pic 6).

As for the rest,
2.5cm for the bottom margin (see Pic 6),
3.8cm for the left margin (see Pic 5), and
2.5cm for the right margin (see Pic 5).

Pic 1 - Opening page (page-with-"Chapter").


Pic 2 - Succeeding page (page-without-"Chapter").


Tools

Template
If you want to use the same template i'm using (though mine has been heavily modified by now), you can get it here:
INSPEM -- Institute For Mathematical Research.

From there, look for this link to download the template:
UPM Thesis Template (Versi BI)

And download the guide too:
User Guide for UPM Thesis Template

You must first modify the template as directed by the guide before proceeding to use the template.

Dummy text
As for the text, simply go to this link:
Lorem Ipsum - All the facts - Lipsum generator
and generate a few paragraphs of dummy text.


Steps

1. Add the following commands to the list of packages in your main file. In my case, it will be the UPMthesisEnglish.tex file, see Pic 3.

\usepackage[top=3.0cm, bottom=2.5cm, left=3.8cm, right=2.5cm]{geometry}

\usepackage{titlesec}

Pic 3 - Adding the commands in the UPMthesisEnglish.tex file.


The geometry package will be used to set the margins for the page-without-"Chapter" page (see Pic 2).

If your thesis has a fixed margin throughout the whole document, the first command line (command line numbered-1 in Pic 3) is enough!

Also, you can use the first command line to override margin settings (and only the margin settings, nothing else) in the *.cls file. In my case, it will be the UPMthesisEnglish.cls file. i don't know how others' *.cls file looks like but mine is really messy + complicated.

The titlesec package will be used to set the margins for the page-with-"Chapter" page (see Pic 1). Basically we will vertically offset the title.


2. Add the following commands to the relevant sub-files. In my case, i'm using my own Chapter4.tex file. You can use the generated dummy text in your file.

\titlespacing*{\chapter}{0pt}{1.5cm}{1cm}

\titleformat{\chapter}[display]{\normalfont\bfseries\centering}{\MakeUppercase\chaptertitlename\ \thechapter}{0pt}{\normalfont\uppercase}

As seen in Pic 4, put the command lines at the topmost of the file, before these lines:

\chapter{\textbf{Methodology}}\label{method}
\thispagestyle{empty}

Pic 4 - Adding the commands in my Chapter4.tex file.


{0pt}
  • is the horizontal spacing between the left margin and the  title.

{1.5cm}
  • is the vertical spacing preceding the title (which will vertically offset the title, which in turn will offset the succeeding texts as well)
  • the offset is combined with the top margin of page-without-"Chapter"
  • 3.0cm (top margin of page-without-"Chapter")
    + 1.5cm (vertical offset)
    = 4.5cm --> 5.0cm (top margin of page-with-"Chapter")

{1cm}
  • Vertical spacing between the chapter title and the next text. In this case, the vertical space between the word METHODOLOGY and the first paragraph (see Pic 1).

To read further about the formatting, download the file:
titlesec.pdf.
  • \titleformat is on page 4.
  • \titlespacing* is on page 4 and 5.

Also, read here:


3. Compile your file. Make a physical print of the *.pdf file. In my case, it is the UPMthesisEnglish.pdf file. Then measure the margins in the printed document. Otherwise use a virtual ruler. If your virtual ruler needs calibration, go to iRuler.net - Online ruler.

Unless you have nuclear-reactor-precision confidence with your method, DO NOT measure the margins by slapping on a physical ruler against the screen... like i did *oh! the shame of it*. The measurements will probably be off.

After learning from my mistake, i'm using the Screen Ruler now. See Pic 5.

Pic 5 - Virtual ruler. Screen Ruler.


Where to measure?

To measure the top margin of a page-with-"Chapter" page, go to any page with a chapter. See Pic 6.

Pic 6 - Top margin for the page-with-"Chapter" page. Also shown in this pic are the left and right margins. This pic is the superimposed result of three separate pics.


To measure the top margin of a page-without-"Chapter" page, find a page that does not have a break in paragraph (one part of the paragraph on the previous page, another part of the paragraph on this page), i.e., the page starts with a paragraph. See Pic 7.

Pic 7 - Top margin for the page-without-"Chapter" page. Also shown in this pic is the bottom margin. This pic is the superimposed result of two separate pics.


To measure the bottom margin, find a page that does not have a break in paragraph (one part of the paragraph on this page, another part of the paragraph on the next page), i.e., the page ends with a complete paragraph. See Pic 7.

The reason for not wanting a paragraph that breaks across pages is because, the line spacing (singlespace/doublespace/etc) will effect your measurement.

As for the left margin and right margin, they can be measured on any page you like. See Pic 6.


Reference

http://en.wikibooks.org/wiki/LaTeX/Page_Layout
http://www.ctex.org/documents/packages/layout/titlesec.pdf


Note

i don't know how this process will affect the ToC (Table of Contents), and other pages.

Thank you to the email sender(s).

Wednesday, May 11, 2011

Adobe Flash + 64Bit Ubuntu 11.04

Sekiranya flash browser korang jadi terencat setelah upgrade ke ubuntu 11.0464bit, sila buat langkah berikut:
  • add-apt-repository ppa:sevenmachines/flash
  • apt-get update
  • apt-get install flashplugin64-installer
  • restart browser

Dicilok tanpa kebenaran dari sini

Tuesday, May 10, 2011

How to create a boxed-label in Xfig

27 Jamadil Awal 1432H

Thank you to Brian V. Smith for his speedy reply on how to create a boxed-label using Xfig.

Pic 1 - An example of a boxed-label created using OpenOffice Writer.
See the box containing the text Sharp nose? Because i don't know what the correct term is, that's what i call a boxed-label... :P


1. Run Xfig. From the Panel > Applications > Graphics > Xfig. Refer Pic 2.

Pic 2 - Refer Step 1.


2. In the Drawing Mode panel (refer Pic 3), click the POLYLINE drawing icon (refer Pic 4).

Pic 3 - Refer Step 2. The Drawing Mode panel.


Pic 4 - Refer Step 2. The POLYLINE drawing icon in the Drawing Mode panel.


3. Near the bottom-right corner, there is a box labelled Dimension line (refer Pic 5). Click it.

Pic 5 - Refer Step 3. The Dimension line icon.


4. A pop-up window labelled Xfig: Dimension Line Settings appears. Set it as follows:

in the Line section:
- set the Thickness = 0

in the Arrows section:
- set the Types = (NONE) (NONE)
*Click + hold on the arrowhead icon. A pop-up menu appears. At the top of the menu, select (NONE).

in the Box section:
- set the Thickness = 0
 *This is the case if you want a border-less box.
 
- set the Color = pick a color (this will be the fill color of the label)
 *Since the canvas is white, it is probably a good practise for the time being to change the color to something visible. For this example, i use Pink4.

 in the Ticks section:
- make sure the Show ticks checkbox is empty.
*Ticks are the right-angled line at both ends of the line we will be drawing later.
 
in the Text section:
- put a tick in the User defined text (not actual length) checkbox.
- select the Font, Size, and Color for the text. i use the default settings.

Then click the Ok button at the bottom of the window.

Pic 6 - Refer Step 4. Changing the properties in the Xfig: Dimension Line Settings pop-up window.


5. Hold down the Shift button. Left-click the mouse button on the canvas to create the first point. Release the Shift button.


6. Left-click the mouse button again to create the final (end) point.


7. A pop-up window titled Xfig: Edit panel appears. At the bottom of this window is the Text section for you to input your text.

*When typing-in your text, make sure the cross-hair/cursor rests within the text field itself; otherwise nothing appears when you type. Think of it as a way of activating that particular field.

Pic 7 - Refer Step 7. Typing in the text.


8. When you want to see the changes, click the Apply button.

When you're satisfied with the changes, click the Done button.

Pic 8 - Refer Step 8. Previewing and confirming the changes made.


9. To make further edits to your label, click the CHANGE OBJECT via EDIT panel icon (refer Pic 10) in the Editing Mode panel (refer Pic 9). Go to your label and left-click it. The Xfig: Edit panel pop-up window (refer Pic 7, and Pic 8) appears.

Pic 9 - Refer Step 9. The Editing Mode panel.


Pic 10 - Refer Step 9. The CHANGE OBJECT via EDIT panel icon.



Note:
The height of the boxed-label follows the height of the text. You aren't able to change the height of the box. Refer Pic 11.

Pic 11 - Example how boxed-label height follows the text height.



Just in case anyone is interested to read in Brian's own words, here are excerpt from the emails.

Here is my question:
Was wondering if there is an automated feature to add boxed-labels like the one shown in the attached file Screenshot-13.png. What i understand up to now, the only way to created a boxed-label takes 3 steps: 1- create a box, 2- add the text, and 3- compound the box and text. Is there such a thing that the box automatically expands as text is typed + we can change the background color + line size? Similar to the "Insert text" feature in Microsoft Word.


And here is his reply:
That's a very good question.  xfig doesn't have exactly such a feature, but you can use the "dimension line" object to do it.

Select the line drawing tool and on the bottom panel scroll to the "Dimension line" button at the right edge. Click on it and set the following properties:

Line/Thickness = 0
Arrows/Types = (None) (None)
Box/Thickness = 0
Box/Color = your choice (this will be the color behind the text)
Uncheck Ticks/Show ticks
Under "Text" check "User defined text..."
Select the font, size and color for the text

Click Ok

To make a text box, hold the shift key and click on the canvas where you want the left edge of the text box to be and click anywhere to the right of that.
The edit panel will pop up and you can enter the text at the bottom of that.
Click Ok and voila!

The widths of the boxes will be equal to the length of the text string, so if you want them all the same width you will need to add padding spaces.

It's a little out of the ordinary, but I tried it here and it looks ok.
Once you've set up the dimension like attribute panel you just need to click twice and enter the text to make them.

Sunday, April 10, 2011

Black Screen after updating

If you get the Black Screen when booting-up the PC after updating the system...
  1. Boot-up to the Grub menu. Please refer here on how to boot-up into the Grub menu.
  2. Select the third line down. This is usually the second kernel. We are predicting that the problem is coming from the first kernel, so now we are opting for a problem-free boot-up by using the second kernel.
  3. Remember the numbers in the first line on the Grub menu, as we will delete it later. For example 2.6.35-28 -- remember this number or write it down.
  4. If you can boot-up using the second kernel, its means that the first kernel is the culprit that is giving you the Black Screen.
  5. Go to System > Administration > Synaptic Package Manager.
  6. Search for the term "linux-image".
  7. Find the linux-image package with the Latest Version numbers as you've written down in the previous steps. Right-click > Mark for complete removal.
  8. Find the linux-image-generic package with the same Latest Version numbers. Right-click > Mark for complete removal.
  9. Make sure that the numbers in the Latest Version column are the same numbers as the numbers in the first line in the Grub menu. Otherwise the first line will still appear.
  10. Click Apply then reboot your PC.
Done


Modified from here:

Saturday, April 9, 2011

Grub Menu

  1. If you only have 1 Operating System, Grub Menu will not be shown because it is turned off by default.
  2. You can enter the Grub Menu by holding down the Shift button on your PC when boot-up.
  3. If you want to turn on the Grub Menu, open your Terminal.
  4. Type sudo su then press Enter.
  5. Type sudo nano /etc/default/grub then press Enter.
  6. Comment out "GRUB_HIDDEN_TIMEOUT=0" by putting # at the beginning of the line
  7. Save it.
  8. Recompile grub with the following command "sudo update-grub".
  9. Reboot your PC.
  10. You should see the Grub Menu on the next boot-up.
*Modified from here http://ubuntuforums.org/showthread.php?p=9982109