- Forget about memory management methods. There’s no need to write more retain, retainCount, release, autorelease, dealloc.
- Use @autoreleasepool block instead of NSAutoReleasePool.
- Cast with __bridge_transfer or __bridge_retained instead of casting between id and void.
- Use weak or strong reference. Think about if the object is part of:
- controller: Use strong references
- view: Use __weak references
- Don’t use [super init] instead use self = [super init]
Over the last months, I have been working in some WordPress projects which have being a great opportunity to dive a little bit more into this topic. One of the first pitfalls when I was learning the basics of wordpress is how everything works together. I was struggling myself with the data and the bunch of files that you need to work with.
All the understanding of this relies on: WordPress lives on a web server ( aka is hosted somewhere). So, your visitors and you send a request to WP every time you access the site. There are some things that makes WordPress do the magic:
- Database: When you create/save/store something means that you are manipulating the database. It’s important to note that all for all the info that you see there’s a table in the DB, e.g: the table wp_comments saves all the comments that your visitors write. Don’t worry too much about understanding everything about the database. However if you are writing a plugin you might like to read this link, which gives you a detail description about it.
- Images and CSS: Like you’ll normally do, you can add css and images to your site.
- PHP files: All your logic code will be write in PHP, here you will find all the WP functions you can use in your code.
Note: WP uses ‘themes’ concept, these are a bunch of php files, css and images that specify how your page will look like. Even tough you can start from scratch creating a theme, I’d highly recommend to use a base theme. If you are curious about the what’s about all those files you can take a look at theme dev in WP.
Now, let’s look the image below to clarify our ideas:
A point to note here it’s that this process is asynchronous, that means that your visitors and you can visit/manage the site not necessarily at the same time.
Hope this helps to make you understand a little bit more about WordPress.
For several days I’ve been working on the exploration of GIS (Geographical Information Systems) that runs on GAE (Google App Engine) using Java. In the process, I found an application called giscloud that helped me understand the basics of how to run an application of its kind in the cloud using JTS (Java Topology Suite).
Note: while Google makes it easy to import existing libraries and frameworks into your application, not all are compatible with this platform, so have created a repository of reference.
JTS is an API that gives you a spatial object model and algorithms geometric 2D space, which seeks to facilitate the creation of geometric objects and relations between them and external to the model points (intersections, areas, center, among other things) and in this tutorial I detail the steps necessary to run giscloud :
- Before you start you should download the code from this link, using a subversion client:
In this tut, I’ll be using…
- Eclipse 3.5 aka Galileo
- Google App Engine SDK 1.3.1
- GWT SDK 2.0.2
- The first thing you want to do is import the project into your eclipse instance.
- After importing the project you will notice a red icon appears in the project folder, this happens because the Java compiler could not resolve all dependencies and libraries needed to run this project. To see what’s wrong, you can enter to see libraries found within the project build path (Right click>> Properties>> Java Build Path> Libraries) and you will notice that the library ‘gwt-maps.jar is not there.
- To solve the problem, you must delete the existing reference in the build path and recreate it by downloading the gwt-maps library from Google Code site. To re-create the file reference you must add the just added library to the WEB-INF/lib source and build the path to the file.
- If all went OK, you should be able to see an icon with the name ‘gwt-maps’ folder above the war.
- Giscloud uses a modified version of JTS, which allows the serialization of objects STRtree type so that they can be added to the cache (this feature is not available in the latest version published by vividsolutions). What you should do to solve the reference loss is to remove the reference ‘java-topology-suite’ to the project(Right click>> Properties>> Java Build Path> Projects) and search the file path WEB-INF/lib ‘JTS-1.11-serializable-indexes.jar ‘, then build the library path (Right click>> Build Path>> Add to Buid Path).
- Finally, you run the program as ‘web application’, copy the link provided by the Development mode in your favorite browser and see something like this:
I hope this helps to start with learning geographic information systems using JTS App Engine.
Transition your beautiful design mockup to look completely the same to your HTML and CSS, it can be a real nightmare sometimes. Making a pixel perfect layout, takes time and patience.
There’s a great tool I found for this, it’s called Pixel Measure. This is a photoshop plugin that measures your pixels in seconds, installation requires 2 minutes and you are ready to rock on your html layouts.
To install the plugin, you just drop the file on your photoshop directory to the scripts folder, then you restart the program. Make sure your script installed correctly on the menu File under Scripts.
I highly recommend to add a keyboard shortcut for this script. You can set this under Edit and then Keyboard Shortcuts menu. Now, the only thing you need to do is to click on your marquee tool and then press the shortcut that you configured previously.
Thanks to Nikola to make this script possible. Hope it helps for your future work.
A few months ago, I was thinking in a way to keep the things that I learned on the road as a programmer girl. So, I decided to start a blog to keep a record and share the dev and tech experiences I pass through.
Hope this blog helps grow your inner geek.