Categories
General

Weird iPad errors: Unknown -35, required disk not found

Had moments of worry this morning trying to sync and install an app on the iPad. iTunes first reported an unknown error -35, then told me that ‘the required disk was not found’.

How to solve “required disk cannot be found”:
He had me do the following:
1. go to home folder in finder
2. open pictures folder
3. right click on iphoto library and click on show package contents
4. Find “ipod photo cache” file and drag to desktop
5. Close finder
6. Reopen itunes and sync ipad
7. The ipod photo cache rebuilds itself
Source: http://goo.gl/7p5p5

Unknown error -35 was solved by plugging in the iPad cable to the actual computer. It was originally connected to the corded Apple keyboard. Apparently not enough juice flowing through the keyboard to support the iPad.

Lessons learned.

Share
Categories
Computing General ios iphone

SQLite ORDER BY does not work on integers: time for an index

My current project uses SQLite as it is really the only game in town on iOS. SQLite indexes provide an incredible performance boosts when you are dealing with large datasets. They apparently play a crucial role when it comes to something of a foregone conclusion in other databases – sorting.

What stumped my colleagues and I was that we had a database table where one of the columns had an INT (and also tested using an INTEGER) type (and yes – they are all NUMERIC to SQLite) – and ORDER BY kept returning incorrectly sorted results. According to this post on Stack Overflow, when you have a SQLite query that uses the ORDER BY, it may rely on temporary tables. Those in turn 'confuse' the database when it runs the query to sort your table.

The answer – add an index. Something as simple as

CREATE INDEX index_name ON table_name
(
   NAME_OF_COLUMN_TO_SORT ASC
);

Once you add it – you are, well – sorted out.

Share
Categories
General

WordPress Post Bookmarklet: a fix for ‘Press This’

I love WordPress and there is no reason not to. I also love bookmarklets. A bookmarklet is a piece of JavaScript code that execute whenever you click it in your browser. Bookmarklets normally live in your browser's bookmark toolbar and form a way of further customizing its functionality without an over-the-top amount of code.

Bookmarklets are great for sharing and curation. Facebook, Tumblr and others provide them, essentially popping open a new browser window on their site, giving you the ability to comment and then post a link to the currently viewed content. WordPress has a tool for that built in, 'Press This'.  Only problem is that it often times breaks and leads to a 404 error page. It appears the issue stems from the encoding of the protocol portion of the URL (e.g. http://, https:// etc.). It appears that a truly minor tweak can fix this issue. All you need to do is modify the JavaScript code in the 'Press This' bookmarklet generated by your WordPress blog.

For example, the original code is:

javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://<YOUR BLOG URL>/wp-admin/press-this.php',l=d.location,e=encodeURIComponent,u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';a=function(){if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570'))l.href=u;};if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();void(0)

with

javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='<YOUR BLOG URL>/wp-admin/press-this.php',l=d.location,e=encodeURIComponent,u=f+'?u='+e(document.location.host + document.location.pathname)+'&t='+e(d.title)+'&s='+e(s)+'&v=4';a=function(){if(!w.open(u,'t','toolbar=0,resizable=1,scrollbars=1,status=1,width=720,height=570'))l.href=u;};if (/Firefox/.test(navigator.userAgent)) setTimeout(a, 0); else a();void(0)

Try it out. Tell me if it works.

Share
Share