Skip to main content

Posts

Showing posts from March, 2012

Repair GRUB2 Boot

After installing Ubuntu next to Linux Mint, Ubuntu started to be default option.

It was annoying :)

I started to search how to deal with GRUB2, but the problem was about installing grub from Mint partition.

The easiest solution is to install Boot Repair: http://sourceforge.net/p/boot-repair/home/Home/

I've found it on Ubuntu forum: http://ubuntuforums.org/showthread.php?t=1769482

I can recommend it, really worked from first try :)

Install in Ubuntu:
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update && sudo apt-get install -y boot-repair && boot-repair

HTML5 MMO - Browser Quest

http://browserquest.mozilla.org/

Mozilla created HTML5 MMO game. I've tried it in Chrome and it works so +1 for cross browser game.

Sources are on github: https://github.com/mozilla/BrowserQuest

To learn more see: http://hacks.mozilla.org/2012/03/browserquest/

My Meet.JS Presentation

How to Test? Is unit testing really helpful?


My presentation form last Meet.JS: http://goo.gl/u7w61 (in Polish)


Presentation is about Testing, not only about JavaScript, but in general.
I must admit that I was influenced by inventing-on-principle by Bret Victor

Hopefully this presentation encourage people to think about testing as a way to speed up development, not as a  cost :-)

If you attended last Meet.JS let me know what you think, I wasn't as good as Bret so I will be glad for comments how to be better :-)

netbeans.conf - How to make NetBeans faster

I've started to experimenting with NetBeans again, but for that I need to make NetBeans faster...

Consider adding to your /etc/netbeans.conf minimal and maximal Heap sizes (larger than default).
-J-Xms256m  start level
 -J-Xmx1024m maximum
Adjust it to your RAM, and current memory usage.

on Windows 7:
netbeans_default_options="-J-client -J-Xss2m -J-Xms128m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true -J-Xverify:none -J-Xmx512m -J-XX:CompileThreshold=100 -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled "

Ideas from: http://performance.netbeans.org/howto/jvmswitches/

Beware that on LinuxMint I used only

-J-Xms512  -J-Xmx2048m
without GC and CompileTreshold due to slowdown of IDE and whole system (100% CPU without reason).

The best idea is to experiment and try on your machine.

Furthermore consider disabling as much Plug…

Learn WebGL with Erik Moller

A WebGL instructional video by Erik Moller.
I think that this is awesome opportunity to learn WebGL! Watching video is really easy, and with just that you can learn basics of WebGL. 
Of course WebGL is supposed to be low-level API and I suggest to use Library like THREE.js or J3D, but ability to know what this libraries are doing can be really helpful.

Learn Backbone with Code School

Awesome course of Backbone: http://backbone.codeschool.com/levels/1

Looks really impressive, added to my todo list. For now I must prepare slides for sunday meet.js barcamp :)

Missing GPG keys

Recently I've been annoyed by missing GPG keys in Linux Mint.

Fortunately there are existing solutions:


http://community.linuxmint.com/tutorial/view/172 But it worked when I changed keyserver to: 
$ sudo apt-get update 2> /tmp/keymissing; for key in $(grep "NO_PUBKEY" /tmp/keymissing |sed "s/.*NO_PUBKEY //"); do echo -e "nProcessing key: $key"; gpg --keyserver keyserver.ubuntu.com --recv $key && gpg --export --armor $key | sudo apt-key add -; done
Or You can try:  http://www.howtogeek.com/72934/how-to-automatically-import-missing-gpg-keys-in-ubuntu/ But first command worked for me.

getElementById - how to check it

How to deal with getElementById Recently I found code:

var d = document; function doSomething(name){ if( typeof document.getElementById(name) != 'undefined' ) document.getElementById('innerFrame_'+name).src=document.getElementById('innerFrame_'+name).src }

For me there are problems in this code...

getElementById can return only element itself or null.  http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getElBId
var d = document; function doSomething(name){ if( document.getElementById(name) ) document.getElementById('innerFrame_'+name).src=document.getElementById('innerFrame_'+name).src } Null is falsy, Element as Object is always truthy. Just use it as if condition.
Logical problem in if condition and it's contents. I realized that function changes different element that it is testing for existence. The best option is to stop testing for existence of element by id of name, and check only for 'innerFrame_'…