Daily Hacks: Youtube & Google Chrome

Posted in Mini hacks with tags , , on December 14, 2010 by Gizzle
If you want to link a youtube video and want to play it from a certain time, just add ‘#t=xxmyys’ to the end of the link.

However up till now I did not figured out how to embed the clips by this way. It seems not to work in the embedded code.  :-( Suggestions?

Want to send a link to a web site from Google Chrome without installing any extension? Here you go: Select “Add bookmark” from Bookmark Manager and write into the URL-field
javascript:location.href=’mailto:?SUBJECT=’+document.title+’&BODY=’+escape(location.href);
The drawback of this method is that an email program (Outlook, Thunderbird, etc) should be installed on your system. By clicking on the bookmark, a new mail draft will be opened to send an email with the subject containing document title and in the body the link to the site. Modify, if you want.
Cheers.

Set DIR command default parameters

Posted in Mini hacks with tags , , , , on December 13, 2010 by Gizzle

Since I don’t like the the default parameters of the DIR command in the command line mode, I wandered if there is a way to set it permanently, to avoid typing each time “DIR /O:G/P” for example. And of course there is a way, following step-by-step for XP, but should be kind of similar for other windows versions too:

  1. Win + Print opens System Properties dialog
  2. Klick on the Advanced tab
  3. Environment variables
  4. Add a new variable with the name DIRCMD and the value(s) you want to be displayed in System variables field.
That’s it. Enjoy.

 

What is Exception-Safety?

Posted in C++, General Programming with tags , , , on December 7, 2010 by Gizzle

Informally, exception-safety in a component means that it exhibits reasonable behavior when an exception is thrown during its execution. For most people, the term “reasonable” includes all the usual expectations for error-handling: that resources should not be leaked, and that the program should remain in a well-defined state so that execution can continue. For most components, it also includes the expectation that when an error is encountered, it is reported to the caller.

More formally, we can describe a component as minimally exception-safe if, when exceptions are thrown from within that component, its invariants are intact. At least three different levels of exception-safety can be usefully distinguished. These distinctions can help us to describe and reason about the behavior of large systems.

In a generic component, we usually have an additional expectation of exception-neutrality, which means that exceptions thrown by a component’s type parameters should be propagated, unchanged, to the component’s caller.

From boost c++ libraries

 

Eclipse Helios + MinGw: Adding icons to the application build

Posted in Eclipse with tags , , , on November 19, 2010 by Gizzle

Recently I’ve worked a Win32 API tutorial (www.winprog.org/tutorial) for creating a simple graphical program. At the point where the icon has been added to the app, however, I’ve got stuck. The compiler did not give an error messages but neither the icon nor the menu did appear. What the hell?

Read more »

CSS3 Scribble: Rounded Corners

Posted in CSS with tags , , on September 16, 2010 by Gizzle

In CSS3 finally no more hacks are needed in order to get round corners. A simple command is all you need:

border-radius: 15 px;

Unfortunately FF does not support (yet) rounded corners from the scratch. An extra prefix is required. Following makes it work:
-moz-border-radius: 15 px;

More info about rounded corners: http://www.css3.info/preview/rounded-border/

JavaScript: “window.status” in Google Chrome

Posted in JavaScript with tags , , , on September 14, 2010 by Gizzle

Code:

<a href="example.html" onMouseOver="window.status='This sentence should become visible in the status bar of chrome'; return true"
		onMouseOut="window.status=' '; return true">Hover da mouse</a>

Issue:
While the “window.status” command works correctly in the IE, it does not seem to work in Chrome. When hovering the mouse over the link, just the link adress is shown.

Solution: Actually no solution, at least I did not found out. Just the information that the ‘dom.disable_window_status_change’ is disabled in Chrome due to security issues. While you can configure it in FF by typing ‘about:config’ in the address, there is no such a ‘hack’ in Chrome.

However, if anybody does know a fix, feel free to comment. Thx.

Multiline Strings and Other Text Editing Features in MatLab GUI

Posted in MatLab with tags , on June 21, 2010 by Gizzle

Originally I intended to write only couple of lines about programmatically plot editing in MatLab. But then digging a bit more through the web, I found quite interesting stuff about possibilities you can do in MatLab with the GUI. So now it is a bit more, I hope you like it.

As I am a comfortable guy,  I find working in plot editor mode kind of annoying. I do not like clicking all around and enjoy much of doing things programmatically, especially things which have to be do 20-30 times or even much more often per day.

Today I had to plot several similar figures. All the figures needed a title, so instead doing this in editor mode, I wrote a line of code. Actually I wanted the title to be two lines long therefore multiline and thought a simple ‘\n’ like I know it from C++ would do it, but I was wrong.

The solution for multiline strings in MatLab is to handover the string as as a cell array where each entry? is a new line is . So if you want to give out

This is the first line

and this the second

just write

title( { ‘This is the first line’ ‘and this the second’} )

Simple need, simple solution.

Additionally while looking up on the web, I’ve found out another solution where actually the ‘\n’ – style input works. Just use ‘sprintf’ to format the text. So the above example would go like this:

title( ( sprintf(‘This is the first line \n this the second’ ) )

Of course you can also use value arguments as place holder:

test_string = ‘just testing’

title( sprintf( ‘print second line \n %s’, test_string ) )

where %s stands for a defined value like ‘just testing’ in this case.

So far, so good. But really interesting was to me to find out that you can use basic HTML commands to manipulate your figures beyond simple text strings. Actually it was new to me that you can define controls similar to those in PHP/HTML. By defining

handle = uicontrol

a simple button is created (default option for user interface control in MatLab). Of course be setting appropriate ‘Style’ you can create radio buttons, sliders, editable text fields and other useful controls, see uicontrol in the MatLab help.

Extened features come into play, when usage of ‘String’-property is made. Then you can just use HTML-tags and format the control in HTML Style, e.g.

uicontrol(‘Style’,'popup’, ‘Position’,[10,10,150,100], ‘String’, … {‘<HTML><BODY bgcolor="green">green background</BODY> </HTML>’, … ‘<HTML><FONT color="red" size="+2">Large red font</FONT></HTML>’,…’<HTML><BODY bgcolor="#FF00FF"> <PRE>fixed-width font’});

creates a nice and colorful pop-up menu. Having this you can improve your figure just by adding some simple HTML- tags.

Have fun playing around….

File Managing in MatLab Editor

Posted in MatLab with tags , , , , on June 11, 2010 by Gizzle

Today rather by coincidence I’ve found a cool little feature of MatLab files editor, which makes file handling more comfortable (at least for me).

By the standard setup all opened files are shown like tabs at the bottom, see. picture below. If you have too many of them and it happens quite often if you work on a project, the tendency to lose overview is obvious. Longer file names will be cut and you have to scroll horizontally to get the one you want.

matlab_lost_overview

Like I mentioned, today I was really upset by scrolling and looking what files are selected, so I started clicking and discover that like in Windows you can determine where this bar has to be. Just right click on the bar and you see this little menu, got it?

 editor_right_click

For myself the best position is on the right side. This way I see the code and have full overview about all files opened right now. Additionally sometimes it’s useful to check the “Alphabetize” option. Of course if you have really many files opened,  you also have to scroll, but then you have a really large project to work on. What a pity :-)

Try it out, it’s very simple, may be to obvious…

matlab_right_side

Fragen an Jan Delay

Posted in Uncategorized on June 7, 2010 by Gizzle

Fragen über Fragen von Fans an den Musiker

Kicking Some Facts ‘bout Facebook

Posted in Web 2.0 with tags , , on May 15, 2010 by Gizzle

Facebook: What You Probably Didn't Know

Follow

Get every new post delivered to your Inbox.