Why Application Loader Unavailable

Posted February 14th, 2012 in Programming by Mason

When I upload a package to Mac App Store today, I got the error message when using Application Loader:

Application loader is currently unavailable. Directory Services reported the following error: Your Apple ID or password was entered incorrectly. (-20101)

At the beginning I thought that it’s because of the network error. But when I try it again after several hours, the error was still there. I then changed my network to use a proxy, still the same error. Then I logged to iTunes use my account, and authorized the computer, no lucky to resolve it. Finally I resolved the issue by several simple steps:

  1. Quit Application Loader
  2. Load Keychain Access, select “passwords” from category
  3. Search for “itunes”, you’ll see an application password item with the name starting with “iTunes Connect:…”
  4. Remove this item, and run Application Loader again, you’ll get prompt to input your id and password.

This is the difference for applications on Mac and Windows. Windows does not have a centralized  place for internet and applications to save password, each browser or application has their own approach to manage passwords. But Mac has the Keychain Access to manage all your passwords. Once you are told that something is wrong with your id/password on Mac, then the first place to go is the Keychain Access, try to remove the stored password and login again.

Good luck:)

 

The Lean Startup, My Real Practice

Posted January 15th, 2012 in Business by Mason

Recently I read the book The Lean Startup. I really learned a lot from the book, new ideas and new concepts. I’ve been using Pomodoro Technique for several months, and use  focusbooster to track my time, log interruptions, completions and discarded pomodoros with pencil on my calender. But when I relied more on Pomodoro Technique. I really need to get statistics and want to learn from it. In addition, I hope I can get some simple GTD functionality into the timer instead of only counter down.

So 2 things motivated me: one is the book The Lean Startup,  another one is that I need a time management tool. I decided to practice the methods from the book with a minimum viable product. I do this in my spare time, and here is the timeline for my practice:

1. Purchased the domain “PomodoroApp.com” on Christmas Eve, 2011.

2. Spent 2 days(12/24, 12/25, 2011) to research the market,  investigation the necessary technology, including website, user experience, feature list, and so on.

3. Starting from the evening of 12/25/2011, I started building website.

4. Starting from 12/26/2011, I started coding.

5. My initial plan is really aggressive. I hope I can get a *minimum viable* software in 3 days, and get everything done, including the website. But late I found 3 days can just started the work with a very very rough version, not “viable”.

6. In the coming 3 weeks, I spent my weekends and after work hours(0~2 hours/day) working on the product. The New Year Holiday I spent 2 days to travel with my wife, no work.

7. 1/14/2011, 2 days to work for release: final test, refine installation package, config website, grab screenshots, write web pages, set pricing plan, submit to download site/search engine and so on.

8. After released to web, I also spent some time to refine and optimize website, e.g. setup cache for website, schedule some resources to load from CDN for opening speed and so on.

After I completed all those work. I started to played web game for a while for a rest. Then started to write this blog post.

So as a summary:

To release a minimum viable product on time management area to improve personal productivity, here is the cost:

  • 2 days for marketing research and technique investment.
  • 5 days, and a number of after work hours in 3 weeks  for software design and programming.
  • 2 days for releasing: website, submission.

 

Qt failed on “configure” on Windows with Visual Studio

Posted December 21st, 2011 in Programming by Mason

When I cloned Qt source code from git, and open a Visual Studio Command Prompt (2010), and went to Qt directory, and run command “configure.exe” to compile the Qt source code, I got the error like something below:

%QTDIR%\src\corelib\global\qglobal.h(62) : fatal error C1083: Cannot open include file: ‘QtCore/qconfig.h’: No such file or directory…

It’s failed on the very beginning when make “qmake”. Via process monitor, I verified that actually the qconfig.h has already been created under “%QTDIR%\src\corelib\global\”. I have ever compiled the source code from git without any problem. Searched from google, someone mentioned that I need to run “syncqt.bat” from bin folder. syncqt actually is a perl script. Someone replied that don’t need to run syncqt.

I tried to install perl, and added perl/bin into my system environment variable path, and then everything works fine. The reason is that “configure.exe” relies on perl script to create the Qt library header structure for development.

Just a clue for anyone who searched related information and come to this page.

Deploy Application on Mac with dylib as private framework

Posted October 15th, 2011 in Programming by Mason

Qt’s tool macdeployqt is excellent for automatic deploy qt applications on Mac. But the limitation is that macdeployqt can works only for your custom frameworks. If you have dylib to be deployed, you’ll get some trouble. Here is my script to deploy my library DuckCore with DuckCapture:


macdeployqt release/DuckCapture.app

declare DUCKLIB=libDuckCore.1.dylib
declare DUCKAPP=release/DuckCapture.app
mkdir -p $DUCKAPP/Contents/Frameworks
cp release/$DUCKLIB $DUCKAPP/Contents/Frameworks/$DUCKLIB
install_name_tool -id @executable_path/../Frameworks/$DUCKLIB $DUCKAPP/Contents/Frameworks/$DUCKLIB
install_name_tool -change $DUCKLIB @executable_path/../Frameworks/$DUCKLIB $DUCKAPP/Contents/MacOS/DuckCapture

The main approach is to use the tool “install_name_tool” for dylib, and you’d better to pay more attention to path. It’s easy to make mistakes on path in this script.

In addition for releasing, there is another issue for debugging applications with xcode. You can open a console, and run commands below:

export DYLD_PRINT_LIBRARIES=1
open xcode

You’ll get some clues when dylib is missing.

Grab Screen on Mac Easily

Posted February 21st, 2011 in Products by Mason

The free screen capture tool DuckCapture for Windows has been ported to Mac successfully. You can now download the free tool DuckCapture for Mac OS X to copy your screen easily!

The majority functionalities of DuckCapture have been ported:
- Capture a screen by selecting rectangle/polygon area, window or the full macintosh screen
- Editing Tools: adjust the selected area, grab more screen area in one shot
- Annotation Tools: add lines, rectangles, polygon, polyline, arrows, or text. Select your favorite border color, filling color, or font family
- Save to disk or copy to system clipboard
(Read more details here)

But some features are still in progress:
- Share simply by one click: upload to min.us and open the link
- Capture tall web page by automatic scrolling

You can download it here.

The case deserves your attention: incorrect checksum for freed object

Posted February 8th, 2011 in Programming by Mason

When I port my free screen capture tool DuckCapure to Mac OS. I got an exception every time when I start to capture the screen. The error message is:

DuckCapture(10059,0x7fff7006aca0) malloc: *** error for object 0×103468168: incorrect checksum for freed object – object was probably modified after being freed.

*** set a breakpoint in malloc_error_break to debug

The program has unexpectedly finished.

I’m very confused with this assertion, the error happens when I use the data member from an internal class called DWidgetData, the constructor is as follows:

    DWidgetData()
        : m_pStyledContainer( NULL )
        , m_pContainerContainer( NULL )
        , m_pLayout( NULL )
        , m_pAnimationFading( NULL )
        , m_pEffectOpacity( NULL )
        , m_pEffectDropShadow( NULL )
    {}

The debugger shows a very strange content for a just initialized DWidgetData object:

Looks like the data corruption, or the constructor is never called. I have another test application which used the same component and passed the test, but DuckCapture failed. I spent hours on this issue, and finally resolved it:

Reason: In dynamic linked library DuckCore, I used forward declaration for DWidgetData in header file, and defined the class in source file. Looks reasonable, huh? However, I happened to define another DWidgetData in DuckCapture also. That’s the nightmare. The code in DuckCore used the DWidgetData in DuckCapture instead of the one defined in the source file I used it.

This is another dangerous case on compiler compatibility: Visual Studio 2008/2010 on Windows works, but gcc 4.2 on Mac OS does not.

Qt Creator/qmake compiling issues on Mac and Windows

Posted February 7th, 2011 in Programming by Mason

Qt Creator is the best tool for you to create/maintain cross platform (Mac, Windows, Linux) project files. You can use Qt Creator project file (*.pro) to handle the platform dependent files as well. In addition, there are also slight difference between Windows and Mac when you use qmake.

1. Add platform dependent configures in pro file.

Please refer to the code below:

mac {
ICON = images/app.icns
OBJECTIVE_SOURCES += utils.mm
LIBS += -framework Cocoa
QMAKE_INFO_PLIST = min.us.Info.plist
}
win32 {
SOURCES += \
    utils.cpp
RC_FILE = min.us.rc
}

You can use “mac { … }” to include any information which is specific to Mac OS. For example, the application icon which is specific for Mac OS, framework, or an Objective-C source file. Someone may use the style “else:win32{ … }”. I prefer the condition without “else:”. Please note that “unix { … }” has already included the case that this is a Mac machine, so if you have something works only on unix, you can use one of the two styles: “unix:!mac { … }”, or “mac { … } else:unix { … }”

2. Use qmake to generate makefile or project files for Visual Studio / XCode

qmake is a great command line tool, I used it to generate project files for my favorite IDE on different platforms: Visual Studio on Windows, xCode on Mac OS. I use Qt Creator as my IDE on Ubuntu.

On Windows, the command “qmake -tp vc” can generate vcxproj for Visual Studio 2010 or vcproj file for Visual Studio 2008 depending on your command line environment, or you can specify the version explicit by “-spec” parameter or by setting environment variable “QMAKESPEC”. The “qmake -tp vc” means, use the templat prefix “vc” when run qmake for pro file, actually template prefix “vc” means generate Visual C++ project file.

On Mac, you the default behavior of “qmake” just generate xcode project file. So just run “qmake” under the folder with “pro” file.

You may also need to generate make file to make an automated building script. qmake can also do it perfectly. On Windows, the default behavior of “qmake” is to generate makefiles, and then you can follow with “nmake” or “nmake debug”/”nmake release”. On mac, if you run “make”, you may get the error message “make: *** No targets specified and no makefile found. Stop.”, just run the command “qmake -spec macx-g++” to generate makefile: use “spec” parameter to specify the make spec “macx-g++” which will help you to generate makefile.

3. Handle application icons on Mac OS / Windows

On Windows, you need to have an “rc” file, and add an icon file. Please include this rc file for Windows only. On Mac, use the qmake internal variable “ICON’ to specify the application icon. Please refer to the sample code above for more details.

4. C/C++ Cocoa/Carbon mixed module:

Sometimes you need to handle mixed module on Mac, that is, you may include Objective-C files in your project file. In Qt 4.7, there is still an issue if you want to generate xcode file. The bug has been logged to Nokia here: QTBUG-7953. Read the details in the bug report to get a solution, or wait for a future release.

Blog Relaunched

Posted January 17th, 2011 in Business by Mason

After ~2 years of no blogging on libg.org, I decided to relaunch my blog writing. It’s a place for me to share my experience on business, user interactive design, programming, internet marketing, as well as my products.

The blogs will mainly include topics below:

  • Tips behind design. When Kelly and I design a feature, we get user requirements, feedbacks, and consider market trends, future directions, and a lot of aspects. We try to make things simple, and make ease-to-use usability. I’d like to share the interesting stories behind feature and user interactive design.
  • Problem resolved. Not only about programming, but also platform (Microsoft Windows, Mac OS, Linux) related issues, my core framework, software deployment, website, and so on.
  • Marketing, Sales, and Business. The final goal is to sell more licenses. There may be tips, experience, success story, or whatever need to share.
  • A formal product site can get more trust from visitors. There should be another place for me to share more information about products. When visitors subscribe the product site, the content of this category will be send.

What’s new in DuckCapture 2.6

Posted January 9th, 2011 in Products by Mason

Version 2.6 updates:

- Added rich tools for fonts: family font, font size, color and so on.
- Refined color selection window.
- Use script to extend the functionalities after grab screen, provided the capability of customizing ui and adding new buttons.
- Added one sample script which can share the captured images through http://min.us.

Download Latest Version(For Windows, For Mac OS X 10.6 or above)

 

What’s new in DuckCapture 2.5

Posted December 1st, 2010 in Products by Mason

Version 2.5 is just a minor update with usability refine: close the full screen editor after you successfully copied to  clipboard or saved to file. This will reduce one click in the whole “print screen” process.

Many users have complained that after they installed the new version of DuckCapture, they don’t like the way the version  2.4 behaves after a screen area capture. In the version  2.3, a couple of small buttons appeared at the lower right corner after you selected the area to capture, and give you the option to save or discard. In version 2.4, these buttons have been moved to the bottom of the screen, and more editing/annotation tools are provided there. User may need one more click to exit, and it makes many users confusing. You may wonder why 2.4 is not easy to exit as before. The reason is, more editing tools have been provided and it’s not just capturing screen anymore. If user only captured something, and discard it by mistake, what user need to do is to re-capture it. But if user has spent some efforts on adding annotations, then we should be very careful. That’s why one more click in 2.4. Finally version 2.5, a quick update with minor fix, make it have the same usability as 2.3 according to a lot of users’ suggestions.

Download Latest DuckCapture Now >>