Wednesday, October 17, 2012

Angry Birds lollipops

These lollipops were released at the same time with the bubble gums. The flavors are strawberry, pear and cola. In the center of the candy there is sour "powder" which surprises you when you reach it. All colors and flavors are 100 % natural.







Ad from Fazer:


Links:
http://www.fazer.com/Brands/Angry-Birds/Products/Lollipops/

Thursday, October 4, 2012

Angry Birds chewing gum

A Finnish candy manufacturer Fazer has launched more sweets for the Angry Birds brand.

These are the Angry Birds chewing gum packages: the Red Bird bag contains eucalyptus and strawberry flavored chewing gums and  the Bad Piggie bag contains spearmint and pear flavored chewing gums.

The Angry Birds chewing gum contains xylitol, which is a natural sweetener that is used as a sugar substitute. The xylitol has health benefits as it reduces caries and ear infections. The xylitol is a very popular (or almost a must!) sweetener in chewing gums and refreshing mints in Finland, as Finns as are very keen on keeping their teeth in good condition.

Links:
Fazer - http://www.fazer.com/fi/brands/angrybirds/
Xylitol - http://en.wikipedia.org/wiki/Xylitol




Monday, September 10, 2012

Difficulties accessing any service from Google

When trying to access anything by Google (YouTube, Google search, Blogger) I am having difficulties loading the pages, or the pages will not load at all.

This post is made at another location which uses different router and different ISP. 

Edit 2012-09-12: this problem still exists...


Edit 2012-09-13: Could this be locale related, see https://groups.google.com/a/chromium.org/forum/?fromgroups=#!topic/chromium-bugs/a_jEG6skYo8

Edit 2012-09-14: D-Link 2470B does not work for me even with latest firmware. I have hardware version E1 and firmware 5.17.


Edit 2012-09-21: The problems have disappeared as suddenly they appeared. I have not made any further efforts to fix the problem, but now everything works nicely.

Firefox: 

On Firefox 15.0.1 the pages will load, but the redirection (possibly with JavaScript) is not sending me forward. Like when signing in, the page remains the same after pressing the "Sign in" button. However, if I go to the dashboard from a shortcut, the sign in button actually had logged me in and the browser happily loads the dashboard.

If I try to post something to the blog, the blog message gets mangled. The characters are copied and replaced randomly inside of the message. Like the URLs can be "http://3.blo.3.blospotblogspot.comcom/popscan_angrygrygryrds_soda". I could not find pattern for this behavior.

Examples:
1) image URL gets corrupted: http://4.bp.blogspot.com/-M7iw-UjQfDI/UEy4L9IHgefDI/UEy4L9IHgeI/AAAAAAAAAPM/vLbiX9ZdfZ4/s1600/popscan_blogspot_com_angry_birds_soda_2_03.png
2) CSS style get corrupted: style="margin-gin-right: 1em;"

If the randomness occurs inside of the HTML or CSS, the post (web page) gets corrupted completely. And if the HTML gets broken, the posting will fail. And that happens for the most of the time... If I can successfully watch the page preview, the HTML is not corrupted (but the visible text may be) and I can publish the text.

With all the problems, errors and retries, writing a short text with 4 images took me 5 hours. And I had to keep the HTML extremely short; little longer text would get messed up.

Before I could post anything, I was seeing error "You have logged out from another location. Do you want to log in again?" I am pretty sure these two things are related... However, I got rid of this error by clearing the browser history and cache, first time this year! After using the Blogger for a while, the "logged out" problem reappears...

Chrome: 

Chrome will report:
"Virhe 126 (net::ERR_SSL_BAD_RECORD_MAC_ALERT): Tuntematon virhe."

Which is in English:
"Error 126:(net::ERR_SSL_BAD_RECORD_MAC_ALERT): Unknown error."

Absolutely nothing works.  

IE:

The result is exactly the same as in Chrome.

What have I done?

1) Cleared history and cache for all browsers
2) Rebooted my laptop
3) Made a complete antivirus scan
4) Replaced the antivirus software and made a new complete scan
5) Made a root-kit scan
6) Rebooted my laptop again
7) Tried different MTU values for my ADSL router
8) Rebooted my ADSL router several times
9) Spent hours looking for the solution
10) Performed factory reset and fresh setup for router
11) Tried different MTU values from 1200 up to 1500

Luckily I am not alone with my problem

The same issue is visible for other Finnish users at the moment (http://murobbs.plaza.fi/internet-tietoturva-ja-muu-tietoliikenne/926370-tp-link-mr3420-ja-google-ei-toimi-keskenaan-err_ssl_bad_record_mac_alert.html).

Also the same errors are shown in Google support forums, sadly there are no proper solutions for fixing this.

Edit 2012-09-12: It seems that routers/modems from many manufacturers have this problem, at least: TP-Link, D-Link, Buffalo, ZTE and Telewell.

SOLUTION:

Workaround 1:

Change your modem/router OR upgrade its firmware.

I have D-Link 2740B, which stopped working Friday 7th September. I found other modem from my closet and hooked it to ADSL-line; everything works.

The reason why it works, is yet unknown to me. I am beginning to think it is actually related to MTU value. But the strangest thing is, that the problem appeared suddenly on one day, and not only for me.

Workaround 2:

You can try to change the MTU value from your router/modem to 1400.

I have read that for some people this change has fixed the issue. The MTU value can be changed from the devices configuration pages, usually accessible by the web browser. See your device manual for details.

Edit 2012-09-12: For me, Google services work only like 2 minutes after MTU change.

Fix that works for me:

From the router settings, I changed the default  DNS address from ISP to Google's DNS which is "8.8.8.8" and rebooted the router. After the router was booted, I was able to access blogger with Firefox and also Chrome.

The Blogger will function properly only for a while after changing DNS address.

Does these fixes work for you?

Friday, September 7, 2012

New Angry Birds soda cans - Lagoon and Comet



These have just arrived! New Angry Birds soda cans with Bad Pig and Black Bird.

Lagoon (Bad Pig) has apple and pear flavor and Comet (Black Bird) has orange and cola flavor.





The manufacturer is Finnish company Olvi; check out the official pages at http://www.olvi.fi/web/en/267.

The price for the can is 1,29 e, at our local stores, in Finland.

Wednesday, September 5, 2012

How to enable and find WinSCP ini file

I just updated my WinSCP from version 4.1.3 to version 4.3.9 and I noticed that the application did not read .ini file at the start up, or at least the ini file was not where I thought it would be.

Well, besides upgrading my WinSCP client, also my OS did change from XP to Win7, so I guess it is natural that the file locations do change also. But even after full hard drive search, I could not find any *.ini file related to WinSCP!

Luckily I was not the only person who tried to find the ini file, read related forum post from here (http://winscp.net/forum/viewtopic.php?t=11264).

So the correct steps to enable your old ini file with saved sessions for WinSCP (in Windows 7) is following:
  1. Launch your WinSCP
  2. Select from the menu at left "Preferences" -> then from right hand side "Preferences" -> then "Storage" from lower left -> then select "INI file (WinSCP.ini)" -> "OK" -> "Close"
  3. The "WinSCP.ini" file was created to your "virtual folder", which can be found from "c:/Users/USERNAME/AppData/Local/VirtualStore/Program Files (x86)/WinSCP"
  4. Manually copy and paste (with text editor) the wanted sessions from old to new ini file
Note 1: The AppData folder is not visible by default, so change your folder settings to display hidden and system files.

Note 2: To make sure the new WinSCP works correctly, you need to copy&paste manually the sessions from the old Winscpxxx.ini to the new Winscp.ini



Angry Birds Splat Flyer toy

One of our younger family members got this Angry Birds Splat Flyer toy as a birthday gift. I had seen one cool YouTube video about similar toy, so I had high hopes for this "splat toy" as well.

Well, the toy is good looking, feels funny to hold in hand and is quite fun, but the "splat" effect which happens when you throw the ball to the floor is over in less than a second.

Really, the ball splats nicely to the floor, but it takes back the original form almost immediately. Perhaps if the ball is really clean and sticky, and the surface material where the toy is thrown is correct, the transformation from squished bird back to the ball shape takes (as I saw in YouTube video) several seconds.








Friday, August 31, 2012

Reading and processing video frames with Java


The class VideoSource loads a video file and offers access to the individual frames.

To use this class you need to have JMF installed on your machine. The video format must be supported by your Java/JMF platform. Best is to use no codec at all; "raw" video.

The usage is as follows:

VideoSource vs = new VideoSource("file://c:\test.avi");
vs.initialize();
...
int frameIndex = 12345; // any frame
BufferedImage frame = vs.getFrame(frameIndex);

package popscan; 
import java.awt.Graphics2D; 
import java.awt.Image; 
import java.awt.image.BufferedImage; 
import java.net.URL; 
import javax.media.Buffer; 
import javax.media.ControllerEvent; 
import javax.media.ControllerListener; 
import javax.media.Manager; 
import javax.media.Player; 
import javax.media.PrefetchCompleteEvent; 
import javax.media.RealizeCompleteEvent; 
import javax.media.control.FrameGrabbingControl; 
import javax.media.control.FramePositioningControl; 
import javax.media.format.VideoFormat; 
import javax.media.util.BufferToImage; 
public class VideoSource implements ControllerListener { 
public static final int NOT_READY = 1; 
public static final int READY = 2; 
public static final int ERROR = 3; 
Player _player; 
String _videoFilename; 
FramePositioningControl _framePositioningControl; 
FrameGrabbingControl _frameGrabbingControl; 
private int _state; 
// the filename must contain protocol,  
//for example file://c:\\test.avi 
public VideoSource(String videoFilename) { 
    _videoFilename = videoFilename; 
    _state = NOT_READY; 
} 
/* 
 * Create Player object and start realizing it 
 */ 
public void initialize() { 
    try { 
        _player = Manager.createPlayer(new URL(_videoFilename)); 
        _player.addControllerListener(this); 
        // realize call will launch a chain of events,  
        // see controllerUpdate() 
        _player.realize(); 
    } catch (Exception e) { 
        System.out.println("Could not create VideoSource!"); 
        e.printStackTrace(); 
        setState(ERROR); 
        return; 
    } 
} 
/* 
 * Returns the current state 
 */ 
public int getState() { 
    return _state; 
} 
/* 
 * Returns the number of frames for current video if  
 * the VideoSource is ready, in any other case returns -1. 
 */ 
public int getFrameCount() { 
    if (getState()!=READY) { 
        return  -1; 
    } 
    return  _framePositioningControl. 
            mapTimeToFrame(_player.getDuration()); 
} 
/* 
 * Returns the video frame from given index as BufferedImage.  
 * If VideoSource is not ready or index is out of bounds, 
 *  returns null. 
 */ 
public BufferedImage getFrame(int index) { 
    if (getState()!=READY||index<0||index>getFrameCount()) { 
        return null; 
    } 
    _framePositioningControl.seek(index); 
    Buffer buffer = _frameGrabbingControl.grabFrame(); 
    Image img = new BufferToImage((VideoFormat)buffer. 
            getFormat()).createImage(buffer); 
    // image creation may also fail! 
    if (img!=null) { 
        BufferedImage bi = new BufferedImage(img.getWidth(null),  
                img.getHeight(null), BufferedImage.TYPE_INT_ARGB); 
        Graphics2D g = bi.createGraphics(); 
        g.drawImage(img, 0,0, null); 
        return bi; 
    } 
    return null; 
} 
     
// callback for ControllerListener 
public void controllerUpdate(ControllerEvent event) { 
    if (event instanceof RealizeCompleteEvent) { 
        _player.prefetch(); 
    } else if (event instanceof PrefetchCompleteEvent) { 
        // get controls 
        _framePositioningControl = (FramePositioningControl)_player. 
          getControl("javax.media.control.FramePositioningControl"); 
        if (_framePositioningControl==null) { 
            System.out.println("Error: FramePositioningControl!"); 
            setState(ERROR); 
            return; 
        } 
        _frameGrabbingControl = (FrameGrabbingControl)_player. 
            getControl("javax.media.control.FrameGrabbingControl"); 
        if (_frameGrabbingControl==null) { 
            System.out.println("Error: FrameGrabbingControl!"); 
            setState(ERROR); 
            return; 
        }             
        setState(READY); 
    } 
} 
// for setting the state internally 
private void setState(int nextState) { 
    _state = nextState; 
} 
     
} 

And here is a tester class to demonstrate how the VideoSource works.


It creates an AWT Frame and draws the video frames one by one as fast as possible to the Frame's Graphics surface.

First it draws the frames from the first frame to the last frame and when the loop ends, the frames are drawn from the last frame to first frame. This is to show that you really can access the individual frames.

In this case the frames to be drawn are next to each other, so if you are accessing the frames randomly, you may encounter some performance issues.

package popscan; 
import java.awt.Frame; 
import java.awt.image.BufferedImage; 
public class TestFrame { 
public static void main(String[] args) { 
    VideoSource videoSource = new VideoSource(args[0]); 
    videoSource.initialize(); 
    while (videoSource.getState()==VideoSource.NOT_READY) { 
        try { Thread.sleep(100); } catch (Exception e) { } 
    } 
    if (videoSource.getState()==VideoSource.ERROR) { 
        System.out.println("Error while initing"+args[0]); 
        return; 
    } 
    Frame frame = new Frame(); 
    frame.setVisible(true); 
    int frameCount = videoSource.getFrameCount(); 
    // forward 
    for (int frameIndex=0;frameIndex<frameCount;frameIndex++) { 
        BufferedImage i = videoSource.getFrame(frameIndex); 
        // do what ever you need to do your frame 
        drawFrame(frame,i,frameIndex); 
    } 
    // backwards 
    for (int frameIndex=frameCount;frameIndex>=0;frameIndex--) { 
        BufferedImage i = videoSource.getFrame(frameIndex); 
        // do what ever you need to do your frame 
        drawFrame(frame,i,frameIndex); 
    } 
    System.exit(0); 
} 
public static void drawFrame(Frame frame, BufferedImage image,  
        int index) { 
    if (image!=null) { 
        frame.setSize(image.getWidth(), image.getWidth()); 
        frame.getGraphics().drawImage(image, 0, 0, null); 
        System.out.println("Image at index: "+index); 
    } else { 
        System.out.println("null image"); 
    } 
     
} 
}