I just started to play with the canvas element over the weekend. I started with trying to recreate my logo. You’ll need a modern browser to see this…
Not bad, right? I’ll probably change it so the fill is more flexible or something. I ran into issues with the negative space because clearing it out will clear anything underneath. But if you notice above, the squares are still intact. I was able to achieve this by drawing my logo in a separate canvas element and then drawing the contents in the canvas above. Credits to this post on Stack Overflow for helping me solve this issue. The negative space is done by filling in the outer shape, then changing globalCompositeOperation to ‘destination-out’.
Note: This is from a long time ago and I haven’t really touched this stuff since around the time I wrote this. The information may be out of date. That said, if this does or doesn’t work for you, let me know and I’ll update this with the relevant info.
This is something I ran into a while back. If you’re not an iOS developer, but get tasked with building iOS apps, you may run into this. This particular exit code is fun because xcodebuild doesn’t tell you what the problem is.
Aside from building your app using the Xcode IDE, you also have the command line utility xcodebuild available to you. Assuming the code itself compiles just fine, this tool will tell you, for example, if you’re missing a provisioning profile or something.
When getting code 65, the build would fail with no explanation in the log. Rather, at the end it would say something like <com.apple.tools.product-pkg-utility> "/Users/[me]/Library/MobileDevice/Provisioning Profiles/12345678-ABCD-1234-ABCD-1234567890AB.mobileprovision" -o "/[my_project_build_location]/embedded.mobileprovision"
*** BUILD FAILED ***
If you click on the link, you’ll notice that the image has expired. http://s3.amazonaws.com/twitpic/photos/full/421793754.jpg?AWSAccessKeyId=AKIAJF3XCCKACR3QDMOA&Expires=1318403683&Signature=azYJpu81dNMPFmf8unu2qt8pdiA%3D The “expires” part of the url dictates when the image will expire. The number is the epoch time. Go to Epoch Converter to convert it to normal time. In this link, the picture expired on October 12, 2011 at 12:14:43 AM PDT.
Anyway, I did a small update to that validation project. Apparently, it allowed for xss attacks. Good thing there’s nothing valuable to get from my site (I think). So, for example, if I was to enter the following in the sitemap text box
an alert would come up that says “hi”. I think I solved the problem by using htmlspecialchars. And just to be safe, I used the same solution for displaying the urls in the table. You can try it here. Unfortunately, I don’t have a lot of experience in xss. Is there anything I’m missing or should be more aware of?