This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open Terminal and enter, | |
# Replace 2 with a number between 0 and 3. | |
# 0: Light | |
# 1: Standard | |
# 2: Medium | |
# 3: Bold | |
defaults -currentHost write -globalDomain AppleFontSmoothing -int 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If no resource for the given package exists, this package is not installed in the phone | |
try { | |
mGenieResources = getPackageManager().getResourcesForApplication(GENIE_PACKAGE_ID); | |
} catch (PackageManager.NameNotFoundException e) { | |
// no weather info available | |
Log.w(LOG_TAG, "Can't find "+GENIE_PACKAGE_ID+". Weather forecast will not be available."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build specified package and transfer it to the connected emulator/device. | |
function fsnod { | |
mmm -j6 frameworks/base frameworks/base/core/res snod | |
adb shell stop | |
adb sync | |
adb shell start | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use jdb to debug Android application | |
# Run ddms and select application to forward port. | |
ddms | |
# Execute jdb and attach to the listening application | |
jdb -attach localhost:8700 | |
# Or in windows, need to specify connector explicitly | |
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=8700 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PerfectNumberFinder { | |
public static boolean isPerect(int number) { | |
// get factors | |
List<Integer> factors = new ArrayList<Integer>(); | |
factors.add(1); | |
factors.add(number); | |
for (int i = 2; i < Matj.sqrt(number); i++) { | |
if (number % i == 0) { | |
factors.add(i); | |
if (number / i != i) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static boolean isConnected(Context context) { | |
ConnectivityManager connectivityManager = (ConnectivityManager) | |
context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo networkInfo = null; | |
if (connectivityManager != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Environment.getExternalStorageState() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c | |
index 6b7c7c3..c6df02d 100644 | |
--- a/lib-src/emacsclient.c | |
+++ b/lib-src/emacsclient.c | |
@@ -1479,7 +1479,7 @@ w32_give_focus () | |
/* Start the emacs daemon and try to connect to it. */ | |
void | |
-start_daemon_and_retry_set_socket (void) | |
+start_daemon_and_retry_set_socket (char* sname) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-key c++-mode-map [(f8)] 'my-make-compile-command) | |
(define-key c++-mode-map [(f9)] 'my-make-g-compile-command) | |
(defun my-make-compile-command () | |
(interactive) | |
(set (make-local-variable 'compile-command) | |
(concat "make -C " default-directory)) | |
;; (setq current-prefix-arg '(4)) ;C-u | |
(call-interactively 'compile)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setenv DEFAULT_WORKSPACE "default" | |
if ( $?WORKSPACE == 0 ) then | |
setenv WORKSPACE $DEFAULT_WORKSPACE | |
endif | |
# Define alias 'et' to connect to the proper Emacs server identified by EMACS_SEVER_NAME | |
setenv EDITOR "emacsclient -s $WORKSPACE -t -a ''" | |
alias et "$EDITOR" | |
# Create alias 'kill-emacs' to kill proper Emacs server. |
OlderNewer