Sonntag, 4. Januar 2015

Responsive Web Design - Configure the Viewport

More and more people are surfing the internet by mobile phones, pads, ... and of course this devices have different (smaller) screen sizes.

There are some general basics you have to follow to render your site(s) well on this new devices, all of this techniques is often called "Responsive Web Design".

Let's start with "Configure the Viewport":


A viewport setting controls how a page is displayed on a mobile device. Without a viewport specified, mobile devices will render the page at a typical desktop screen width and scale them to fit the real screen width. The setting of "width=device-width" avoids this, the real width is used.

Some browsers will keep the page's width constant when rotating to landscape mode, and zoom rather than reflow to fill the screen. Adding the attribute "initial-scale=1" instructs browsers to establish a 1:1 relationship between CSS pixels and device independent pixels regardless of device orientation, and allows the page to take advantage of the full landscape width.

Resolution: Pages optimized to display well on mobile devices should include a meta viewport in the head of the document specifying "width=device-width" and "initial-scale=1":

<meta name=viewport content="width=device-width, initial-scale=1">



Samstag, 3. August 2013

Mac OS X 10.6: How to enable native NTFS read/write support

Snow Leopard (Mac OS X 10.6) has the ability to mount NTFS volumes as read/write, but it's not enabled.
Just read-only is supported, as in version 10.5. 

But there is a simple tool to enable full read/write support for NTFS drives in Snow Leopard:

http://ntfsmounter.com/  - Click here to open in new window

I installed it and it seems to work fine, but don't forget you will use it at your own risk ...

Freitag, 12. April 2013

How to bring toolbars in a row using MFC (Microsoft Foundation Classes)


Normally you add Toolbars like this:

header file ('MainFrm.h'):
.............
CMFCMenuBar       m_wndMenuBar;
CMFCToolBar       m_wndToolBar;
CMFCToolBar       m_wndToolBar_Views3D;
CMFCToolBar       m_wndToolBar_Export2D;
CMFCToolBar       m_wndToolBar_Export3D;
.............

source file ('MainFrm.cpp'):
............. 
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Views3D.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Export2D.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Export3D.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar);
DockPane(&m_wndToolBar_Views3D);
DockPane(&m_wndToolBar_Export2D);
DockPane(&m_wndToolBar_Export3D);
 .............


But this results in showing every toolbar on a new row .... :-(




It's very simple to change this to having all toolbars in one row,
just replace the code above (in 'MainFrm.cpp') with this one:

source file ('MainFrm.cpp'):
............. 
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Views3D.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Export2D.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar_Export3D.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar_Export3D);
DockPaneLeftOf(&m_wndToolBar_Export2D, &m_wndToolBar_Export3D);
DockPaneLeftOf(&m_wndToolBar_Views3D, &m_wndToolBar_Export2D);
DockPaneLeftOf(&m_wndToolBar, &m_wndToolBar_Views3D);
 .............


Now you have it in one row .... :-)







Samstag, 3. November 2012

Using '_MSC_VER' to check Microsoft Visual Studio version


If you develop applications for Windows using a Microsoft Visual C++ Compiler,  you may use the macro '_MSC_VER' to check what compiler (version) you are using. Newer compilers have more possibilities of course or (more worse) things have just changed. So if you want (or must) support older ones you have to split your code.

The (current) values are:

MSVC++ 12.0 _MSC_VER = 1800 (Visual Studio 2013)
MSVC++ 11.0 _MSC_VER = 1700 (Visual Studio 2012)
MSVC++ 10.0 _MSC_VER = 1600 (Visual Studio 2010)
MSVC++ 9.0  _MSC_VER = 1500 (Visual Studio 2008)
MSVC++ 8.0  _MSC_VER = 1400 (Visual Studio 2005)
MSVC++ 7.1  _MSC_VER = 1310 (Visual Studio 2003)
MSVC++ 7.0  _MSC_VER = 1300 (Visual Studio 2002)
MSVC++ 6.0  _MSC_VER = 1200
MSVC++ 5.0  _MSC_VER = 1100

And here is a simple example how to use it:

#if (_MSC_VER >= 1600)  /*Visual Studio 2010*/
typedef /*unsigned*/ char mychar8; /**< defines the utf-8 character type. */
typedef wchar_t mychar16; /**< defines the utf-16 character type. */
#else /*(_MSC_VER >= 1600)*/
typedef /*unsigned*/ char mychar8; /**< defines the utf-8 character type. */
typedef unsigned short mychar16; /**< defines the utf-16 character type. */
#endif /*(_MSC_VER >= 1600)*/


Dienstag, 25. September 2012

Internetcafes: Sind anonyme W-LAN-Hotspots zulässig?

Das Landgericht (LG) München I hat sich in einem jüngst veröffentlichten Urteil damit befasst, ob die Betreiber von kostenlos nutzbaren W-LAN-Hotspots, wie man sie in Hotels, Cafés oder Gaststätten findet, zur Erhebung und Speicherung von Nutzerdaten verpflichtet sind.

Sehr interessant, hier klicken und bei http://www.e-recht24.de weiterlesen ...



Sonntag, 9. September 2012

Mac OS X keyboard shortcuts

It's very useful, if you know where to find all the existing Mac OS keyboard shortcuts!

As far as I know the only complete list, can be found here:

http://support.apple.com/kb/HT1343

And of course it's highly reliable, because it's from Apple Support !