tag:blogger.com,1999:blog-13595268859052828902023-12-13T05:15:56.460+11:00Xmemorywhere my memory can be eXtendedTom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.comBlogger73125tag:blogger.com,1999:blog-1359526885905282890.post-11174561734661422762017-01-18T21:05:00.000+11:002017-01-18T21:05:59.626+11:00Wireshark - The capture could not be initiated (You don't have permissiont o capture on that device).<br />
It seems Wireshark installer fails to set up permissions.<br />
<br />
To fix it, run this manually:-<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: "courier new" , "courier" , monospace;">chgrp access_bpf /dev/bpf*<br />chmod g+rw /dev/bpf*</span></blockquote>
<br />
Make sure the user is in the "access_bpf" group.<br />
<br />
<b><span style="font-size: xx-small;">Refs</span></b><br />
<span style="font-size: xx-small;"><a href="https://josephhall.org/nqb2/index.php/wrshrkinstll">https://josephhall.org/nqb2/index.php/wrshrkinstll</a></span><br />
<span style="font-size: xx-small;"><a href="http://apple.stackexchange.com/questions/138694/what-is-access-bpf-group">http://apple.stackexchange.com/questions/138694/what-is-access-bpf-group</a></span><br />
<div>
<br /></div>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-34213813949566895162016-02-01T23:41:00.001+11:002016-02-01T23:43:03.005+11:00Have fun with cross platform mobile developmentA short presentation about a sample cross platform mobile project called TumChatter for both Android and iOS.<br />
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="150" src="https://www.youtube.com/embed/BaRPFXh8xlU" width="200"></iframe>
<br />
<br />
<br />
You can find the project on github at the link below:-<br />
<a href="https://github.com/have-fun/TumChatter">https://github.com/have-fun/TumChatter</a><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Programming Language:</b> Kotlin</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Frameworks:</b> Java, RoboVM</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Dependency Injection:</b> Dagger 2</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Json:</b> Gson</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>REST Client:</b> Retrofit</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Reactive Libraries:</b> RxKotlin, RxJava</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Unit Testing:</b> Spek (Specification Framework), AssertJ, Mockito</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Embedded Server:</b> TumWeb, Nanohttpd</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Android UI Binding:</b> KotterKnife, ButterKnife</span><br />
<div>
<br />
<br /></div>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-38447394376907998112014-04-01T13:22:00.000+11:002014-04-03T17:13:55.164+11:00Create an array<br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #d0d0d0;"> NSArray</span> <span style="color: #d0d0d0;">*array</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">[NSArray</span> <span style="color: #d0d0d0;">arrayWithObjects:</span>@"<span style="color: #d0d0d0;">One</span><span style="color: #ed9d13;">", [NSNumber numberWithInt:1], nil];</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
Or use literal array expression:-<br />
<br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #d0d0d0;"> NSArray</span> <span style="color: #d0d0d0;">*array</span> <span style="color: #d0d0d0;">=</span>@<span style="color: #d0d0d0;">[</span> <span style="color: #ed9d13;">@"One"</span><span style="color: #d0d0d0;">,</span> <span style="color: #d0d0d0;">[NSNumber</span> <span style="color: #d0d0d0;">numberWithInt:</span><span style="color: #3677a9;">1</span><span style="color: #d0d0d0;">]</span> <span style="color: #d0d0d0;">];</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
Use NSNumber to add boolean or integer values to an array, or prefix a boolean value with ‘@':-<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #d0d0d0;"> NSArray</span> <span style="color: #d0d0d0;">*array</span> <span style="color: #d0d0d0;">=</span> @<span style="color: #d0d0d0;">[</span> <span style="color: #d0d0d0;">[NSNumber</span> <span style="color: #d0d0d0;">numberWithInt:</span><span style="color: #3677a9;">1</span><span style="color: #d0d0d0;">],</span> <span style="color: #d0d0d0;">[NSNumber</span> <span style="color: #d0d0d0;">numberWithBool:</span><span style="color: #24909d;">YES</span><span style="color: #d0d0d0;">],</span> @<span style="color: #24909d;">NO</span> <span style="color: #d0d0d0;">];</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
Otherwise we will get an error like this:-<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> Collection element of type ‘NSInteger’ (aka ‘int’) is not an Objective-C object</span><br />
<br />
Use NSNull to add a nil equivalent value to an array:-<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #d0d0d0;">NSArray</span> <span style="color: #d0d0d0;">*array</span> <span style="color: #d0d0d0;">=</span> @<span style="color: #d0d0d0;">[</span> <span style="color: #ed9d13;">@"a"</span><span style="color: #d0d0d0;">,</span> <span style="color: #d0d0d0;">[NSNull</span> <span style="color: #d0d0d0;">null],</span> <span style="color: #ed9d13;">@"b"</span> <span style="color: #d0d0d0;">];</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<span style="font-size: xx-small;"><b>Refs</b></span><br />
<span style="font-size: xx-small;"><a href="http://stackoverflow.com/questions/1602572/how-to-create-an-array-of-strings-in-objective-c-for-iphone">http://stackoverflow.com/questions/1602572/how-to-create-an-array-of-strings-in-objective-c-for-iphone</a></span><br />
<span style="font-size: xx-small;"><a href="http://clang.llvm.org/docs/ObjectiveCLiterals.html">http://clang.llvm.org/docs/ObjectiveCLiterals.html</a></span><br />
<span style="font-size: xx-small;"><a href="http://stackoverflow.com/questions/1309535/why-does-nsarray-arraywithobjects-require-a-terminating-nil">http://stackoverflow.com/questions/1309535/why-does-nsarray-arraywithobjects-require-a-terminating-nil</a></span><br />
<a href="http://stackoverflow.com/questions/2057910/how-to-add-nil-to-nsmutablearray"><span style="font-size: xx-small;">http://stackoverflow.com/questions/2057910/how-to-add-nil-to-nsmutablearray</span></a>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-23644116931932684682014-03-29T18:10:00.001+11:002014-04-07T17:31:04.387+10:00Managed Object ID<br />
<ul>
<li>Get the string URL representation from a ManagedObjectID</li>
</ul>
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #d0d0d0;">NSURL</span> <span style="color: #d0d0d0;">*urlID</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">[objectID</span> <span style="color: #d0d0d0;">URIRepresentation];</span>
<span style="color: #d0d0d0;">NSString</span> <span style="color: #d0d0d0;">*strUrlID</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">[urlID</span> <span style="color: #d0d0d0;">absoluteString];</span>
</pre>
</td></tr>
</tbody></table>
</div>
<ul>
<br />
<li>Get the ManagedObjectID from a URL string</li>
</ul>
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #d0d0d0;">NSURL</span> <span style="color: #d0d0d0;">*urlID</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">[[NSURL</span> <span style="color: #d0d0d0;">alloc]</span> <span style="color: #d0d0d0;">initWithString:strUrlID];</span>
<span style="color: #d0d0d0;">NSManagedObjectID</span> <span style="color: #d0d0d0;">*objectID</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">[[managedObjectContext</span> <span style="color: #d0d0d0;">persistentStoreCoordinator]</span> <span style="color: #d0d0d0;">managedObjectIDForURIRepresentation:urlID];</span></pre>
</td></tr>
</tbody></table>
</div>
<ul>
<br />
<li>Get the ManagedObject by a ManagedObjectID</li>
</ul>
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #d0d0d0;">NSError</span> <span style="color: #d0d0d0;">*error</span> <span style="color: #d0d0d0;">=</span> <span style="color: #24909d;">nil</span><span style="color: #d0d0d0;">;</span>
<span style="color: #d0d0d0;">NSManagedObject</span> <span style="color: #d0d0d0;">*managedObject</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">[moc</span> <span style="color: #d0d0d0;">existingObjectWithID:objectID</span> <span style="color: #d0d0d0;">error:&error];</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<ul>
<li>Check if a ManagedObject is new</li>
</ul>
<!-- HTML generated using hilite.me -->
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #6ab825; font-weight: bold;">BOOL</span> <span style="color: #d0d0d0;">isNew</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">managedObject.objectID.isTemporaryID;</span></pre>
</td></tr>
</tbody></table>
</div>
<br />
<ul>
<li>Get the permanent object IDs for the objects in a child context.</li>
</ul>
<!-- HTML generated using hilite.me -->
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6
7
8</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #d0d0d0;">NSError</span> <span style="color: #d0d0d0;">*error</span> <span style="color: #d0d0d0;">=</span> <span style="color: #24909d;">nil</span><span style="color: #d0d0d0;">;</span>
<span style="color: #d0d0d0;">[childManagedObjectContext</span> <span style="color: #d0d0d0;">obtainPermanentIDsForObjects:childManagedObjectContext.insertedObjects.allObjects</span> <span style="color: #d0d0d0;">error:&error]);</span>
<span style="color: #999999; font-style: italic;">// . . . Check for an error . . .</span>
<span style="color: #d0d0d0;">[childManagedObjectContext</span> <span style="color: #d0d0d0;">save:&error];</span>
<span style="color: #999999; font-style: italic;">// . . . Check for an error . . .</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<span style="font-size: xx-small;"><b>Refs</b></span><br />
<span style="font-size: xx-small;"><a href="http://stackoverflow.com/questions/3519334/how-to-uniquely-identify-nsmangedobject-with-string">http://stackoverflow.com/questions/3519334/how-to-uniquely-identify-nsmangedobject-with-string</a></span><br />
<span style="font-size: xx-small;"><a href="http://stackoverflow.com/questions/10811280/how-to-get-the-objectid-from-url">http://stackoverflow.com/questions/10811280/how-to-get-the-objectid-from-url</a></span><br />
<span style="font-size: xx-small;"><a href="http://stackoverflow.com/questions/3013288/how-to-use-managedobjectid-the-right-way">http://stackoverflow.com/questions/3013288/how-to-use-managedobjectid-the-right-way</a></span><br />
<span style="font-size: xx-small;"><a href="http://iphonedevelopment.blogspot.com.au/2009/07/core-data-determining-if-managed-object.html">http://iphonedevelopment.blogspot.com.au/2009/07/core-data-determining-if-managed-object.html</a></span><br />
<a href="http://stackoverflow.com/questions/11990279/core-data-do-child-contexts-ever-get-permanent-objectids-for-newly-inserted-obj/11996957#11996957"><span style="font-size: xx-small;">http://stackoverflow.com/questions/11990279/core-data-do-child-contexts-ever-get-permanent-objectids-for-newly-inserted-obj/11996957#11996957</span></a>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-4203718574812337772014-03-27T17:49:00.001+11:002014-03-27T17:49:41.251+11:00Compare NSDate instances<!-- HTML generated using hilite.me --><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #d0d0d0;">NSComparisonResult</span> <span style="color: #d0d0d0;">result</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">[date1</span> <span style="color: #d0d0d0;">compare:date2];</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(result</span> <span style="color: #d0d0d0;">==</span> <span style="color: #d0d0d0;">NSOrderedAscending)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">// date1 < date2</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">else</span> <span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(result</span> <span style="color: #d0d0d0;">==</span> <span style="color: #d0d0d0;">NSOrderedDescending)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">// date1 > date2</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">else</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">// date1 == date2</span>
<span style="color: #d0d0d0;">}</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
or<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">([date1</span> <span style="color: #d0d0d0;">timeIntervalSinceReferenceDate]</span> <span style="color: #d0d0d0;"><</span> <span style="color: #d0d0d0;">[date2</span> <span style="color: #d0d0d0;">timeIntervalSinceReferenceDate])</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">// date1 < date2</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">else</span> <span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">([date1</span> <span style="color: #d0d0d0;">timeIntervalSinceReferenceDate]</span> <span style="color: #d0d0d0;">></span> <span style="color: #d0d0d0;">[date2</span> <span style="color: #d0d0d0;">timeIntervalSinceReferenceDate])</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">// date1 > date2</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">else</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">// date1 == date2</span>
<span style="color: #d0d0d0;">}</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<span style="font-size: xx-small;"><b>Refs
</b></span><br />
<a href="http://stackoverflow.com/questions/5965044/how-to-compare-two-nsdates-which-is-more-recent"><span style="font-size: xx-small;">http://stackoverflow.com/questions/5965044/how-to-compare-two-nsdates-which-is-more-recent</span></a>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-15226125621925280522014-03-27T16:59:00.001+11:002014-03-27T16:59:12.912+11:00lldb Error - no known method '-class'; cast the message send to the method's return type<span style="font-family: Courier New, Courier, monospace;">p [[navigationController topViewController] class] </span><br />
<br />
returns<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">error: no known method '-class'; cast the message send to the method's return type </span><br />
<br />
To fix it, cast it first:-
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">p [(NSObject *) [navigationController topViewController] class]</span><br />
<br />
<span style="font-size: xx-small;"><b>Refs</b></span><br />
<span style="font-size: xx-small;"><a href="http://stackoverflow.com/questions/14007942/lldb-error-property-not-found-on-object-of-type">http://stackoverflow.com/questions/14007942/lldb-error-property-not-found-on-object-of-type</a></span>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-25876926782784753402013-11-25T17:16:00.000+11:002013-11-25T17:16:15.144+11:00Start/Stop PostgreSQL on MacStart PostgreSQL:-<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo -u postgres /Library/PostgreSQL/9.3/bin/pg_ctl -D /Library/PostgreSQL/9.3/data start</span></blockquote>
Stop PostgreSQL:-<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo -u postgres /Library/PostgreSQL/9.3/bin/pg_ctl -D /Library/PostgreSQL/9.3/data stop</span></blockquote>
Stop PostgreSQL from auto-starting on reboot:-<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist</span>
</blockquote>
Make PostgreSQL auto-start on reboot:-<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist</span>
</blockquote>
<b><span style="font-size: xx-small;">Refs</span></b><br />
<span style="font-size: xx-small;"><a href="http://www.xtuple.org/faq/xtuple-faq/postgresql/how-do-i-stop-postgresql-service-mac">http://www.xtuple.org/faq/xtuple-faq/postgresql/how-do-i-stop-postgresql-service-mac</a> </span><br />
<a href="https://gist.github.com/abhishekdev/1960888"><span style="font-size: xx-small;">https://gist.github.com/abhishekdev/1960888</span></a>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-70443602700420896292013-08-17T01:16:00.001+10:002013-08-17T01:18:26.647+10:00Run Tomboy with Mono 3.2 on MacCompiling it from scratch based on <a href="http://xmemory.tompium.com/2012/06/running-tomboy-note-taking-app-on-mac.html">http://xmemory.tompium.com/2012/06/running-tomboy-note-taking-app-on-mac.html</a> doesn't work anymore. Here are the additional instructions:-<br />
<ul>
<li>After getting the latest version of Tomboy (1.15.3), replace "<span style="font-family: Courier New, Courier, monospace;">flush(true)</span>" with "<span style="font-family: Courier New, Courier, monospace;">flush()</span>" in <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Note.cs</span> to fix a compile error. Not sure why the compiler complained about this line. Anyway, using just "<span style="font-family: Courier New, Courier, monospace;">flush()</span>" fixes the problem but it may not write everything to disk straight away.</li>
<li>After building Tomboy, running it caused an exception:- </li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Missing method System.Reflection.Assembly::op_Equality(Assembly,Assembly)</span></blockquote>
<blockquote class="tr_bq">
To fix it, modify a script file called <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Tomboy</span> in <span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Tomboy.app -> Contents/MacOS/Tomboy</span> by changing the last line to</blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> exec -a "Tomboy" "$MONO" <b>--runtime=v4.0</b> --debug $ASSEMBLY $@</span></blockquote>
<span style="font-size: xx-small;"><b> Refs</b><br /><a href="https://bugs.launchpad.net/ubuntu/+source/mono/+bug/882501" target="_blank"> https://bugs.launchpad.net/ubuntu/+source/mono/+bug/882501</a> </span><br />
<a href="http://xmemory.tompium.com/2012/06/running-tomboy-note-taking-app-on-mac.html"><span style="font-size: xx-small;">http://xmemory.tompium.com/2012/06/running-tomboy-note-taking-app-on-mac.html</span></a>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com3tag:blogger.com,1999:blog-1359526885905282890.post-44270910643893902132013-08-13T10:45:00.001+10:002013-08-13T10:46:32.933+10:00Offline Maps on New Google Maps for iOS (v2) and Android (v7)<span style="font-family: Arial; font-size: 13px;">To download an area on the map, type </span><br />
<blockquote class="tr_bq">
<span style="font-size: 13px;"><span style="font-family: Courier New, Courier, monospace;">ok maps</span></span></blockquote>
<span style="font-family: Arial; font-size: 13px;">in the search box.</span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-family: Arial; font-size: 13px;">To clear the cached map, go to</span><br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"><span style="font-size: 13px;">Settings -> About, terms & privacy -> Terms & privacy</span><span style="font-size: 13px;"> </span></span></blockquote>
<span style="font-family: Arial; font-size: 13px;"></span><span style="font-family: Arial; font-size: 13px;">and select</span><br />
<blockquote class="tr_bq">
<span style="font-size: 13px;"><span style="font-family: Courier New, Courier, monospace;">Clear application data</span></span></blockquote>
<span style="font-size: xx-small;"><b>Refs</b><br /><a href="http://www.idownloadblog.com/2013/07/17/offline-maps-in-google-maps-2/">http://www.idownloadblog.com/2013/07/17/offline-maps-in-google-maps-2/</a></span>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-32036644700910491302013-08-11T10:42:00.000+10:002013-08-13T10:47:20.518+10:00System.Object is not defined or imported when building PCL project in Xamarin Studio 4.0.12<span style="font-family: Arial; font-size: 13px;">There're also a bunch of similar errors:-</span><br />
<br />
<span style="font-family: Arial; font-size: 13px;"></span>
<span style="font-family: Courier New, Courier, monospace;"><span style="font-size: 13px;">: error CS0518: The predefined type `System.Object' is not defined or imported</span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="font-size: 13px;">: error CS0518: The predefined type `System.ValueType' is not defined or imported</span><br />
<span style="font-size: 13px;">: error CS0518: The predefined type `System.Attribute' is not defined or imported</span><br />
<span style="font-size: 13px;">: error CS0518: The predefined type `System.Int32' is not defined or imported</span><br />
<span style="font-size: 13px;">: error CS0518: The predefined type `System.UInt32' is not defined or imported</span><br />
<span style="font-size: 13px;">. . .</span></span>
<span style="font-family: Arial; font-size: 13px;"></span><br />
<br />
<span style="font-family: Arial; font-size: 13px;">To fix this, go to </span><span style="font-size: 13px;"><span style="font-family: Courier New, Courier, monospace;">References -> Edit References -> .Net Assembly</span></span><span style="font-family: Arial; font-size: 13px;"> then add </span><span style="font-size: 13px;"><span style="font-family: Courier New, Courier, monospace;">mscorlib.dll</span></span><span style="font-family: Arial; font-size: 13px;"> from </span><span style="font-size: 13px;"><span style="font-family: Courier New, Courier, monospace;">/Library/Frameworks/Mono.framework/Libraries/mono/4.5</span></span><br />
<span style="font-family: Arial; font-size: 13px;"></span><br />
<span style="font-size: xx-small;"><b>Refs</b><br /><a href="https://bugzilla.xamarin.com/show_bug.cgi?id=12845">https://bugzilla.xamarin.com/show_bug.cgi?id=12845</a></span>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-45430324236411261282013-06-28T12:26:00.000+10:002013-06-28T13:19:44.334+10:00Enable Xdebug in MAMP<div class="p1">
Uncomment the <span class="s1"><span style="font-family: Courier New, Courier, monospace;">zend_extension</span></span> line and modify the <span class="s1"><span style="font-family: Courier New, Courier, monospace;">/Applications/MAMP/bin/php/php5.x/conf/php.ini</span></span> file to look like this:-</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">[xdebug]<br />zend_extension="/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"<br />xdebug.remote_enable=1<br />xdebug.remote_host=localhost</span> </blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">; On my machine, the default port 9000 has already been taken by something else.<br />xdebug.remote_port=9099</span> </blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">; Recommended when using Symfony<br />xdebug.max_nesting_level=250</span></blockquote>
<div class="p1">
<span style="font-size: xx-small;">Then restart the servers in MAMP.</span><br />
<b><span style="font-size: xx-small;"><br /></span></b>
<b><span style="font-size: xx-small;">Refs</span></b></div>
<div class="p5">
<span class="s3"><span style="font-size: xx-small;"><a href="http://danpolant.com/want-to-run-xdebug-mamp-is-the-easiest-way/">http://danpolant.com/want-to-run-xdebug-mamp-is-the-easiest-way/</a></span></span></div>
<div class="p2">
<span style="font-size: xx-small;"><a href="http://xdebug.org/docs/all_settings">http://xdebug.org/docs/all_settings</a></span></div>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com1tag:blogger.com,1999:blog-1359526885905282890.post-41841899702828780622013-06-28T11:14:00.000+10:002013-06-28T12:31:55.875+10:00Show print history on Mac<div class="p1">
When I opened the web based CUPS admin interface to show print history:-</div>
<blockquote class="tr_bq">
<a href="http://localhost:631/jobs?which_jobs=completed"><span style="font-family: Courier New, Courier, monospace;">http://localhost:631/jobs?which_jobs=completed</span></a></blockquote>
<div class="p2">
I got the "Internal Server Error" message.</div>
<div class="p2">
<br /></div>
<div class="p1">
To fix it, I used the following commands</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo cupsctl --debug-logging<br />sudo cupsctl --no-debug-logging</span></blockquote>
<div class="p2">
<b><span style="font-size: xx-small;">Refs</span></b></div>
<div class="p5">
<span class="s1"><span style="font-size: xx-small;"><a href="http://osxdaily.com/2011/01/20/show-print-history-mac/">http://osxdaily.com/2011/01/20/show-print-history-mac/</a></span></span></div>
<div class="p5">
<a href="https://discussions.apple.com/thread/3510277?start=0&tstart=0"><span style="font-size: xx-small;">https://discussions.apple.com/thread/3510277?start=0&tstart=0</span></a></div>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-9838040261448556522013-06-26T14:06:00.000+10:002013-06-26T14:13:10.040+10:00Custom php.ini on shared hosting<ul class="ul1">
<li class="li1">Find the default php.ini path. Mine is <span style="font-family: Courier New, Courier, monospace;">/usr/local/lib/php.ini</span></li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"><?php phpinfo() ?></span></blockquote>
<ul class="ul1">
<li class="li1">Copy the default php.ini to the user's home folder and customise it.</li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"><?php copy("/usr/local/lib/php.ini", "/home/username/php.ini") ?></span></blockquote>
<ul class="ul1">
<li class="li1">Create a .htaccess file in the user's home folder with the following content.</li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">SetEnv PHPRC /home/username/php.ini<br /># The following lines are important if the php.ini file is put in the document root.<br /><Files php.ini><br />order allow,deny<br />deny from all<br /></Files></span></blockquote>
<div class="p1">
<b><span style="font-size: xx-small;">Refs</span></b></div>
<div class="p5">
<span class="s1"><a href="http://php.net/manual/en/function.copy.php"><span style="font-size: xx-small;">http://php.net/manual/en/function.copy.php</span></a></span></div>
<div class="p5">
<span class="s1"><span style="font-size: xx-small;"><a href="http://jesin.tk/using-custom-php-ini-files-on-shared-hosting/">http://jesin.tk/using-custom-php-ini-files-on-shared-hosting/</a></span></span></div>
<div class="p5">
<a href="https://drupal.org/node/290592"><span style="font-size: xx-small;">https://drupal.org/node/290592</span></a></div>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-84811700077139570982013-06-24T01:03:00.000+10:002013-06-26T14:08:42.602+10:00List processes and ports on Mac<ul>
<li><span style="font-family: inherit;">Show listening ports</span></li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">lsof -i -nP | grep LISTEN</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: inherit;">or with all processes</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">sudo lsof -i -nP | grep LISTEN</span></blockquote>
<ul>
<li><span style="font-family: inherit;">Show ports with any state, e.g. ESTABLISHED, CLOSE_WAIT, CLOSED, LISTEN</span></li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo lsof -i -nP | grep TCP</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: inherit;">or</span></blockquote>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo lsof -i -nP | grep UDP</span></blockquote>
<b>Switches</b><br />
<span style="font-family: Courier New, Courier, monospace;">-i select IPv[46] files</span><br />
<span style="font-family: Courier New, Courier, monospace;">-n no host names</span><br />
<span style="font-family: Courier New, Courier, monospace;">-P no port names</span><br />
<br />
<span style="font-family: inherit;"><span style="font-size: xx-small;"><b>Refs</b></span></span>
<br />
<span style="font-family: inherit; font-size: xx-small;"><a href="http://hints.macworld.com/article.php?story=20070425165628961">http://hints.macworld.com/article.php?story=20070425165628961</a></span><ul>
</ul>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-88758727379509103752013-06-14T18:05:00.000+10:002013-06-14T18:10:26.839+10:00The system is running in low-graphics mode after upgrading the VirtualBox Guest additions to 4.2.12<div class="p1">
I tried switching to use gdm instead of lightdm to see whether it could help but it didn't so I rolled back to v4.2.10 while waiting for v4.2.13 which was reported that this problem has been fixed.</div>
<ul class="ul1">
<li class="li1">Rebooted the machine in recovery mode in the Grub menu by, while booting:- </li>
<ul class="ul2">
<li class="li1">Pressing ESC, or</li>
<li class="li1">Holding down the Shift key (this works better for me).</li>
</ul>
<li class="li1">Uninstalled the VirtualBox Guest additions</li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">cd /opt/VBoxGuestAdditions-4.2.12<br />./uninstall.sh<br />reboot<span class="s1"> </span></span></blockquote>
<ul class="ul1">
<li class="li1">After reboot, the screen was black. Here is what I did to fix this,</li>
<ul class="ul2">
<li class="li1">Pressed Cmd + F1 (or Alt + F1, don't know why Ctrl isn't needed on my machine) to switch to tty1.</li>
<li class="li1">Made LigthDM the default display manager</li>
</ul>
</ul>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo dpkg-reconfigure lightdm<br />sudo reboot</span> </blockquote>
<div>
<div>
<div class="p1">
But it didn't work. It turned out that I also had to modify <span class="s2">/etc/X11/default-display-manager</span> to have the full path to lightdm like this.</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">/usr/sbin/lightdm</span></blockquote>
<div class="p1">
Then rebooted,</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo reboot</span></blockquote>
After that, I could continue installing the VirtualBox Guest additions v4.2.10 and now everything is back to normal.<br />
<br />
<div class="p1">
<b><span style="font-size: xx-small;">Refs</span></b></div>
<div class="p4">
<span class="s3"><a href="https://www.virtualbox.org/ticket/11709"><span style="font-size: xx-small;">https://www.virtualbox.org/ticket/11709</span></a></span></div>
<div class="p4">
<span class="s3"><a href="http://ubuntuforums.org/showthread.php?t=1186984"><span style="font-size: xx-small;">http://ubuntuforums.org/showthread.php?t=1186984</span></a></span></div>
<div class="p4">
<span class="s3"><a href="http://askubuntu.com/questions/172319/how-can-i-start-in-safe-mode"><span style="font-size: xx-small;">http://askubuntu.com/questions/172319/how-can-i-start-in-safe-mode</span></a></span></div>
<div class="p4">
<span class="s3"><a href="https://wiki.ubuntu.com/LightDM"><span style="font-size: xx-small;">https://wiki.ubuntu.com/LightDM</span></a></span></div>
<div class="p4">
<span class="s3"><span style="font-size: xx-small;"><a href="http://askubuntu.com/questions/74551/lightdm-not-starting-on-boot">http://askubuntu.com/questions/74551/lightdm-not-starting-on-boot</a></span></span></div>
</div>
</div>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-73715984532370984102013-06-01T12:43:00.001+10:002013-06-26T14:10:23.254+10:00Install httrack using brew on Mac<div class="p1">
Typed</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">brew install httrack</span></blockquote>
<div class="p1">
Then I got:-</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;"><span class="s2">==> Downloading <a href="http://download.httrack.com/httrack-3.46.1.tar.gz"><span class="s3">http://download.httrack.com/httrack-3.46.1.tar.gz</span></a></span>Already downloaded: /Library/Caches/Homebrew/httrack-3.46.1.tar.gz<br />Error: SHA1 mismatch<br />Expected: be6328d2ff3cbabd21426b7acc54edcf1ebb76e0<br />Actual: 237fca7a9c5c63b53c5d0134dac6e5714422384c<br />Archive: /Library/Caches/Homebrew/httrack-3.46.1.tar.gz<br />(To retry an incomplete download, remove the file above.)</span></blockquote>
<div class="p1">
So I did:-</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">brew update</span></blockquote>
<div class="p1">
Then I got:-</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">error: The following untracked working tree files would be overwritten by merge:</span><span style="font-family: Courier New, Courier, monospace;"> Library/Formula/libmusicbrainz.rb</span><span style="font-family: Courier New, Courier, monospace;">Please move or remove them before you can merge.</span><span style="font-family: Courier New, Courier, monospace;">Aborting</span><span style="font-family: Courier New, Courier, monospace;">Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master</span></blockquote>
<div class="p1">
To fix it, I did:-</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">cd /usr/local<br />git fetch origin<br />git reset --hard origin/master</span></blockquote>
<div class="p1">
After that, I could run "brew update" and "brew install httrack" again with no problem. </div>
<div class="p3">
<br /></div>
<div class="p1">
<b><span style="font-size: xx-small;">Refs</span></b></div>
<a href="http://forum.httrack.com/readmsg/25812/25794/index.html"><span class="s3"><span style="font-size: xx-small;">http://forum.httrack.com/readmsg/25812/25794/index.html</span></span></a><br /><a href="http://apple.stackexchange.com/questions/36862/install-homebrew-package-and-ignore-md5-hash"><span class="s3"><span style="font-size: xx-small;">http://apple.stackexchange.com/questions/36862/install-homebrew-package-and-ignore-md5-hash</span></span></a><br /><a href="http://stackoverflow.com/questions/10762859/brew-update-the-following-untracked-working-tree-files-would-be-overwritten-by"><span class="s3"><span style="font-size: xx-small;">http://stackoverflow.com/questions/10762859/brew-update-the-following-untracked-working-tree-files-would-be-overwritten-by</span></span></a><ul class="ul1">
</ul>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com1tag:blogger.com,1999:blog-1359526885905282890.post-57334050306228417152013-05-27T20:08:00.000+10:002013-06-26T14:10:47.674+10:00Reduce memory usage in Chrome by suspending tabs<div class="p1">
Google Chrome seems to use lots of memory especially when there are lots of tabs open at once. It quite often slows down my machine significantly to the point that I have to restart the browser (with all tabs still open after the restart) and then it gradually slows down again. I'm glad I came across <a href="https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg/details?utm_source=chrome-ntp-icon"><span class="s1">The Great Suspender</span></a>. This extension allows me to suspend any tab manually, or let it suspend idle tabs for me automatically.</div>
<div class="p2">
<br /></div>
<div class="p1">
<b><span style="font-size: xx-small;">Refs</span></b></div>
<a href="http://lifehacker.com/5982490/the-great-suspender-suspends-memory+hungry-chrome-tabs-you-havent-used-lately"><span class="s2"><span style="font-size: xx-small;">http://lifehacker.com/5982490/the-great-suspender-suspends-memory+hungry-chrome-tabs-you-havent-used-lately</span></span></a><br /><a href="https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg?utm_source=chrome-ntp-icon"><span class="s2"><span style="font-size: xx-small;">https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg?utm_source=chrome-ntp-icon</span></span></a><ul class="ul1">
</ul>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-10332051011927828442013-05-24T19:12:00.000+10:002013-05-24T19:14:34.386+10:00Convert an object array to a string array in Java<br />
<ul class="ul1">
<li class="li1"><span style="font-family: Courier New, Courier, monospace;"><span class="s1">System.arraycopy(</span>Object src, int srcPos, Object dest, int destPos, int length);</span></li>
<li class="li2"><span style="font-family: Courier New, Courier, monospace;">Arrays.asList(Object_Array).toArray(new String[Object_Array.length]); </span></li>
<li class="li2">Java 1.6</li>
</ul>
<div class="p2">
<span style="font-family: Courier New, Courier, monospace;">String[] stringArray = Arrays.copyOf(objectArray, objectArray.length, String[].class);</span></div>
<div class="p3">
<br /></div>
<div class="p2">
<b><span style="font-size: xx-small;">Refs</span></b></div>
<ul class="ul1">
<li class="li4"><a href="http://stackoverflow.com/questions/1018750/how-to-convert-object-array-to-string-array-in-java"><span class="s2"><span style="font-size: xx-small;">http://stackoverflow.com/questions/1018750/how-to-convert-object-array-to-string-array-in-java</span></span></a></li>
</ul>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com1tag:blogger.com,1999:blog-1359526885905282890.post-53872095319849246012013-05-10T21:55:00.001+10:002013-05-10T21:55:53.559+10:00Find which process is using a file on MacUse this command<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">lsof | grep <filename></span></blockquote>
<div class="p1">
or</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">lsof <filepath></span></blockquote>
<div class="p1">
To ignore case, use</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">lsof | grep -i <filename></span></blockquote>
<div class="p1">
Run it as root if the process is owned by root,</div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">sudo lsof | grep -i <filename></span></blockquote>
<div class="p1">
<b><span style="font-size: xx-small;">Refs</span></b></div>
<ul class="ul1">
<li class="li4"><a href="http://hints.macworld.com/article.php?story=20040121001144687"><span class="s2"><span style="font-size: xx-small;">http://hints.macworld.com/article.php?story=20040121001144687</span></span></a></li>
<li class="li4"><a href="http://forums.macrumors.com/showthread.php?t=462257"><span class="s2"><span style="font-size: xx-small;">http://forums.macrumors.com/showthread.php?t=462257</span></span></a></li>
</ul>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0tag:blogger.com,1999:blog-1359526885905282890.post-20554168325041002972013-05-10T21:18:00.000+10:002013-05-10T21:18:06.696+10:00Getting the error "oasis-text.icns is in use" when installing LibreOffice on Mac
<br />
<div class="p1">
The full error message is</div>
<div class="p2">
<br /></div>
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">The operation can't be completed because the item "oasis-text.icns" is in use.</span></blockquote>
<div class="p2">
<br /></div>
<div class="p1">
To fix it, just quit the SystemUIServer process in the Activity Monitor.</div>
<div class="p1">
<br /></div>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com5tag:blogger.com,1999:blog-1359526885905282890.post-63600832085985085052013-05-08T20:16:00.000+10:002013-05-08T20:16:23.098+10:00Install Force.com IDE on Eclipse 4.2 (Juno)<ul class="ul1">
<li class="li1"><span class="s1">Use this Force.com IDE Update site <a href="http://www.adnsandbox.com/tools/ide/install/">http://www.adnsandbox.com/tools/ide/install/</a></span></li>
<li class="li2">Copy <span style="font-family: Courier New, Courier, monospace;">org.eclipse.update.ui_3.2.300.v20100512.jar</span> to the <span class="s2" style="font-family: Courier New, Courier, monospace;">eclipse/plugins</span> directory. Get this file from the old version of Eclipse or from this site <a href="http://www.java2s.com/Code/Jar/o/Downloadorgeclipseupdateui32300v20100512jar.htm"><span class="s3">http://www.java2s.com/Code/Jar/o/Downloadorgeclipseupdateui32300v20100512jar.htm</span></a>. If this file is missing, we will get the following error message:-</li>
</ul>
<div class="p4">
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">Cannot complete the install because one or more required items could not be found.<br /> Software being installed: <a href="http://force.com/"><span class="s3">Force.com</span></a> IDE 27.0.0.201302151147 (com.salesforce.ide.feature.feature.group 27.0.0.201302151147)<br /> Missing requirement: <a href="http://force.com/"><span class="s3">Force.com</span></a> IDE 27.0.0.201302151147 (com.salesforce.ide.feature.feature.group 27.0.0.201302151147) requires 'org.eclipse.update.ui 0.0.0' but it could not be found</span></blockquote>
</div>
<div class="p2">
<span style="font-size: xx-small;"><b>Refs</b></span></div>
<ul class="ul1">
<li class="li5"><a href="http://wiki.developerforce.com/page/Force.com_IDE_Installation_for_Eclipse_3.6"><span class="s4" style="font-size: xx-small;">http://wiki.developerforce.com/page/Force.com_IDE_Installation_for_Eclipse_3.6</span></a></li>
<li class="li5"><a href="http://boards.developerforce.com/t5/General-Development/Install-Eclipse-Juno-4-2-with-Force-com-IDE/td-p/462323"><span class="s4" style="font-size: xx-small;">http://boards.developerforce.com/t5/General-Development/Install-Eclipse-Juno-4-2-with-Force-com-IDE/td-p/462323</span></a></li>
</ul>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com3tag:blogger.com,1999:blog-1359526885905282890.post-54250640927652998402012-06-15T22:23:00.000+10:002013-08-17T01:22:35.097+10:00Running Tomboy Note-Taking App on Mac<br />
<div class="p1">
When running Tomboy 1.10.2 on Mac OS X Lion with Mono 2.10.9 installed, I got this error:-</div>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for IgeMacIntegration.IgeMacDock ---> System.EntryPointNotFoundException: ige_mac_dock_get_type</span></blockquote>
<div class="p1">
I found that the <span style="font-family: 'Courier New', Courier, monospace;">ige-mac-integration-sharp.dll</span> library used by Tomboy is not compatible with <span style="font-family: 'Courier New', Courier, monospace;">libigemacintegration.dylib</span> in Mono 2.10.9 (some external functions don't exist any more). I'm new to Mono and this library and I just wanted to get Tomboy to run on Mac and also wanted to keep the latest version of Mono so I did a dirty fix by doing the following:-<br />
<br /></div>
<ul class="ul1">
<li class="li4">Build Tomboy.</li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">git clone git://git.gnome.org/tomboy<br />xbuild Tomboy-mac.sln<br />./bundle-mac-app.sh</span></blockquote>
<ul class="ul1">
<li class="li3">Copy <span style="font-family: 'Courier New', Courier, monospace;">libigemacintegration.0.0.0.dylib</span> from Mono 2.6.x to <span style="font-family: 'Courier New', Courier, monospace;">Tomboy.app/Contents/MacOS</span> and rename it to <span style="font-family: 'Courier New', Courier, monospace;">libigemacintegration.dylib</span><br /><br />
</li>
<li class="li1">Transfer all notes from my Ubuntu machine to Mac.</li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">cp /Volumes/tom-ubuntu/.local/share/tomboy/*.note /Users/tomtanti/Library/Application Support/Tomboy/</span></blockquote>
<ul class="ul1">
<li class="li3">Run Tomboy for testing.</li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">open Tomboy.app</span></blockquote>
<div class="p1">
<ul>
<li>Move Tomboy.app to Applications so that I can simply run it from there in the future.</li>
</ul>
</div>
<div class="p5">
<b>Update (2013-08-17):</b><br />
<a href="http://xmemory.tompium.com/2013/08/run-tomboy-with-mono-32-on-mac.html" target="_blank">New instructions for running Tomboy with Mono 3.2</a><br />
<br /></div>
<div class="p1">
<b><span style="font-size: x-small;">Refs</span></b></div>
<ul class="ul1">
<li class="li6"><a href="https://live.gnome.org/Tomboy/Building/Mac"><span class="s2"><span style="font-size: x-small;">https://live.gnome.org/Tomboy/Building/Mac</span></span></a></li>
<li class="li6"><a href="http://www.sysr.co.uk/2011/09/08/tomboy-notes-does-not-work-on-mac-osx-snow-leopardlion-10-6-10-7/"><span class="s2"><span style="font-size: x-small;">http://www.sysr.co.uk/2011/09/08/tomboy-notes-does-not-work-on-mac-osx-snow-leopardlion-10-6-10-7/</span></span></a></li>
<li class="li6"><a href="https://live.gnome.org/Tomboy/Directories"><span class="s2"><span style="font-size: x-small;">https://live.gnome.org/Tomboy/Directories</span></span></a></li>
</ul>
Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com2tag:blogger.com,1999:blog-1359526885905282890.post-22029507946576193042012-02-06T14:25:00.000+11:002012-02-06T14:28:40.261+11:00Firefox 10 keeps crashingAfter upgrading to Firefox 10, the new version kept crashing every time I opened it. Running it in safe mode (firefox -safe-mode) didn't help.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-c0HChP15Qw0/Ty9IhO2qalI/AAAAAAAABpw/QxlcIW-c0V8/s1600/2012-02-06_14-02-57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://1.bp.blogspot.com/-c0HChP15Qw0/Ty9IhO2qalI/AAAAAAAABpw/QxlcIW-c0V8/s200/2012-02-06_14-02-57.png" width="186" /></a></div>
<br />
<br />
I ended up creating a new profile to fix this problem using the following command and switch:-<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">firefox -P</span></blockquote>
All plugins were gone and needed reinstalling. I could get some data back though from the old profile folder in<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">/home/tom/.mozilla/firefox/xxxx.default</span></blockquote>
<span style="font-size: xx-small;"><b>Refs</b><br />
<a href="http://ubuntuforums.org/showthread.php?p=11595179">http://ubuntuforums.org/showthread.php?p=11595179</a></span><br />
<br />Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com1tag:blogger.com,1999:blog-1359526885905282890.post-20968557735509817282012-01-13T21:47:00.001+11:002012-02-05T10:10:08.988+11:00Make Eclipse look better on Ubuntu<ul>
<li>Compact the look and fix unreadable selected entry in content assist in some themes (e.g. Ambience) by creating a new text file called "<span style="font-family: 'Courier New', Courier, monospace;">gtkrc</span>" (a stylesheet file for GTK apps) with the following content:- </li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">gtk-color-scheme = "selected_text_color:#000000"<br />
style "compact"<br />
{<br />
GtkButton::default_border={0,0,0,0}<br />
GtkButton::default_outside_border={0,0,0,0}<br />
GtkButtonBox::child_min_width=0<br />
GtkButtonBox::child_min_heigth=0<br />
GtkButtonBox::child_internal_pad_x=0<br />
GtkButtonBox::child_internal_pad_y=0<br />
GtkMenu::vertical-padding=1<br />
GtkMenuBar::internal_padding=1<br />
GtkMenuItem::horizontal_padding=4<br />
GtkToolbar::internal-padding=1<br />
GtkToolbar::space-size=1<br />
GtkOptionMenu::indicator_size=0<br />
GtkOptionMenu::indicator_spacing=0<br />
GtkPaned::handle_size=4<br />
GtkRange::trough_border=0<br />
GtkRange::stepper_spacing=0<br />
GtkScale::value_spacing=0<br />
GtkScrolledWindow::scrollbar_spacing=0<br />
GtkExpander::expander_size=10<br />
GtkExpander::expander_spacing=0<br />
GtkTreeView::vertical-separator=0<br />
GtkTreeView::horizontal-separator=0<br />
GtkTreeView::expander-size=12<br />
GtkTreeView::fixed-height-mode=TRUE <br />
GtkWidget::focus_padding=0 <br />
<br />
font_name="Liberation Sans,Sans Regular 8"<br />
text[SELECTED] = @selected_text_color<br />
}<br />
class "GtkWidget" style "compact"<br />
style "compact2"<br />
{<br />
xthickness=1<br />
ythickness=1<br />
}<br />
class "GtkButton" style "compact2"<br />
class "GtkToolbar" style "compact2"<br />
class "GtkPaned" style "compact2" </span></blockquote>
<ul>
<li>To use the above stylesheet with Eclipse (my version is Indigo - 3.7.1), run Eclipse like this:-</li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">GTK2_RC_FILES=$GTK2_RC_FILES:/somewhere_1/gtkrc /somewhere_2/eclipse</span></blockquote>
<ul>
<li>Make tooltip readable by using #000000 as its foreground colour (tooltip_fg_color) and #f5f5b5 as background (tooltip_bg_color) in the following files:- </li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">
/usr/share/themes/<your-current-theme>/gtk-3.0/settings.ini <br />
/usr/share/themes/<your-current-theme>/gtk-3.0/gtk.css <br />
/usr/share/themes/<your-current-theme>/gtk-2.0/gtkrc <br />
</span></blockquote>
<ul>
<li>Install <a href="http://www.eclipsecolorthemes.org/?view=plugin">Eclipse theme colour plugin</a> and may want to try my <a href="http://www.eclipsecolorthemes.org/?view=theme&id=5432">TumCode</a> theme which keeps the number of colours to the minimum.<br /> </li>
<li>Replace the default "<span style="font-family: 'Courier New', Courier, monospace;">Monospace"</span> font with "<span style="font-family: 'Courier New', Courier, monospace;">Liberation Mono"</span> and optionally reduce the font size to 8 or 9.</li>
</ul>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">Windows -> Preferences -> General -> Appearance -> Colors and Fonts</span></blockquote>
<blockquote class="tr_bq">
(for Java Editor Text Font, Javadoc display font, Properties File Editor Text Font, etc.)</blockquote>
<br />
Here is how it looks after the above changes:-<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-rZn9recTFes/TxAKnORT5tI/AAAAAAAABpY/AsGg0GOmBQM/s1600/2012-01-13_21-06-21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="93" src="https://1.bp.blogspot.com/-rZn9recTFes/TxAKnORT5tI/AAAAAAAABpY/AsGg0GOmBQM/s200/2012-01-13_21-06-21.png" width="200" /></a><a href="https://1.bp.blogspot.com/-3iLoZFXE6aM/TxAKlM8YxwI/AAAAAAAABpQ/LMMpImKAD2o/s1600/2012-01-13_21-03-50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="128" src="https://1.bp.blogspot.com/-3iLoZFXE6aM/TxAKlM8YxwI/AAAAAAAABpQ/LMMpImKAD2o/s200/2012-01-13_21-03-50.png" width="200" /></a></div>
<b><span style="font-size: xx-small;">Refs</span></b><br />
<span style="font-size: xx-small;"><a href="http://blog.xam.dk/?p=70">http://blog.xam.dk/?p=70</a> </span><br />
<a href="http://askubuntu.com/questions/70599/how-to-change-tooltip-background-color-in-unity"><span style="font-size: xx-small;">http://askubuntu.com/questions/70599/how-to-change-tooltip-background-color-in-unity</span></a><br />
<a href="http://blog.valotas.com/2010/02/eclipse-on-linux-make-it-look-good.html"><span style="font-size: xx-small;">http://blog.valotas.com/2010/02/eclipse-on-linux-make-it-look-good.html</span></a>Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com3tag:blogger.com,1999:blog-1359526885905282890.post-24041280977669593862011-12-25T10:27:00.003+11:002011-12-25T10:27:58.845+11:00Merry Christmas and a Happy New YearI would like to wish you all a Merry Christmas and a Prosperous New Year. May the season bring you and your family joy and peace.Tom Tantisalidchaihttp://www.blogger.com/profile/04679753014091527612noreply@blogger.com0