Some my friends who read my arbitrary blog are dissatisfied by my posts related to a SW development. That's the reason to start the blog here. It is especially targeted to the SW development topics which are interesting for me. According to this any terms ambiguity have to be interpreted in context of software development :-). Constructive comment are welcome. English please.
Thursday, October 13, 2011
Multiple working folders with single GIT repository clone
Actually the trick is quite trivial, we use our knowledge of git internals and unix symbolic links to achieve what we want. All we wanted is to have one repository and multiple working folders associated with it, so lets do just that.
Monday, August 8, 2011
Monday, April 4, 2011
Disable screen rotation at runtime on Android
It's strange I found no ready solution in Net...
There are two sources that help me:
http://stackoverflow.com/questions/2795833/check-orientation-on-android-phone
http://www.anddev.org/rotate_screen_from_code_change_screen_orientation-t2687.html
Finally, the next code is really works (I tested it):
There are two sources that help me:
http://stackoverflow.com/questions/2795833/check-orientation-on-android-phone
http://www.anddev.org/rotate_screen_from_code_change_screen_orientation-t2687.html
Finally, the next code is really works (I tested it):
public class MyActivity extends Activity {
private int mRuntimeOrientation;
private boolean mDisableScreenRotation;
protected int getScreenOrientation() {
Display display = getWindowManager().getDefaultDisplay();
int orientation = display.getOrientation();
if (orientation == Configuration.ORIENTATION_UNDEFINED) {
orientation = getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_UNDEFINED) {
if (display.getWidth() == display.getHeight())
orientation = Configuration.ORIENTATION_SQUARE;
else if(display.getWidth() < display.getHeight())
orientation = Configuration.ORIENTATION_PORTRAIT;
else
orientation = Configuration.ORIENTATION_LANDSCAPE;
}
}
return orientation;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mRuntimeOrientation = this.getScreenOrientation();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
if (mDisableScreenRotation) {
super.onConfigurationChanged(newConfig);
this.setRequestedOrientation(mRuntimeOrientation);
} else {
mRuntimeOrientation = this.getScreenOrientation();
super.onConfigurationChanged(newConfig);
}
}
}
private int mRuntimeOrientation;
private boolean mDisableScreenRotation;
protected int getScreenOrientation() {
Display display = getWindowManager().getDefaultDisplay();
int orientation = display.getOrientation();
if (orientation == Configuration.ORIENTATION_UNDEFINED) {
orientation = getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_UNDEFINED) {
if (display.getWidth() == display.getHeight())
orientation = Configuration.ORIENTATION_SQUARE;
else if(display.getWidth() < display.getHeight())
orientation = Configuration.ORIENTATION_PORTRAIT;
else
orientation = Configuration.ORIENTATION_LANDSCAPE;
}
}
return orientation;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mRuntimeOrientation = this.getScreenOrientation();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
if (mDisableScreenRotation) {
super.onConfigurationChanged(newConfig);
this.setRequestedOrientation(mRuntimeOrientation);
} else {
mRuntimeOrientation = this.getScreenOrientation();
super.onConfigurationChanged(newConfig);
}
}
}
Thursday, March 17, 2011
C++ exceptions in destructors
Latest time while I'm looking a new job place and participating in interviews with professionals at other companies I continiously try to lighten different C++ questions...
I will post here Links to most appropriate C++ articles like previous and this ones...
C++ exceptions in destructors
I will post here Links to most appropriate C++ articles like previous and this ones...
C++ exceptions in destructors
Tuesday, March 8, 2011
One more time about C++ exception performance
The article C++ Exception Handling and Performance by Vlad Lazarenko is very demonstrative according to modern C++.
Subscribe to:
Posts (Atom)