Tutorial by Examples: c

This command, given a commit range commit1..commit2, rewrites history so that git commit author becomes also git committer: git filter-branch -f --commit-filter \ 'export GIT_COMMITTER_NAME=\"$GIT_AUTHOR_NAME\"; export GIT_COMMITTER_EMAIL=\"$GIT_AUTHOR_EMAIL\"; exp...
To list all the git repository locations on your you can run the following find $HOME -type d -name ".git" Assuming you have locate, this should be much faster: locate .git |grep git$ If you have gnu locate or mlocate, this will select only the git dirs: locate -ber \\.git$
To comment on the same line as the code you can use &:: or &rem. You can also use && or || to replace &. Example : @echo off echo This is a test &::This is a comment echo This is another test &rem This is another comment pause A curiosity: SET command allows limit...
the easiest way is to have the local branch checked out: git checkout old_branch then rename the local branch, delete the old remote and set the new renamed branch as upstream: git branch -m new_branch git push origin :old_branch git push --set-upstream origin new_branch
Note: The shown CMake error messages already include the fix for "non-standard" library/tool installation paths. The following examples just demonstrate more verbose CMake find_package() outputs. CMake internally supported Package/Module If the following code (replace the FindBoost modul...
vagrant reload --provision
DateUtils.formatDateTime() allows you to supply a time, and based on the flags you provide, it creates a localized datetime string. The flags allow you to specify whether to include specific elements (like the weekday). Date date = new Date(); String localizedDate = DateUtils.formatDateTime(contex...
Date date = new Date(); df = new SimpleDateFormat("HH:mm", Locale.US); String localizedDate = df.format(date) Commonly used patterns: HH: hour (0-23) hh: hour (1-12) a: AM/PM marker mm: minute (0-59) ss: second dd: day in month (1-31) MM: month yyyy: year
String fileName = "Fruit.xlsx"; String sheetName = "Apples"; XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(sheetName) ; for (int r=0;r < 3; r++ ) { XSSFRow row = sheet.createRow(r); //iterating c ...
Grunt is a JavaScript Task Runner, used for automation of repetitive tasks like minification, compilation, unit testing, linting, etc. In order to get started, you'll want to install Grunt's command line interface (CLI) globally. npm install -g grunt-cli Preparing a new Grunt project: A typica...
Guice is the default dependency injection (further DI) framework of Play. Other frameworks may be used as well, but using Guice makes development efforts easier, since Play takes care for things under the veil. Injection of Play API-s Starting from Play 2.5 several API-s, which were static in the ...
CountDownTimer is useful for repeatedly performing an action in a steady interval for a set duration. In this example, we will update a text view every second for 30 seconds telling how much time is remaining. Then when the timer finishes, we will set the TextView to say "Done." TextView ...
In this example, we will pause/resume the CountDownTimer based off of the Activity lifecycle. private static final long TIMER_DURATION = 60000L; private static final long TIMER_INTERVAL = 1000L; private CountDownTimer mCountDownTimer; private TextView textView; private long mTimeRemaining; ...
MAPCAR is the most used function of the family: CL-USER> (mapcar #'1+ '(1 2 3)) (2 3 4) CL-USER> (mapcar #'cons '(1 2 3) '(a b c)) ((1 . A) (2 . B) (3 . C)) CL-USER> (mapcar (lambda (x y z) (+ (* x y) z)) '(1 2 3) '(10 20 30) '(1...
MAPCAN: CL-USER> (mapcan #'reverse '((1 2 3) (a b c) (100 200 300))) (3 2 1 C B A 300 200 100) CL-USER> (defun from-to (min max) (loop for i from min to max collect i)) FROM-TO CL-USER> (from-to 1 5) (1 2 3 4 5) CL-USER> (mapcan #'from-to '(1 2 3) '(5 5 5)) (1 2 3 4 5...
MAPC: CL-USER> (mapc (lambda (x) (print (* x x))) '(1 2 3 4)) 1 4 9 16 (1 2 3 4) CL-USER> (let ((sum 0)) (mapc (lambda (x y) (incf sum (* x y))) '(1 2 3) '(100 200 300)) sum) 1400 ; => (1 x 100) + (2 x 200) + (3 x 30...
The per-directory context is a part of the static configuration file between <Directory> and </Directory> tags. The entire content of dynamic configuration files is within the per-directory context of the folder in which the .htaccess resides. RewriteRule's in per-directory context matc...
The virtual host context is a part of the static configuration file between <VirtualHost> and </VirtualHost> tags. RewriteRule's in virtual host context match against the part of an url after the protocol, hostname and port, and before the query string. When the following rule is used ...
private static final String TAG = "IntentBitmapFetch"; private static final String COLON_SEPARATOR = ":"; private static final String IMAGE = "image"; @Nullable public Bitmap getBitmap(@NonNull Uri bitmapUri, int maxDimen) { InputStream is = context.getConten...
Let's make a hello world web script. Web scripts have a descriptor, a controller, and, optionally, a view. These files must follow a naming convention. This descriptor is named helloworld.get.desc.xml. <webscript> <shortname>Hello World</shortname> <description>Hello ...

Page 518 of 826