The best way to learn and master iOS development is to read the official documentation. It can be boring but you can trust its accuracy and the inforamtion will be presented without opinion.
Read documents in order where indicated.
public void showMessageDialog(String str) { | |
AlertDialog.Builder builder = new AlertDialog.Builder(this); | |
builder.setMessage(str); | |
builder.setCancelable(false); | |
builder.setNeutralButton("Ok", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
dialog.dismiss(); | |
} | |
}); |
* Use Admin page for repo, then | |
$ git remote rm origin | |
$ git remote -v # should be no output | |
$ git remote add origin [email protected]:username/newreponame.git | |
$ git remote -v # to verify new origin | |
$ git status # verify everything looks good | |
Then, rename your local directory containing your repo |
var sort_by = function(field, reverse, primer){ | |
reverse = (reverse) ? -1 : 1; | |
return function(a,b){ | |
a = a[field]; | |
b = b[field]; | |
if (typeof(primer) != 'undefined'){ |
// addMarker() is just a method that creates a marker and adds it to a marker array; it returns | |
// the marker it just added. | |
var bounds = new google.maps.LatLngBounds(); | |
var markerPos = addMarker(point.latitude, point.longitude).getPosition() | |
bounds.extend(markerPos); | |
map.fitBounds(bounds); | |
map.setZoom(14); |
Source: http://stackoverflow.com/questions/118241/calculate-text-width-with-javascript | |
HTML: | |
<div id="Test"> | |
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ | |
</div> | |
CSS: |
An interesting approach I found (didn't invent) for determine the width of some text in an HTML document: | |
1) Wrap your text in a table td element: | |
<table><tr> | |
<td id="test">Some text you want to measure in pixels</td> | |
</tr></table> | |
2) Define CSS rules to reset all default/inherited table styles for the table in (1), so there is no extra padding, margin, border, etc that would affect the pixel calculation. | |
3) Using Javascript, get the DOM element for td element above and get it's offsetWidth property. This will be the width of the text in pixels (unaffected by font characteristics). |
# Add this to httpd.conf | |
AddType application/vnd.android.package-archive .apk | |
# Access as | |
# <a href="downloads/MyApp.apk" type="application/vnd.android.package-archive">Download MyApp</a> |
// Capture Screenshot - Need to verify this still works in iOS 5 | |
UIGraphicsBeginImageContext(self.view.bounds.size); | |
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage *screenshotImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
NSData *data = UIImageJPEGRepresentation(screenshotImage,self.jpegCompressionRate); | |
NSUInteger len = [data length]; |
An alternative to the traditional Google-recommended ViewHolder pattern. This implementation you don't have to create a ViewHolder class per view: | |
https://github.com/BoD/jraf-android-util/blob/master/src/org/jraf/android/util/ui/ViewHolder.java | |
"Example usage, in your adapter: | |
TextView name = ViewHolder.get(convertView, R.id.name); | |
(As you can see you can even skip the cast because of the generics trick.)" |
The best way to learn and master iOS development is to read the official documentation. It can be boring but you can trust its accuracy and the inforamtion will be presented without opinion.
Read documents in order where indicated.